[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-142-g786665c

mitz at apple.com mitz at apple.com
Mon Dec 27 16:29:03 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b6b52cd607a2e50645f5ff4e439148c8916934bd
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 22 04:10:36 2010 +0000

    2010-12-21  Dan Bernstein  <mitz at apple.com>
    
            Reviewed by Sam Weinig.
    
            <rdar://problem/8668230> REGRESSION (r71884): Returning alternate requests from willSendRequest can prevent other requests from ever being sent
            https://bugs.webkit.org/show_bug.cgi?id=51413
    
            71884 was wrong in moving willSendRequest to ResourceLoader::start(). It’s wrong to do all the
            scheduling, which is host-dependent, before calling willSendRequest, because the latter can
            change the host.
    
            * loader/NetscapePlugInStreamLoader.cpp:
            (WebCore::NetscapePlugInStreamLoader::create): Check the return value from ResourceLoader::init()
            and return 0 if it is false.
            * loader/ResourceLoader.cpp:
            (WebCore::ResourceLoader::init): Made this function return a boolean. Moved the call to willSendRequest()
            from start() into here. Return false if willSendRequest() canceled the request.
            (WebCore::ResourceLoader::start): Moved the call to willSendRequest() from here to init().
            * loader/ResourceLoader.h:
            * loader/SubresourceLoader.cpp:
            (WebCore::SubresourceLoader::create): Check the return value from ResourceLoader::init()
            and return 0 if it is false.
    2010-12-21  Dan Bernstein  <mitz at apple.com>
    
            Reviewed by Sam Weinig.
    
            <rdar://problem/8668230> REGRESSION (r71884): Returning alternate requests from willSendRequest can prevent other requests from ever being sent
            https://bugs.webkit.org/show_bug.cgi?id=51413
    
            * platform/mac/security/block-test-expected.txt: Reverted r71884.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74453 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d606998..a08424e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-12-21  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        <rdar://problem/8668230> REGRESSION (r71884): Returning alternate requests from willSendRequest can prevent other requests from ever being sent
+        https://bugs.webkit.org/show_bug.cgi?id=51413
+
+        * platform/mac/security/block-test-expected.txt: Reverted r71884.
+
 2010-12-21  Benjamin Kalman  <kalman at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/platform/mac/security/block-test-expected.txt b/LayoutTests/platform/mac/security/block-test-expected.txt
index 14f074e..56a5de2 100644
--- a/LayoutTests/platform/mac/security/block-test-expected.txt
+++ b/LayoutTests/platform/mac/security/block-test-expected.txt
@@ -1,7 +1,7 @@
 http://255.255.255.255:1/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:1/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null)
 <unknown> - didFinishLoading
-http://255.255.255.255:1/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:1/test.jpg">
 http://255.255.255.255:7/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:7/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null)
+http://255.255.255.255:1/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:1/test.jpg">
 http://255.255.255.255:7/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:7/test.jpg">
 http://255.255.255.255:9/test.jpg - willSendRequest <NSURLRequest URL http://255.255.255.255:9/test.jpg, main document URL block-test.html, http method GET> redirectResponse (null)
 http://255.255.255.255:9/test.jpg - didFailLoadingWithError: <NSError domain WebKitErrorDomain, code 103, failing URL "http://255.255.255.255:9/test.jpg">
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fecda50..ca2a8b0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2010-12-21  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        <rdar://problem/8668230> REGRESSION (r71884): Returning alternate requests from willSendRequest can prevent other requests from ever being sent
+        https://bugs.webkit.org/show_bug.cgi?id=51413
+
+        71884 was wrong in moving willSendRequest to ResourceLoader::start(). It’s wrong to do all the
+        scheduling, which is host-dependent, before calling willSendRequest, because the latter can
+        change the host.
+
+        * loader/NetscapePlugInStreamLoader.cpp:
+        (WebCore::NetscapePlugInStreamLoader::create): Check the return value from ResourceLoader::init()
+        and return 0 if it is false.
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::init): Made this function return a boolean. Moved the call to willSendRequest()
+        from start() into here. Return false if willSendRequest() canceled the request.
+        (WebCore::ResourceLoader::start): Moved the call to willSendRequest() from here to init().
+        * loader/ResourceLoader.h:
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::create): Check the return value from ResourceLoader::init()
+        and return 0 if it is false.
+
 2010-12-21  Benjamin Kalman  <kalman at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/loader/NetscapePlugInStreamLoader.cpp b/WebCore/loader/NetscapePlugInStreamLoader.cpp
