Crash in WebCore::SubresourceLoader::willSendRequest.
authorjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Oct 2012 01:10:13 +0000 (01:10 +0000)
committerjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Oct 2012 01:10:13 +0000 (01:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=100147

Reviewed by Abhishek Arya.

No new tests. There is a test case that should cover this, but it doesn't
work correctly on many platforms due to its use of testRunner.addURLToRedirect().
See http/tests/loading/cross-origin-XHR-willLoadRequest.html.
Tested manually on http://www.nick.co.uk/shows/spongebob

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequest):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132287 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/loader/SubresourceLoader.cpp

index 297d735..d426698 100644 (file)
@@ -1,3 +1,18 @@
+2012-10-23  Nate Chapin  <japhet@chromium.org>
+
+        Crash in WebCore::SubresourceLoader::willSendRequest.
+        https://bugs.webkit.org/show_bug.cgi?id=100147
+
+        Reviewed by Abhishek Arya.
+
+        No new tests. There is a test case that should cover this, but it doesn't
+        work correctly on many platforms due to its use of testRunner.addURLToRedirect().
+        See http/tests/loading/cross-origin-XHR-willLoadRequest.html.
+        Tested manually on http://www.nick.co.uk/shows/spongebob
+
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::willSendRequest):
+
 2012-10-23  Martin Robinson  <mrobinson@igalia.com>
 
         [GTK][Soup] Implement the default authentication dialog via WebCoreSupport
index e39ae2f..2585142 100644 (file)
@@ -128,6 +128,7 @@ void SubresourceLoader::willSendRequest(ResourceRequest& newRequest, const Resou
 {
     // Store the previous URL because the call to ResourceLoader::willSendRequest will modify it.
     KURL previousURL = request().url();
+    RefPtr<SubresourceLoader> protect(this);
 
     ASSERT(!newRequest.isNull());
     if (!previousURL.isNull() && previousURL != newRequest.url()) {