[webkit-reviews] review denied: [Bug 36426] Chromium: Crash in WebCore::ArchiveFactory::isArchiveMimeType : [Attachment 53247] Allow didRecieveResponse/didReceiveData interleaving in the case of multipart responses

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 13 07:46:24 PDT 2010


David Levin <levin at chromium.org> has denied Jeremy Moskovich
<playmobil at google.com>'s request for review:
Bug 36426: Chromium: Crash in WebCore::ArchiveFactory::isArchiveMimeType
https://bugs.webkit.org/show_bug.cgi?id=36426

Attachment 53247: Allow didRecieveResponse/didReceiveData interleaving in the
case of multipart responses
https://bugs.webkit.org/attachment.cgi?id=53247&action=review

------- Additional Comments from David Levin <levin at chromium.org>
r- due to enum naming (and the inability to say fix it on landing).


> diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
> @@ -2870,7 +2870,16 @@ void
FrameLoader::finishedLoadingDocument(DocumentLoader* loader)
>  #endif
>      
>      // If loading a webarchive, run through webarchive machinery
> +#if PLATFORM(CHROMIUM)
> +    // https://bugs.webkit.org/show_bug.cgi?id=36426
> +    // FIXME: jeremy at chromium.org - for debugging purposes, should be
removed

No need to add an email name here. (File history will reveal who added this if
there is a question and is typical WK style to not add this.)


> diff --git a/WebKit/chromium/src/ResourceHandle.cpp
b/WebKit/chromium/src/ResourceHandle.cpp

> +    enum ConnectionState {
> +	   CONNECTION_STATE_NEW,
> +	   CONNECTION_STATE_STARTED,
> +	   CONNECTION_STATE_RECEIVED_RESPONSE,
> +	   CONNECTION_STATE_RECEIVING_DATA,
> +	   CONNECTION_STATE_FINISHED_LOADING,
> +	   CONNECTION_STATE_CANCELED,
> +	   CONNECTION_STATE_FAILED,
> +    };

Enum members should user InterCaps with an initial capital letter.

>      ResourceRequest m_request;
>      ResourceHandle* m_owner;
>      ResourceHandleClient* m_client;
>      OwnPtr<WebURLLoader> m_loader;
> +
> +    // Used for sanity checking to make sure we don't experience illegal
state
> +    // transitions.
> +    ConnectionState m_state;
>  };
>  
>  void ResourceHandleInternal::start()
>  {
> +    if (!(m_state == CONNECTION_STATE_NEW))

Why not simply
  if (m_state != CONNECTION_STATE_NEW)
?

> +	   CRASH();

> @@ -135,6 +161,9 @@ void ResourceHandleInternal::didReceiveData(
>      WebURLLoader*, const char* data, int dataLength)
>  {
>      ASSERT(m_client);
> +    if (!(m_state == CONNECTION_STATE_RECEIVED_RESPONSE || m_state ==
CONNECTION_STATE_RECEIVING_DATA))
> +	   CRASH();
> +    m_state = CONNECTION_STATE_RECEIVING_DATA;
>  
>      // FIXME(yurys): it looks like lengthReceived is always the same as
>      // dataLength and that the latter parameter can be eliminated.
> @@ -145,12 +174,17 @@ void ResourceHandleInternal::didReceiveData(
>  void ResourceHandleInternal::didFinishLoading(WebURLLoader*)
>  {
>      ASSERT(m_client);
> +    if (!(m_state == CONNECTION_STATE_RECEIVED_RESPONSE
> +	     || m_state == CONNECTION_STATE_RECEIVING_DATA))

There is no need to fall within 80 columns (and this line is no longer than the
same line just a few lines above in this patch).


More information about the webkit-reviews mailing list