Changeset 100218 in webkit


Ignore:
Timestamp:
Nov 14, 2011 4:57:53 PM (12 years ago)
Author:
gavinp@chromium.org
Message:

MERGE 71122 and 72068 simultaniously.

71122:

properly end requests when a bad status code return happens

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

Calling error without ending the request set up the CachedResourceRequest so that it could
actually send out two notifyFinished() events. This probably was the root cause of
lots of crashing instability; I know from crbug.com/75604 that this bug was causing lots
of crashes in ScriptRunner/ScriptElement for instance.

The fix is easy: just properly end the request instead of just calling error, and we won't
re-notify.

Reviewed by Nate Chapin.

No new tests, as the problem wasn't very amenable to layout tests.

There is a chromium test going through code review at http://codereview.chromium.org/8404001/

  • loader/cache/CachedResourceRequest.cpp:

(WebCore::CachedResourceRequest::didReceiveData):

72068:

Protect Document during error responses

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

Add a Document protector to the error response code handler, just
as exists for other ends of requests.

Reviewed by Nate Chapin.

Source/WebCore:

Test: http/tests/misc/xslt-bad-import.html

  • loader/cache/CachedResourceRequest.cpp:

(WebCore::CachedResourceRequest::didReceiveData):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/chromium/912/Source/WebCore/loader/cache/CachedResourceRequest.cpp

    r97637 r100218  
    272272        return;
    273273
    274     if (m_resource->response().httpStatusCode() >= 400) {
    275         if (!m_resource->shouldIgnoreHTTPStatusCodeErrors())
    276             m_resource->error(CachedResource::LoadError);
     274    if (m_resource->response().httpStatusCode() >= 400 && !m_resource->shouldIgnoreHTTPStatusCodeErrors()) {
     275        // Prevent the document from being destroyed before we are done with
     276        // the cachedResourceLoader that it will delete when the document gets deleted.
     277        RefPtr<Document> protector(m_cachedResourceLoader->document());
     278        if (!m_multipart)
     279            m_cachedResourceLoader->decrementRequestCount(m_resource);
     280        m_finishing = true;
     281        m_loader->clearClient();
     282        m_resource->error(CachedResource::LoadError);
     283        end();
    277284        return;
    278285    }
Note: See TracChangeset for help on using the changeset viewer.