Title: [100218] branches/chromium/912/Source/WebCore/loader/cache/CachedResourceRequest.cpp
- Revision
- 100218
- Author
- [email protected]
- Date
- 2011-11-14 16:57:53 -0800 (Mon, 14 Nov 2011)
Log 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):
Modified Paths
Diff
Modified: branches/chromium/912/Source/WebCore/loader/cache/CachedResourceRequest.cpp (100217 => 100218)
--- branches/chromium/912/Source/WebCore/loader/cache/CachedResourceRequest.cpp 2011-11-15 00:51:31 UTC (rev 100217)
+++ branches/chromium/912/Source/WebCore/loader/cache/CachedResourceRequest.cpp 2011-11-15 00:57:53 UTC (rev 100218)
@@ -271,9 +271,16 @@
if (m_resource->errorOccurred())
return;
- if (m_resource->response().httpStatusCode() >= 400) {
- if (!m_resource->shouldIgnoreHTTPStatusCodeErrors())
- m_resource->error(CachedResource::LoadError);
+ if (m_resource->response().httpStatusCode() >= 400 && !m_resource->shouldIgnoreHTTPStatusCodeErrors()) {
+ // Prevent the document from being destroyed before we are done with
+ // the cachedResourceLoader that it will delete when the document gets deleted.
+ RefPtr<Document> protector(m_cachedResourceLoader->document());
+ if (!m_multipart)
+ m_cachedResourceLoader->decrementRequestCount(m_resource);
+ m_finishing = true;
+ m_loader->clearClient();
+ m_resource->error(CachedResource::LoadError);
+ end();
return;
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes