[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

darin at chromium.org darin at chromium.org
Wed Dec 22 16:26:15 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 80ae74539e884b6e15024bdff403a02f647f6a37
Author: darin at chromium.org <darin at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 23 18:35:28 2010 +0000

    2010-11-18  Darin Fisher  <darin at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            Add a mechanism for creating a WebURLLoader that is associated with a
            particular WebFrame.
            https://bugs.webkit.org/show_bug.cgi?id=49764
    
            This will be used by code that calls webKitClient()->createURLLoader()
            from within the Chromium source tree.
    
            An associated WebURLLoader should be treated like a subresource of the
            WebFrame's document.
    
            * WebKit.gyp:
            * public/WebFrame.h:
            * src/AssociatedURLLoader.cpp: Added.
            (WebKit::AssociatedURLLoader::AssociatedURLLoader):
            (WebKit::AssociatedURLLoader::~AssociatedURLLoader):
            (WebKit::AssociatedURLLoader::loadSynchronously):
            (WebKit::AssociatedURLLoader::loadAsynchronously):
            (WebKit::AssociatedURLLoader::cancel):
            (WebKit::AssociatedURLLoader::setDefersLoading):
            (WebKit::AssociatedURLLoader::PrepareRequest):
            * src/AssociatedURLLoader.h: Added.
            * src/WebFrameImpl.cpp:
            (WebKit::WebFrameImpl::createAssociatedURLLoader):
            * src/WebFrameImpl.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72616 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index fc3adfe..07eadbb 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,32 @@
+2010-11-18  Darin Fisher  <darin at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Add a mechanism for creating a WebURLLoader that is associated with a
+        particular WebFrame.
+        https://bugs.webkit.org/show_bug.cgi?id=49764
+
+        This will be used by code that calls webKitClient()->createURLLoader()
+        from within the Chromium source tree.
+
+        An associated WebURLLoader should be treated like a subresource of the
+        WebFrame's document.
+
+        * WebKit.gyp:
+        * public/WebFrame.h:
+        * src/AssociatedURLLoader.cpp: Added.
+        (WebKit::AssociatedURLLoader::AssociatedURLLoader):
+        (WebKit::AssociatedURLLoader::~AssociatedURLLoader):
+        (WebKit::AssociatedURLLoader::loadSynchronously):
+        (WebKit::AssociatedURLLoader::loadAsynchronously):
+        (WebKit::AssociatedURLLoader::cancel):
+        (WebKit::AssociatedURLLoader::setDefersLoading):
+        (WebKit::AssociatedURLLoader::PrepareRequest):
+        * src/AssociatedURLLoader.h: Added.
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::createAssociatedURLLoader):
+        * src/WebFrameImpl.h:
+
 2010-11-23  Satish Sampath  <satish at chromium.org>
 
         Unreviewed, chromium build fix.
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index d5d937a..6cf9130 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -290,6 +290,8 @@
                 'src/ApplicationCacheHost.cpp',
                 'src/ApplicationCacheHostInternal.h',
                 'src/AssertMatchingEnums.cpp',
+                'src/AssociatedURLLoader.cpp',
+                'src/AssociatedURLLoader.h',
                 'src/AsyncFileSystemChromium.cpp',
                 'src/AsyncFileSystemChromium.h',
                 'src/AsyncFileWriterChromium.cpp',
diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h
index 8f2c861..30bf03b 100644
--- a/WebKit/chromium/public/WebFrame.h
+++ b/WebKit/chromium/public/WebFrame.h
@@ -61,6 +61,7 @@ class WebRange;
 class WebSecurityOrigin;
 class WebString;
 class WebURL;
+class WebURLLoader;
 class WebURLRequest;
 class WebView;
 struct WebConsoleMessage;
@@ -327,8 +328,14 @@ public:
     // Called to associate the WebURLRequest with this frame.  The request
     // will be modified to inherit parameters that allow it to be loaded.
     // This method ends up triggering WebFrameClient::willSendRequest.
+    // DEPRECATED: Please use createAssociatedURLLoader instead.
     virtual void dispatchWillSendRequest(WebURLRequest&) = 0;
 
+    // Returns a WebURLLoader that is associated with this frame.  The loader
+    // will, for example, be cancelled when WebFrame::stopLoading is called.
+    // FIXME: stopLoading does not yet cancel an associated loader!!
+    virtual WebURLLoader* createAssociatedURLLoader() = 0;
+
     // Called from within WebFrameClient::didReceiveDocumentData to commit
     // data for the frame that will be used to construct the frame's
     // document.
