WebKit2: Should be able to call into injected bundle to ask if we should allow resour...
authorbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jan 2011 19:27:23 +0000 (19:27 +0000)
committerbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jan 2011 19:27:23 +0000 (19:27 +0000)
commitfcae80f8d8a1ce65076ca6b6728681015614ea48
tree0e18d5610b62cfdcdcf5b6ab5cdc1f3f8aea2700
parent315651ae907cf124a2cbc32ca79c67d213e47f26
WebKit2: Should be able to call into injected bundle to ask if we should allow resource loads
https://bugs.webkit.org/show_bug.cgi?id=51969

Reviewed by Ada Chan.

Tools:

Add shouldLoadResourceForFrame to WTR::InjectedBundlePage.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
(WTR::InjectedBundlePage::shouldLoadResourceForFrame): Stub implementation.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:

WebKit2:

Add the ability to call into the injected bundle to ask if we should allow resource loads.
If the injected bundle says we should cancel, we clear out the ResourceRequest that was
passed into willSendRequest, which cancels the resource load.

* WebProcess/InjectedBundle/API/c/WKBundlePage.h: Add the new callback for allowing/cancelling
    resource loads.
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::shouldLoadResourceForFrame): Calls through to the client.
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchWillSendRequest): Ask the InjectedBundlePageLoaderClient if we
    should load the resource or not.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
WebKit2/ChangeLog
WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp