Diff
Modified: trunk/Source/WebKit2/ChangeLog (106760 => 106761)
--- trunk/Source/WebKit2/ChangeLog 2012-02-05 14:02:03 UTC (rev 106760)
+++ trunk/Source/WebKit2/ChangeLog 2012-02-05 18:51:03 UTC (rev 106761)
@@ -1,3 +1,19 @@
+2012-02-05 Dan Bernstein <m...@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 <m...@apple.com>
<rdar://problem/10660698> Clients cannot prevent caching of individual responses
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h (106760 => 106761)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h 2012-02-05 14:02:03 UTC (rev 106760)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h 2012-02-05 18:51:03 UTC (rev 106761)
@@ -165,6 +165,7 @@
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 @@
// Version 1.
WKBundlePageShouldCacheResponseCallback shouldCacheResponse;
+ WKBundlePageShouldUseCredentialStorageCallback shouldUseCredentialStorage;
};
typedef struct WKBundlePageResourceLoadClient WKBundlePageResourceLoadClient;
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp (106760 => 106761)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp 2012-02-05 14:02:03 UTC (rev 106760)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp 2012-02-05 18:51:03 UTC (rev 106761)
@@ -93,4 +93,12 @@
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
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h (106760 => 106761)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h 2012-02-05 14:02:03 UTC (rev 106760)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h 2012-02-05 18:51:03 UTC (rev 106761)
@@ -53,6 +53,7 @@
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
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (106760 => 106761)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2012-02-05 14:02:03 UTC (rev 106760)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2012-02-05 18:51:03 UTC (rev 106761)
@@ -175,7 +175,11 @@
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)
Modified: trunk/Tools/ChangeLog (106760 => 106761)
--- trunk/Tools/ChangeLog 2012-02-05 14:02:03 UTC (rev 106760)
+++ trunk/Tools/ChangeLog 2012-02-05 18:51:03 UTC (rev 106761)
@@ -1,3 +1,13 @@
+2012-02-05 Dan Bernstein <m...@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 <m...@apple.com>
<rdar://problem/10660698> Clients cannot prevent caching of individual responses
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (106760 => 106761)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp 2012-02-05 14:02:03 UTC (rev 106760)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp 2012-02-05 18:51:03 UTC (rev 106761)
@@ -229,6 +229,7 @@
didFinishLoadForResource,
didFailLoadForResource,
0, // shouldCacheResponse
+ 0 // shouldUseCredentialStorage
};
WKBundlePageSetResourceLoadClient(m_page, &resourceLoadClient);