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

bweinstein at apple.com bweinstein at apple.com
Wed Dec 22 18:41:03 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1438c877ea595a3f94cfff9deb972be4b804706f
Author: bweinstein at apple.com <bweinstein at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 15 19:34:25 2010 +0000

    WebKit2: WebPageWin needs implementations of hasLocalDataForURL and canHandleRequest
    https://bugs.webkit.org/show_bug.cgi?id=51090
    
    Reviewed by Adam Roben.
    
    Implement these functions for WebKit2 on Windows.
    
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::hasLocalDataForURL): Does the cross-platform part of the check for having local
        data (file URL or subresource), then calls platformHasLocalDataForURL to let the platform do
        their specific checks.
    * WebProcess/WebPage/WebPage.h:
    * WebProcess/WebPage/mac/WebPageMac.mm:
    (WebKit::WebPage::platformHasLocalDataForURL): Moved the cross-platform code from here to WebPage::hasLocalDataForURL.
    * WebProcess/WebPage/qt/WebPageQt.cpp:
    (WebKit::WebPage::platformHasLocalDataForURL): Renamed from hasLocalDataForURL.
    * WebProcess/WebPage/win/WebPageWin.cpp:
    (WebKit::WebPage::platformHasLocalDataForURL): Renamed from hasLocalDataForURL and implemented with CFNetwork calls. This is the
        CFNetwork equivalent of the code in WebPageMac::platformHasLocalDataForURL.
    (WebKit::WebPage::canHandleRequest): Copied the line of code from WebView::canHandleRequest in WebKit1, with a FIXME saying
        this might not be enough (although it was in WebKit1 on Windows).
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74131 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 2abc126..9c5d9f8 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,27 @@
+2010-12-15  Brian Weinstein  <bweinstein at apple.com>
+
+        Reviewed by Adam Roben.
+
+        WebKit2: WebPageWin needs implementations of hasLocalDataForURL and canHandleRequest
+        https://bugs.webkit.org/show_bug.cgi?id=51090
+        
+        Implement these functions for WebKit2 on Windows.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::hasLocalDataForURL): Does the cross-platform part of the check for having local
+            data (file URL or subresource), then calls platformHasLocalDataForURL to let the platform do
+            their specific checks.
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::platformHasLocalDataForURL): Moved the cross-platform code from here to WebPage::hasLocalDataForURL.
+        * WebProcess/WebPage/qt/WebPageQt.cpp:
+        (WebKit::WebPage::platformHasLocalDataForURL): Renamed from hasLocalDataForURL.
+        * WebProcess/WebPage/win/WebPageWin.cpp:
+        (WebKit::WebPage::platformHasLocalDataForURL): Renamed from hasLocalDataForURL and implemented with CFNetwork calls. This is the
+            CFNetwork equivalent of the code in WebPageMac::platformHasLocalDataForURL.
+        (WebKit::WebPage::canHandleRequest): Copied the line of code from WebView::canHandleRequest in WebKit1, with a FIXME saying
+            this might not be enough (although it was in WebKit1 on Windows).
+
 2010-12-15  Sheriff Bot  <webkit.review.bot at gmail.com>
 
         Unreviewed, rolling out r74117.
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index c3b92a7..e8c77ed 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -58,8 +58,10 @@
 #include "WebProcessProxyMessageKinds.h"
 #include "WebProcessProxyMessages.h"
 #include <WebCore/AbstractDatabase.h>
+#include <WebCore/ArchiveResource.h>
 #include <WebCore/Chrome.h>
 #include <WebCore/ContextMenuController.h>
+#include <WebCore/DocumentLoader.h>
 #include <WebCore/EventHandler.h>
 #include <WebCore/FocusController.h>
 #include <WebCore/Frame.h>
@@ -1264,4 +1266,17 @@ void WebPage::SandboxExtensionTracker::didFailProvisionalLoad(WebFrame* frame)
     m_provisionalSandboxExtension = 0;
 }
 
