<rdar://problem/10809525> WebKit2’s WebFrameLoaderClient::shouldUseCredentialStorage...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 5 Feb 2012 18:51:03 +0000 (18:51 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 5 Feb 2012 18:51:03 +0000 (18:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77823

Reviewed by Anders Carlsson.

Source/WebKit2:

* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp:
(WebKit::InjectedBundlePageResourceLoadClient::shouldUseCredentialStorage): Added. Calls
through to the client if it implements shouldUseCredentialStorage. Returns true otherwise.
* WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::shouldUseCredentialStorage): Changed to call the injected
bundle resource load client.

Tools:

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage): Updated for the additional callback.

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

index 44428bf0de409c353cc0fff20fe877e0eedee524..a019caefe811f3a72adabd53e9b994a4f4d49027 100644 (file)
@@ -1,3 +1,19 @@
+2012-02-05  Dan Bernstein  <mitz@apple.com>
+
+        <rdar://problem/10809525> WebKit2’s WebFrameLoaderClient::shouldUseCredentialStorage() always returns true
+        https://bugs.webkit.org/show_bug.cgi?id=77823
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+        * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp:
+        (WebKit::InjectedBundlePageResourceLoadClient::shouldUseCredentialStorage): Added. Calls
+        through to the client if it implements shouldUseCredentialStorage. Returns true otherwise.
+        * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h:
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage): Changed to call the injected
+        bundle resource load client.
+
 2012-02-04  Dan Bernstein  <mitz@apple.com>
 
         <rdar://problem/10660698> Clients cannot prevent caching of individual responses
index 430ffe83c56910bc7c1033b4b2597025b8abda84..53276b08993da354cebbd9f628db03b5a5662c91 100644 (file)
@@ -165,6 +165,7 @@ typedef void (*WKBundlePageDidReceiveContentLengthForResourceCallback)(WKBundleP
 typedef void (*WKBundlePageDidFinishLoadForResourceCallback)(WKBundlePageRef, WKBundleFrameRef, uint64_t resourceIdentifier, const void* clientInfo);
 typedef void (*WKBundlePageDidFailLoadForResourceCallback)(WKBundlePageRef, WKBundleFrameRef, uint64_t resourceIdentifier, WKErrorRef, const void* clientInfo);
 typedef bool (*WKBundlePageShouldCacheResponseCallback)(WKBundlePageRef, WKBundleFrameRef, uint64_t resourceIdentifier, const void* clientInfo);
+typedef bool (*WKBundlePageShouldUseCredentialStorageCallback)(WKBundlePageRef, WKBundleFrameRef, uint64_t resourceIdentifier, const void* clientInfo);
 
 struct WKBundlePageResourceLoadClient {
     int                                                                 version;
@@ -183,6 +184,7 @@ struct WKBundlePageResourceLoadClient {
 
     // Version 1.
     WKBundlePageShouldCacheResponseCallback                             shouldCacheResponse;
+    WKBundlePageShouldUseCredentialStorageCallback                      shouldUseCredentialStorage;
 };
 typedef struct WKBundlePageResourceLoadClient WKBundlePageResourceLoadClient;
 
index 269e0799610001193d742d030e9433489734ff0e..3efe74d467906c2c067ec2865064b50d645ae8de 100644 (file)
@@ -93,4 +93,12 @@ bool InjectedBundlePageResourceLoadClient::shouldCacheResponse(WebPage* page, We
     return m_client.shouldCacheResponse(toAPI(page), toAPI(frame), identifier, m_client.clientInfo);
 }
 
+bool InjectedBundlePageResourceLoadClient::shouldUseCredentialStorage(WebPage* page, WebFrame* frame, uint64_t identifier)
+{
+    if (!m_client.shouldUseCredentialStorage)
+        return true;
+
+    return m_client.shouldUseCredentialStorage(toAPI(page), toAPI(frame), identifier, m_client.clientInfo);
+}
+
 } // namespace WebKit
index 1618b699e7408298922f958c7cc291fe325720c4..e6c2bdfc708667d5652fddc5d08af5cd8597ff0f 100644 (file)
@@ -53,6 +53,7 @@ public:
     void didFinishLoadForResource(WebPage*, WebFrame*, uint64_t identifier);
     void didFailLoadForResource(WebPage*, WebFrame*, uint64_t identifier, const WebCore::ResourceError&);
     bool shouldCacheResponse(WebPage*, WebFrame*, uint64_t identifier);
+    bool shouldUseCredentialStorage(WebPage*, WebFrame*, uint64_t identifier);
 };
 
 } // namespace WebKit
index 8c74dd03cc9c2d8f1766da31496d6ac02fcc4747..37e261fadb60d512c3c24e928c58b3167e16ba6b 100644 (file)
@@ -175,7 +175,11 @@ void WebFrameLoaderClient::dispatchWillSendRequest(DocumentLoader*, unsigned lon
 
 bool WebFrameLoaderClient::shouldUseCredentialStorage(DocumentLoader*, unsigned long identifier)
 {
-    return true;
+    WebPage* webPage = m_frame->page();
+    if (!webPage)
+        return true;
+
+    return webPage->injectedBundleResourceLoadClient().shouldUseCredentialStorage(webPage, m_frame, identifier);
 }
 
 void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge& challenge)
index 20808f17ea30c4cb8942b5065a85f83cc9755538..2a3c9621982ed80320187a5a13d281c0ca864f7b 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-05  Dan Bernstein  <mitz@apple.com>
+
+        <rdar://problem/10809525> WebKit2’s WebFrameLoaderClient::shouldUseCredentialStorage() always returns true
+        https://bugs.webkit.org/show_bug.cgi?id=77823
+
+        Reviewed by Anders Carlsson.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::InjectedBundlePage): Updated for the additional callback.
+
 2012-02-04  Dan Bernstein  <mitz@apple.com>
 
         <rdar://problem/10660698> Clients cannot prevent caching of individual responses
index 6da856f3b4139f88f3c2de3638bb6cf1dff5d263..84f90d804d4db355f302cd30dd68311837671af6 100644 (file)
@@ -229,6 +229,7 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
         didFinishLoadForResource,
         didFailLoadForResource,
         0, // shouldCacheResponse
+        0 // shouldUseCredentialStorage
     };
     WKBundlePageSetResourceLoadClient(m_page, &resourceLoadClient);