diff --git a/WebKit/chromium/src/AssociatedURLLoader.cpp b/WebKit/chromium/src/AssociatedURLLoader.cpp
new file mode 100644
index 0000000..f494a0e
--- /dev/null
+++ b/WebKit/chromium/src/AssociatedURLLoader.cpp
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "AssociatedURLLoader.h"
+
+#include "WebApplicationCacheHost.h"
+#include "WebDataSource.h"
+#include "WebFrameImpl.h"
+#include "WebKit.h"
+#include "WebKitClient.h"
+#include "WebURLRequest.h"
+
+namespace WebKit {
+
+AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl)
+    : m_frameImpl(frameImpl),
+      m_realLoader(webKitClient()->createURLLoader())
+{
+}
+
+AssociatedURLLoader::~AssociatedURLLoader()
+{
+}
+
+void AssociatedURLLoader::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, WebData& data)
+{
+    WebURLRequest requestCopy(request);
+    prepareRequest(requestCopy);
+
+    m_realLoader->loadSynchronously(requestCopy, response, error, data);
+}
+
+void AssociatedURLLoader::loadAsynchronously(const WebURLRequest& request, WebURLLoaderClient* client)
+{
+    WebURLRequest requestCopy(request);
+    prepareRequest(requestCopy);
+
+    m_realLoader->loadAsynchronously(requestCopy, client);
+}
+
+void AssociatedURLLoader::cancel()
+{
+    m_realLoader->cancel();
+}
+
+void AssociatedURLLoader::setDefersLoading(bool defersLoading)
+{
+    m_realLoader->setDefersLoading(defersLoading);
+}
+
+void AssociatedURLLoader::prepareRequest(WebURLRequest& request)
+{
+    WebApplicationCacheHost* applicationCacheHost = m_frameImpl->dataSource()->applicationCacheHost();
+    if (applicationCacheHost)
+        applicationCacheHost->willStartSubResourceRequest(request);
+    m_frameImpl->dispatchWillSendRequest(request);
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/AssociatedURLLoader.h b/WebKit/chromium/src/AssociatedURLLoader.h
new file mode 100644
index 0000000..4c9f54e
--- /dev/null
+++ b/WebKit/chromium/src/AssociatedURLLoader.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AssociatedURLLoader_h
+#define AssociatedURLLoader_h
+
+#include "WebURLLoader.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace WebKit {
+
+class WebFrameImpl;
+
+// This class is used to implement WebFrame::createAssociatedURLLoader.
+// FIXME: Implement in terms of WebCore::SubresourceLoader.
+class AssociatedURLLoader : public WebURLLoader {
+public:
+    AssociatedURLLoader(PassRefPtr<WebFrameImpl>);
+    ~AssociatedURLLoader();
+
+    // WebURLLoader methods:
+    virtual void loadSynchronously(const WebURLRequest&, WebURLResponse&, WebURLError&, WebData&);
+    virtual void loadAsynchronously(const WebURLRequest&, WebURLLoaderClient*);
+    virtual void cancel();
+    virtual void setDefersLoading(bool);
+
+private:
+    void prepareRequest(WebURLRequest&);
+
+    RefPtr<WebFrameImpl> m_frameImpl;
+    OwnPtr<WebURLLoader> m_realLoader;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index adaab61..4422e1b 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -71,6 +71,7 @@
 #include "config.h"
 #include "WebFrameImpl.h"
 
+#include "AssociatedURLLoader.h"
 #include "Chrome.h"
 #include "ChromiumBridge.h"
 #include "ClipboardUtilitiesChromium.h"
@@ -1037,6 +1038,11 @@ void WebFrameImpl::dispatchWillSendRequest(WebURLRequest& request)
         0, 0, request.toMutableResourceRequest(), response);
 }
 
+WebURLLoader* WebFrameImpl::createAssociatedURLLoader()
+{
+    return new AssociatedURLLoader(this);
+}
+
 void WebFrameImpl::commitDocumentData(const char* data, size_t length)
 {
     m_frame->loader()->documentLoader()->commitData(data, length);
diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h
index 35158a1..52d9db4 100644
--- a/WebKit/chromium/src/WebFrameImpl.h
+++ b/WebKit/chromium/src/WebFrameImpl.h
@@ -128,6 +128,7 @@ public:
     virtual bool isViewSourceModeEnabled() const;
     virtual void setReferrerForRequest(WebURLRequest&, const WebURL& referrer);
     virtual void dispatchWillSendRequest(WebURLRequest&);
+    virtual WebURLLoader* createAssociatedURLLoader();
     virtual void commitDocumentData(const char* data, size_t length);
     virtual unsigned unloadListenerCount() const;
     virtual bool isProcessingUserGesture() const;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list