Changeset 80479 in webkit
- Timestamp:
- Mar 7, 2011 11:05:24 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r80475 r80479 1 2011-03-07 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 Add unableToImplementPolicy callback for WebKit2 policy client 6 <rdar://problem/9071902> 7 https://bugs.webkit.org/show_bug.cgi?id=55884 8 9 * UIProcess/API/C/WKPage.h: 10 * UIProcess/WebPageProxy.cpp: 11 (WebKit::WebPageProxy::unableToImplementPolicy): 12 * UIProcess/WebPageProxy.h: 13 * UIProcess/WebPageProxy.messages.in: 14 * UIProcess/WebPolicyClient.cpp: 15 (WebKit::WebPolicyClient::unableToImplementPolicy): 16 * UIProcess/WebPolicyClient.h: 17 * WebProcess/InjectedBundle/API/c/WKBundlePage.h: 18 * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp: 19 (WebKit::InjectedBundlePagePolicyClient::unableToImplementPolicy): 20 * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h: 21 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 22 (WebKit::WebFrameLoaderClient::dispatchUnableToImplementPolicy): 23 Pipe unableToImplementPolicy through both the bundle and the main WebKit2 API. 24 1 25 2011-03-07 Sam Weinig <sam@webkit.org> 2 26 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.h
r80475 r80479 103 103 typedef void (*WKPageDecidePolicyForNewWindowActionCallback)(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKStringRef frameName, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo); 104 104 typedef void (*WKPageDecidePolicyForResponseCallback)(WKPageRef page, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo); 105 typedef void (*WKPageUnableToImplementPolicyCallback)(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo); 105 106 106 107 struct WKPagePolicyClient { … … 110 111 WKPageDecidePolicyForNewWindowActionCallback decidePolicyForNewWindowAction; 111 112 WKPageDecidePolicyForResponseCallback decidePolicyForResponse; 113 WKPageUnableToImplementPolicyCallback unableToImplementPolicy; 112 114 }; 113 115 typedef struct WKPagePolicyClient WKPagePolicyClient; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r80475 r80479 1689 1689 } 1690 1690 1691 void WebPageProxy::unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError& error, CoreIPC::ArgumentDecoder* arguments) 1692 { 1693 RefPtr<APIObject> userData; 1694 WebContextUserMessageDecoder messageDecoder(userData, context()); 1695 if (!arguments->decode(messageDecoder)) 1696 return; 1697 1698 WebFrameProxy* frame = process()->webFrame(frameID); 1699 MESSAGE_CHECK(frame); 1700 1701 m_policyClient.unableToImplementPolicy(this, frame, error, userData.get()); 1702 } 1703 1691 1704 // FormClient 1692 1705 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r80475 r80479 503 503 void decidePolicyForNewWindowAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, const WebCore::ResourceRequest&, const String& frameName, uint64_t listenerID, CoreIPC::ArgumentDecoder*); 504 504 void decidePolicyForResponse(uint64_t frameID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID); 505 void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::ArgumentDecoder* arguments); 505 506 506 507 void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, uint64_t listenerID, CoreIPC::ArgumentDecoder*); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r80475 r80479 70 70 DecidePolicyForNavigationAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, WebCore::ResourceRequest request, uint64_t listenerID, WebKit::InjectedBundleUserMessageEncoder userData) -> (bool receivedPolicyAction, uint64_t policyAction, uint64_t downloadID) 71 71 DecidePolicyForNewWindowAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, WebCore::ResourceRequest request, WTF::String frameName, uint64_t listenerID, WebKit::InjectedBundleUserMessageEncoder userData) 72 UnableToImplementPolicy(uint64_t frameID, WebCore::ResourceError error, WebKit::InjectedBundleUserMessageEncoder userData) 72 73 73 74 # Progress messages -
trunk/Source/WebKit2/UIProcess/WebPolicyClient.cpp
r80475 r80479 27 27 #include "WebPolicyClient.h" 28 28 29 #include "APIObject.h" 29 30 #include "WKAPICast.h" 30 31 #include "WebURLRequest.h" … … 68 69 } 69 70 71 void WebPolicyClient::unableToImplementPolicy(WebPageProxy* page, WebFrameProxy* frame, const ResourceError& error, APIObject* userData) 72 { 73 if (!m_client.unableToImplementPolicy) 74 return; 75 76 m_client.unableToImplementPolicy(toAPI(page), toAPI(frame), toAPI(error), toAPI(userData), m_client.clientInfo); 77 } 78 70 79 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/WebPolicyClient.h
r80475 r80479 28 28 29 29 #include "APIClient.h" 30 #include "APIObject.h"31 30 #include "WKPage.h" 32 31 #include "WebEvent.h" … … 35 34 36 35 namespace WebCore { 36 class ResourceError; 37 37 class ResourceRequest; 38 38 class ResourceResponse; … … 41 41 namespace WebKit { 42 42 43 class APIObject; 43 44 class WebPageProxy; 44 45 class WebFrameProxy; … … 50 51 bool decidePolicyForNewWindowAction(WebPageProxy*, WebFrameProxy*, WebCore::NavigationType, WebEvent::Modifiers, WebMouseEvent::Button, const WebCore::ResourceRequest&, const String& frameName, WebFramePolicyListenerProxy*, APIObject* userData); 51 52 bool decidePolicyForResponse(WebPageProxy*, WebFrameProxy*, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, WebFramePolicyListenerProxy*, APIObject* userData); 53 void unableToImplementPolicy(WebPageProxy*, WebFrameProxy*, const WebCore::ResourceError&, APIObject* userData); 52 54 }; 53 55 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
r80475 r80479 121 121 typedef uint32_t WKBundlePagePolicyAction; 122 122 123 124 123 // Policy Client 125 124 typedef WKBundlePagePolicyAction (*WKBundlePageDecidePolicyForNavigationActionCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleNavigationActionRef navigationAction, WKURLRequestRef request, WKTypeRef* userData, const void* clientInfo); 126 125 typedef WKBundlePagePolicyAction (*WKBundlePageDecidePolicyForNewWindowActionCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleNavigationActionRef navigationAction, WKURLRequestRef request, WKStringRef frameName, WKTypeRef* userData, const void* clientInfo); 127 typedef WKBundlePagePolicyAction (*WKBundlePageDecidePolicyForResponseCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKURLResponseRef response, WKURLRequestRef request, WKTypeRef* userData, const void* clientInfo); 126 typedef WKBundlePagePolicyAction (*WKBundlePageDecidePolicyForResponseCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKURLResponseRef response, WKURLRequestRef request, WKTypeRef* userData, const void* clientInfo); 127 typedef void (*WKBundlePageUnableToImplementPolicyCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKErrorRef error, WKTypeRef* userData, const void* clientInfo); 128 128 129 129 struct WKBundlePagePolicyClient { … … 133 133 WKBundlePageDecidePolicyForNewWindowActionCallback decidePolicyForNewWindowAction; 134 134 WKBundlePageDecidePolicyForResponseCallback decidePolicyForResponse; 135 WKBundlePageUnableToImplementPolicyCallback unableToImplementPolicy; 135 136 }; 136 137 typedef struct WKBundlePagePolicyClient WKBundlePagePolicyClient; -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp
r80475 r80479 28 28 29 29 #include "WKBundleAPICast.h" 30 #include "WebError.h" 30 31 #include "WebURLRequest.h" 31 32 … … 74 75 } 75 76 77 void InjectedBundlePagePolicyClient::unableToImplementPolicy(WebPage* page, WebFrame* frame, const WebCore::ResourceError& error, RefPtr<APIObject>& userData) 78 { 79 if (!m_client.unableToImplementPolicy) 80 return; 81 82 WKTypeRef userDataToPass = 0; 83 m_client.unableToImplementPolicy(toAPI(page), toAPI(frame), toAPI(error), &userDataToPass, m_client.clientInfo); 84 userData = adoptRef(toImpl(userDataToPass)); 85 } 86 76 87 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h
r80475 r80479 33 33 34 34 namespace WebCore { 35 class ResourceError; 35 36 class ResourceRequest; 36 37 class ResourceResponse; … … 48 49 WKBundlePagePolicyAction decidePolicyForNewWindowAction(WebPage*, WebFrame*, InjectedBundleNavigationAction*, const WebCore::ResourceRequest&, const String& frameName, RefPtr<APIObject>& userData); 49 50 WKBundlePagePolicyAction decidePolicyForResponse(WebPage*, WebFrame*, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, RefPtr<APIObject>& userData); 51 void unableToImplementPolicy(WebPage*, WebFrame*, const WebCore::ResourceError&, RefPtr<APIObject>& userData); 50 52 }; 51 53 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r80475 r80479 674 674 } 675 675 676 void WebFrameLoaderClient::dispatchUnableToImplementPolicy(const ResourceError&) 677 { 678 notImplemented(); 676 void WebFrameLoaderClient::dispatchUnableToImplementPolicy(const ResourceError& error) 677 { 678 WebPage* webPage = m_frame->page(); 679 if (!webPage) 680 return; 681 682 RefPtr<APIObject> userData; 683 684 // Notify the bundle client. 685 webPage->injectedBundlePolicyClient().unableToImplementPolicy(webPage, m_frame, error, userData); 686 687 // Notify the UIProcess. 688 webPage->send(Messages::WebPageProxy::UnableToImplementPolicy(m_frame->frameID(), error, InjectedBundleUserMessageEncoder(userData.get()))); 679 689 } 680 690 -
trunk/Tools/ChangeLog
r80475 r80479 1 2011-03-07 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 Add unableToImplementPolicy callback for WebKit2 policy client 6 <rdar://problem/9071902> 7 https://bugs.webkit.org/show_bug.cgi?id=55884 8 9 * MiniBrowser/mac/BrowserWindowController.m: 10 (-[BrowserWindowController awakeFromNib]): 11 Update policy client initialization struct for new member. 12 1 13 2011-03-07 Sam Weinig <sam@webkit.org> 2 14 -
trunk/Tools/MiniBrowser/mac/BrowserWindowController.m
r80475 r80479 608 608 decidePolicyForNavigationAction, 609 609 decidePolicyForNewWindowAction, 610 decidePolicyForResponse 610 decidePolicyForResponse, 611 0 /* unableToImplementPolicy */ 611 612 }; 612 613 WKPageSetPagePolicyClient(_webView.pageRef, &policyClient);
Note: See TracChangeset
for help on using the changeset viewer.