Title: [91153] trunk/Source/WebCore
Revision
91153
Author
[email protected]
Date
2011-07-16 15:39:31 -0700 (Sat, 16 Jul 2011)

Log Message

Work towards determining the cause of frequent crashes due to null frame below
ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache.
https://bugs.webkit.org/show_bug.cgi?id=62764

Patch by Jessie Berlin <[email protected]> on 2011-07-16
Reviewed by Darin Adler.

No loads should be going on for a DocumentLoader that has been detached from its frame, but
that appears to be what is happening in this bug.

Add assertions with the hope that someone will run into this while debugging and thereby find
a reproducible case.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequest):
(WebCore::ResourceLoader::didSendData):
(WebCore::ResourceLoader::didReceiveResponse):
(WebCore::ResourceLoader::didReceiveData):
(WebCore::ResourceLoader::didFinishLoading):
(WebCore::ResourceLoader::didFail):
(WebCore::ResourceLoader::wasBlocked):
(WebCore::ResourceLoader::cannotShowURL):
(WebCore::ResourceLoader::shouldUseCredentialStorage):
(WebCore::ResourceLoader::willCacheResponse):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (91152 => 91153)


--- trunk/Source/WebCore/ChangeLog	2011-07-16 20:12:51 UTC (rev 91152)
+++ trunk/Source/WebCore/ChangeLog	2011-07-16 22:39:31 UTC (rev 91153)
@@ -1,3 +1,29 @@
+2011-07-16  Jessie Berlin  <[email protected]>
+
+        Work towards determining the cause of frequent crashes due to null frame below
+        ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache.
+        https://bugs.webkit.org/show_bug.cgi?id=62764
+
+        Reviewed by Darin Adler.
+
+        No loads should be going on for a DocumentLoader that has been detached from its frame, but
+        that appears to be what is happening in this bug.
+
+        Add assertions with the hope that someone will run into this while debugging and thereby find
+        a reproducible case.
+
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::willSendRequest):
+        (WebCore::ResourceLoader::didSendData):
+        (WebCore::ResourceLoader::didReceiveResponse):
+        (WebCore::ResourceLoader::didReceiveData):
+        (WebCore::ResourceLoader::didFinishLoading):
+        (WebCore::ResourceLoader::didFail):
+        (WebCore::ResourceLoader::wasBlocked):
+        (WebCore::ResourceLoader::cannotShowURL):
+        (WebCore::ResourceLoader::shouldUseCredentialStorage):
+        (WebCore::ResourceLoader::willCacheResponse):
+
 2011-07-16  Sergey Glazunov  <[email protected]>
 
         DOMWindow::open performs a security check on a wrong window

Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (91152 => 91153)


--- trunk/Source/WebCore/loader/ResourceLoader.cpp	2011-07-16 20:12:51 UTC (rev 91152)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp	2011-07-16 22:39:31 UTC (rev 91153)
@@ -224,6 +224,7 @@
 
 void ResourceLoader::willSendRequest(ResourceRequest& request, const ResourceResponse& redirectResponse)
 {
+    ASSERT(documentLoader()->frame());
     // Protect this in this delegate method since the additional processing can do
     // anything including possibly derefing this; one example of this is Radar 3266216.
     RefPtr<ResourceLoader> protector(this);
@@ -246,10 +247,12 @@
 
 void ResourceLoader::didSendData(unsigned long long, unsigned long long)
 {
+    ASSERT(documentLoader()->frame());
 }
 
 void ResourceLoader::didReceiveResponse(const ResourceResponse& r)
 {
+    ASSERT(documentLoader()->frame());
     ASSERT(!m_reachedTerminalState);
 
     // Protect this in this delegate method since the additional processing can do
@@ -267,6 +270,7 @@
 
 void ResourceLoader::didReceiveData(const char* data, int length, long long encodedDataLength, bool allAtOnce)
 {
+    ASSERT(documentLoader()->frame());
     // The following assertions are not quite valid here, since a subclass
     // might override didReceiveData in a way that invalidates them. This
     // happens with the steps listed in 3266216
@@ -441,11 +445,13 @@
 
 void ResourceLoader::didFinishLoading(ResourceHandle*, double finishTime)
 {
+    ASSERT(documentLoader()->frame());
     didFinishLoading(finishTime);
 }
 
 void ResourceLoader::didFail(ResourceHandle*, const ResourceError& error)
 {
+    ASSERT(documentLoader()->frame());
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
     if (documentLoader()->applicationCacheHost()->maybeLoadFallbackForError(this, error))
         return;
@@ -455,16 +461,19 @@
 
 void ResourceLoader::wasBlocked(ResourceHandle*)
 {
+    ASSERT(documentLoader()->frame());
     didFail(blockedError());
 }
 
 void ResourceLoader::cannotShowURL(ResourceHandle*)
 {
+    ASSERT(documentLoader()->frame());
     didFail(cannotShowURLError());
 }
 
 bool ResourceLoader::shouldUseCredentialStorage()
 {
+    ASSERT(documentLoader()->frame());
     RefPtr<ResourceLoader> protector(this);
     return frameLoader()->client()->shouldUseCredentialStorage(documentLoader(), identifier());
 }
@@ -500,6 +509,7 @@
 
 void ResourceLoader::willCacheResponse(ResourceHandle*, CacheStoragePolicy& policy)
 {
+    ASSERT(documentLoader()->frame());
     // <rdar://problem/7249553> - There are reports of crashes with this method being called
     // with a null m_frame->settings(), which can only happen if the frame doesn't have a page.
     // Sadly we have no reproducible cases of this.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to