+bool WebPage::hasLocalDataForURL(const KURL& url)
+{
+    if (url.isLocalFile())
+        return true;
+
+    FrameLoader* frameLoader = m_page->mainFrame()->loader();
+    DocumentLoader* documentLoader = frameLoader ? frameLoader->documentLoader() : 0;
+    if (documentLoader && documentLoader->subresource(url))
+        return true;
+
+    return platformHasLocalDataForURL(url);
+}
+
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index eef827f..cb10bba 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -267,6 +267,8 @@ private:
 
     void loadData(PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::KURL& baseURL, const WebCore::KURL& failingURL);
 
+    bool platformHasLocalDataForURL(const WebCore::KURL&);
+
     // Actions
     void tryClose();
     void loadURL(const String&, const SandboxExtension::Handle& sandboxExtensionHandle);
diff --git a/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm b/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
index 7bb3115..12c7700 100644
--- a/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
+++ b/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
@@ -30,8 +30,6 @@
 #include "WebEvent.h"
 #include "WebPageProxyMessages.h"
 #include "WebProcess.h"
-#include <WebCore/ArchiveResource.h>
-#include <WebCore/DocumentLoader.h>
 #include <WebCore/FocusController.h>
 #include <WebCore/Frame.h>
 #include <WebCore/FrameView.h>
@@ -342,16 +340,8 @@ bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboard
     return true;
 }
 
-bool WebPage::hasLocalDataForURL(const WebCore::KURL& url)
+bool WebPage::platformHasLocalDataForURL(const WebCore::KURL& url)
 {
-    if (url.isLocalFile())
-        return true;
-    
-    FrameLoader* frameLoader = m_page->mainFrame()->loader();
-    DocumentLoader* documentLoader = frameLoader ? frameLoader->documentLoader() : 0;
-    if (documentLoader && documentLoader->subresource(url))
-        return true;
-
     NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:url];
     [request setValue:(NSString*)userAgent() forHTTPHeaderField:@"User-Agent"];
     NSCachedURLResponse *cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
diff --git a/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp b/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
index b65fa18..fe1a89c 100644
--- a/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
+++ b/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
@@ -264,7 +264,7 @@ bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboard
     return true;
 }
 
-bool WebPage::hasLocalDataForURL(const WebCore::KURL&)
+bool WebPage::platformHasLocalDataForURL(const WebCore::KURL&)
 {
     // FIXME: Implement
     return false;
diff --git a/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp b/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
index bc3b131..20b95ee 100644
--- a/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
+++ b/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
@@ -40,6 +40,12 @@
 #endif
 #include <WinUser.h>
 
+#if USE(CFNETWORK)
+#include <CFNetwork/CFURLCachePriv.h>
+#include <CFNetwork/CFURLProtocolPriv.h>
+#include <CFNetwork/CFURLRequestPriv.h>
+#endif
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -236,16 +242,28 @@ bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboard
     return true;
 }
 
-bool WebPage::hasLocalDataForURL(const WebCore::KURL&)
+bool WebPage::platformHasLocalDataForURL(const WebCore::KURL& url)
 {
-    // FIXME <rdar://problem/8608754>: Implement
+#if USE(CFNETWORK)
+    RetainPtr<CFURLRef> cfURL(AdoptCF, url.createCFURL());
+    RetainPtr<CFMutableURLRequestRef> request(AdoptCF, CFURLRequestCreateMutable(0, cfURL.get(), kCFURLRequestCachePolicyReloadIgnoringCache, 60, 0));
+    
+    RetainPtr<CFStringRef> userAgent(AdoptCF, userAgent().createCFString());
+    CFURLRequestSetHTTPHeaderFieldValue(request.get(), CFSTR("User-Agent"), userAgent.get());
+
+    RetainPtr<CFURLCacheRef> cache(AdoptCF, CFURLCacheCopySharedURLCache());
+
+    RetainPtr<CFCachedURLResponseRef> response(AdoptCF, CFURLCacheCopyResponseForRequest(cache.get(), request.get()));    
+    return response;
+#else
     return false;
+#endif
 }
 
-bool WebPage::canHandleRequest(const WebCore::ResourceRequest&)
+bool WebPage::canHandleRequest(const WebCore::ResourceRequest& request)
 {
-    // FIXME <rdar://problem/8608754>: Implement
-    return true;
+    // FIXME: Are there other requests we need to be able to handle? WebKit1's WebView.cpp has a FIXME here as well.
+    return CFURLProtocolCanHandleRequest(request.cfURLRequest());
 }
 
 } // namespace WebKit

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list