Changeset 57520 in webkit


Ignore:
Timestamp:
Apr 13, 2010 10:08:32 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-13 Jeremy Moskovich <jeremy@chromium.org>

Reviewed by David Levin.

Add some diagnostics to try to track down cause of crash in ArchiveFactory::isArchiveMimeType().

https://bugs.webkit.org/show_bug.cgi?id=36426

No new tests as there is no new functionality.

  • loader/FrameLoader.cpp: (WebCore::FrameLoader::finishedLoadingDocument): Make copy of mimeType string to isolate crash.

2010-04-13 Jeremy Moskovich <jeremy@chromium.org>

Reviewed by David Levin.

Add some diagnostics to try to track down cause of crash in ArchiveFactory::isArchiveMimeType().

https://bugs.webkit.org/show_bug.cgi?id=36426

  • src/ResourceHandle.cpp: Track state across ResourceHandle invocations. (WebCore::ResourceHandleInternal::ResourceHandleInternal): (WebCore::ResourceHandleInternal::): (WebCore::ResourceHandleInternal::start): (WebCore::ResourceHandleInternal::cancel): (WebCore::ResourceHandleInternal::didReceiveResponse): (WebCore::ResourceHandleInternal::didReceiveData): (WebCore::ResourceHandleInternal::didFinishLoading): (WebCore::ResourceHandleInternal::didFail):
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r57519 r57520  
     12010-04-13  Jeremy Moskovich  <jeremy@chromium.org>
     2
     3        Reviewed by David Levin.
     4
     5        Add some diagnostics to try to track down cause of crash in ArchiveFactory::isArchiveMimeType().
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=36426
     8
     9        No new tests as there is no new functionality.
     10
     11        * loader/FrameLoader.cpp:
     12        (WebCore::FrameLoader::finishedLoadingDocument): Make copy of mimeType string to isolate crash.
     13
    1142010-04-13  Abhishek Arya  <inferno@chromium.org>
    215
  • trunk/WebCore/loader/FrameLoader.cpp

    r57469 r57520  
    28712871   
    28722872    // If loading a webarchive, run through webarchive machinery
     2873#if PLATFORM(CHROMIUM)
     2874    // https://bugs.webkit.org/show_bug.cgi?id=36426
     2875    // FIXME: For debugging purposes, should be removed before closing the bug.
     2876    // Make real copy of the string so we fail here if the responseMIMEType
     2877    // string is bad.
     2878    const String responseMIMEType = loader->responseMIMEType();
     2879#else
    28732880    const String& responseMIMEType = loader->responseMIMEType();
     2881#endif
    28742882
    28752883    // FIXME: Mac's FrameLoaderClient::finishedLoading() method does work that is required even with Archive loads
  • trunk/WebKit/chromium/ChangeLog

    r57508 r57520  
     12010-04-13  Jeremy Moskovich  <jeremy@chromium.org>
     2
     3        Reviewed by David Levin.
     4
     5        Add some diagnostics to try to track down cause of crash in ArchiveFactory::isArchiveMimeType().
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=36426
     8
     9        * src/ResourceHandle.cpp: Track state across ResourceHandle invocations.
     10        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
     11        (WebCore::ResourceHandleInternal::):
     12        (WebCore::ResourceHandleInternal::start):
     13        (WebCore::ResourceHandleInternal::cancel):
     14        (WebCore::ResourceHandleInternal::didReceiveResponse):
     15        (WebCore::ResourceHandleInternal::didReceiveData):
     16        (WebCore::ResourceHandleInternal::didFinishLoading):
     17        (WebCore::ResourceHandleInternal::didFail):
     18
    1192010-04-13  Mikhail Naganov  <mnaganov@chromium.org>
    220
  • trunk/WebKit/chromium/src/ResourceHandle.cpp

    r56469 r57520  
    5858        , m_owner(0)
    5959        , m_client(client)
     60        , m_state(ConnectionStateNew)
    6061    {
    6162    }
     
    7576    virtual void didFail(WebURLLoader*, const WebURLError&);
    7677
     78    enum ConnectionState {
     79        ConnectionStateNew,
     80        ConnectionStateStarted,
     81        ConnectionStateReceivedResponse,
     82        ConnectionStateReceivingData,
     83        ConnectionStateFinishedLoading,
     84        ConnectionStateCanceled,
     85        ConnectionStateFailed,
     86    };
     87
    7788    ResourceRequest m_request;
    7889    ResourceHandle* m_owner;
    7990    ResourceHandleClient* m_client;
    8091    OwnPtr<WebURLLoader> m_loader;
     92
     93    // Used for sanity checking to make sure we don't experience illegal state
     94    // transitions.
     95    ConnectionState m_state;
    8196};
    8297
    8398void ResourceHandleInternal::start()
    8499{
     100    if (m_state != ConnectionStateNew)
     101        CRASH();
     102    m_state = ConnectionStateStarted;
     103
    85104    m_loader.set(webKitClient()->createURLLoader());
    86105    ASSERT(m_loader.get());
     
    93112void ResourceHandleInternal::cancel()
    94113{
     114    m_state = ConnectionStateCanceled;
    95115    m_loader->cancel();
    96116
     
    129149    ASSERT(m_client);
    130150    ASSERT(!response.isNull());
     151    bool isMultipart = response.isMultipartPayload();
     152    bool isValidStateTransition = (m_state == ConnectionStateStarted || m_state == ConnectionStateReceivedResponse);
     153    // In the case of multipart loads, calls to didReceiveData & didReceiveResponse can be interleaved.
     154    if (!isMultipart && !isValidStateTransition)
     155        CRASH();
     156    m_state = ConnectionStateReceivedResponse;
    131157    m_client->didReceiveResponse(m_owner, response.toResourceResponse());
    132158}
     
    136162{
    137163    ASSERT(m_client);
     164    if (m_state != ConnectionStateReceivedResponse && m_state != ConnectionStateReceivingData)
     165        CRASH();
     166    m_state = ConnectionStateReceivingData;
    138167
    139168    // FIXME(yurys): it looks like lengthReceived is always the same as
     
    146175{
    147176    ASSERT(m_client);
     177    if (m_state != ConnectionStateReceivedResponse && m_state != ConnectionStateReceivingData)
     178        CRASH();
     179    m_state = ConnectionStateFinishedLoading;
    148180    m_client->didFinishLoading(m_owner);
    149181}
     
    152184{
    153185    ASSERT(m_client);
     186    m_state = ConnectionStateFailed;
    154187    m_client->didFail(m_owner, error);
    155188}
Note: See TracChangeset for help on using the changeset viewer.