index 8c2a426..75a2fe9 100644
--- a/WebCore/loader/NetscapePlugInStreamLoader.cpp
+++ b/WebCore/loader/NetscapePlugInStreamLoader.cpp
@@ -49,7 +49,9 @@ PassRefPtr<NetscapePlugInStreamLoader> NetscapePlugInStreamLoader::create(Frame*
     RefPtr<NetscapePlugInStreamLoader> loader(adoptRef(new NetscapePlugInStreamLoader(frame, client)));
     loader->setShouldBufferData(false);
     loader->documentLoader()->addPlugInStreamLoader(loader.get());
-    loader->init(request);
+    if (!loader->init(request))
+        return 0;
+
     return loader.release();
 }
 
diff --git a/WebCore/loader/ResourceLoader.cpp b/WebCore/loader/ResourceLoader.cpp
index 39288bd..de39986 100644
--- a/WebCore/loader/ResourceLoader.cpp
+++ b/WebCore/loader/ResourceLoader.cpp
@@ -110,7 +110,7 @@ void ResourceLoader::releaseResources()
     m_deferredRequest = ResourceRequest();
 }
 
-void ResourceLoader::init(const ResourceRequest& r)
+bool ResourceLoader::init(const ResourceRequest& r)
 {
     ASSERT(!m_handle);
     ASSERT(m_request.isNull());
@@ -130,6 +130,14 @@ void ResourceLoader::init(const ResourceRequest& r)
     }
 
     m_request = clientRequest;
+
+    willSendRequest(m_request, ResourceResponse());
+    if (m_request.isNull()) {
+        didFail(frameLoader()->cancelledError(m_request));
+        return false;
+    }
+
+    return true;
 }
 
 void ResourceLoader::start()
@@ -138,12 +146,6 @@ void ResourceLoader::start()
     ASSERT(!m_request.isNull());
     ASSERT(m_deferredRequest.isNull());
 
-    willSendRequest(m_request, ResourceResponse());
-    if (m_request.isNull()) {
-        didFail(frameLoader()->cancelledError(m_request));
-        return;
-    }    
-    
     if (m_documentLoader->scheduleArchiveLoad(this, m_request, m_request.url()))
         return;
     
diff --git a/WebCore/loader/ResourceLoader.h b/WebCore/loader/ResourceLoader.h
index 34cdd97..9f842c7 100644
--- a/WebCore/loader/ResourceLoader.h
+++ b/WebCore/loader/ResourceLoader.h
@@ -54,7 +54,7 @@ namespace WebCore {
 
         void cancel();
 
-        virtual void init(const ResourceRequest&);
+        virtual bool init(const ResourceRequest&);
 
         FrameLoader* frameLoader() const;
         DocumentLoader* documentLoader() const { return m_documentLoader.get(); }
diff --git a/WebCore/loader/SubresourceLoader.cpp b/WebCore/loader/SubresourceLoader.cpp
index e99e0e6..4f7353a 100644
--- a/WebCore/loader/SubresourceLoader.cpp
+++ b/WebCore/loader/SubresourceLoader.cpp
@@ -86,7 +86,8 @@ PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, Subresourc
 
     RefPtr<SubresourceLoader> subloader(adoptRef(new SubresourceLoader(frame, client, sendResourceLoadCallbacks, shouldContentSniff)));
     subloader->documentLoader()->addSubresourceLoader(subloader.get());
-    subloader->init(newRequest);
+    if (!subloader->init(newRequest))
+        return 0;
 
     return subloader.release();
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list