Changeset 141448 in webkit
- Timestamp:
- Jan 31, 2013, 11:11:25 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 20 deleted
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r141447 r141448 1 2013-01-31 Anders Carlsson <andersca@apple.com> 2 3 Remove Web Intents code from WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=108506 5 6 Reviewed by Simon Fraser. 7 8 Since nobody builds with Web Intents enabled anymore, and since the code is going to 9 be removed from WebCore, remove it from WebKit2. 10 11 * Shared/API/c/WKBase.h: 12 * Shared/APIClientTraits.cpp: 13 (WebKit): 14 * Shared/APIObject.h: 15 * Shared/IntentData.cpp: Removed. 16 * Shared/IntentData.h: Removed. 17 * Shared/IntentServiceInfo.cpp: Removed. 18 * Shared/IntentServiceInfo.h: Removed. 19 * Shared/WebIntentServiceInfo.cpp: Removed. 20 * Shared/WebIntentServiceInfo.h: Removed. 21 * UIProcess/API/C/WKAPICast.h: 22 (WebKit): 23 * UIProcess/API/C/WKIntentData.cpp: Removed. 24 * UIProcess/API/C/WKIntentData.h: Removed. 25 * UIProcess/API/C/WKIntentServiceInfo.cpp: Removed. 26 * UIProcess/API/C/WKIntentServiceInfo.h: Removed. 27 * UIProcess/API/C/WKPage.cpp: 28 * UIProcess/API/C/WKPage.h: 29 * UIProcess/WebIntentData.cpp: Removed. 30 * UIProcess/WebIntentData.h: Removed. 31 * UIProcess/WebLoaderClient.cpp: 32 * UIProcess/WebLoaderClient.h: 33 (WebKit): 34 (WebLoaderClient): 35 * UIProcess/WebPageProxy.cpp: 36 * UIProcess/WebPageProxy.h: 37 (WebKit): 38 (WebPageProxy): 39 * UIProcess/WebPageProxy.messages.in: 40 * UIProcess/WebProcessProxy.cpp: 41 * UIProcess/WebProcessProxy.h: 42 (WebProcessProxy): 43 * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h: 44 (WebKit): 45 * WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp: Removed. 46 * WebProcess/InjectedBundle/API/c/WKBundleIntent.h: Removed. 47 * WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp: Removed. 48 * WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h: Removed. 49 * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: 50 * WebProcess/InjectedBundle/API/c/WKBundlePage.h: 51 * WebProcess/InjectedBundle/InjectedBundleIntent.cpp: Removed. 52 * WebProcess/InjectedBundle/InjectedBundleIntent.h: Removed. 53 * WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp: Removed. 54 * WebProcess/InjectedBundle/InjectedBundleIntentRequest.h: Removed. 55 * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: 56 * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: 57 (WebKit): 58 (InjectedBundlePageLoaderClient): 59 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 60 (WebKit): 61 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 62 (WebFrameLoaderClient): 63 * WebProcess/WebPage/WebFrame.cpp: 64 * WebProcess/WebPage/WebFrame.h: 65 (WebCore): 66 (WebKit): 67 (WebFrame): 68 * WebProcess/WebPage/WebPage.cpp: 69 * WebProcess/WebPage/WebPage.h: 70 (WebCore): 71 (WebKit): 72 (WebPage): 73 * WebProcess/WebPage/WebPage.messages.in: 74 * WebProcess/WebProcess.cpp: 75 * WebProcess/WebProcess.h: 76 (WebCore): 77 (WebProcess): 78 * WebProcess/WebProcess.messages.in: 79 1 80 2013-01-31 Brady Eidson <beidson@apple.com> 2 81 -
trunk/Source/WebKit2/Shared/API/c/WKBase.h
r131281 r141448 118 118 typedef const struct OpaqueWKIconDatabase* WKIconDatabaseRef; 119 119 typedef const struct OpaqueWKInspector* WKInspectorRef; 120 typedef const struct OpaqueWKIntentData* WKIntentDataRef;121 typedef const struct OpaqueWKIntentServiceInfo* WKIntentServiceInfoRef;122 120 typedef const struct OpaqueWKKeyValueStorageManager* WKKeyValueStorageManagerRef; 123 121 typedef const struct OpaqueWKMediaCacheManager* WKMediaCacheManagerRef; … … 149 147 typedef const struct OpaqueWKBundleHitTestResult* WKBundleHitTestResultRef; 150 148 typedef const struct OpaqueWKBundleInspector* WKBundleInspectorRef; 151 typedef const struct OpaqueWKBundleIntent* WKBundleIntentRef;152 typedef const struct OpaqueWKBundleIntentRequest* WKBundleIntentRequestRef;153 149 typedef const struct OpaqueWKBundleNavigationAction* WKBundleNavigationActionRef; 154 150 typedef const struct OpaqueWKBundleNodeHandle* WKBundleNodeHandleRef; -
trunk/Source/WebKit2/Shared/APIClientTraits.cpp
r129810 r141448 40 40 offsetof(WKBundlePageLoaderClient, didLayoutForFrame), 41 41 offsetof(WKBundlePageLoaderClient, didFinishProgress), 42 offsetof(WKBundlePageLoaderClient, didReceiveIntentForFrame ),43 offsetof(WKBundlePageLoaderClient, registerIntentServiceForFrame ),42 offsetof(WKBundlePageLoaderClient, didReceiveIntentForFrame_unavailable), 43 offsetof(WKBundlePageLoaderClient, registerIntentServiceForFrame_unavailable), 44 44 sizeof(WKBundlePageLoaderClient) 45 45 }; … … 63 63 const size_t APIClientTraits<WKPageLoaderClient>::interfaceSizesByVersion[] = { 64 64 offsetof(WKPageLoaderClient, didDetectXSSForFrame), 65 offsetof(WKPageLoaderClient, didReceiveIntentForFrame ),65 offsetof(WKPageLoaderClient, didReceiveIntentForFrame_unavailable), 66 66 sizeof(WKPageLoaderClient) 67 67 }; -
trunk/Source/WebKit2/Shared/APIObject.h
r136095 r141448 92 92 TypeIconDatabase, 93 93 TypeInspector, 94 TypeIntentData,95 TypeIntentServiceInfo,96 94 TypeKeyValueStorageManager, 97 95 TypeMediaCacheManager, … … 119 117 TypeBundleHitTestResult, 120 118 TypeBundleInspector, 121 TypeBundleIntent,122 TypeBundleIntentRequest,123 119 TypeBundleNavigationAction, 124 120 TypeBundleNodeHandle, -
trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h
r139023 r141448 75 75 class WebIconDatabase; 76 76 class WebInspectorProxy; 77 class WebIntentData;78 class WebIntentServiceInfo;79 77 class WebKeyValueStorageManagerProxy; 80 78 class WebMediaCacheManagerProxy; … … 120 118 WK_ADD_API_MAPPING(WKHitTestResultRef, WebHitTestResult) 121 119 WK_ADD_API_MAPPING(WKIconDatabaseRef, WebIconDatabase) 122 WK_ADD_API_MAPPING(WKIntentDataRef, WebIntentData)123 WK_ADD_API_MAPPING(WKIntentServiceInfoRef, WebIntentServiceInfo)124 120 WK_ADD_API_MAPPING(WKKeyValueStorageManagerRef, WebKeyValueStorageManagerProxy) 125 121 WK_ADD_API_MAPPING(WKMediaCacheManagerRef, WebMediaCacheManagerProxy) -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r141010 r141448 761 761 #endif 762 762 763 void WKPageDeliverIntentToFrame(WKPageRef page, WKFrameRef frame, WKIntentDataRef intent)764 {765 #if ENABLE(WEB_INTENTS)766 toImpl(page)->deliverIntentToFrame(toImpl(frame), toImpl(intent));767 #endif768 }769 770 763 WKImageRef WKPageCreateSnapshotOfVisibleContent(WKPageRef) 771 764 { -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.h
r141010 r141448 75 75 typedef void (*WKPageWillGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, WKTypeRef userData, const void *clientInfo); 76 76 typedef void (*WKPagePluginDidFailCallback)(WKPageRef page, WKErrorCode errorCode, WKStringRef mimeType, WKStringRef pluginIdentifier, WKStringRef pluginVersion, const void* clientInfo); 77 typedef void (*WKPageDidReceiveIntentForFrameCallback)(WKPageRef page, WKFrameRef frame, WKIntentDataRef intent, WKTypeRef userData, const void *clientInfo);78 typedef void (*WKPageRegisterIntentServiceForFrameCallback)(WKPageRef page, WKFrameRef frame, WKIntentServiceInfoRef serviceInfo, WKTypeRef userData, const void *clientInfo);79 77 typedef void (*WKPageDidLayoutCallback)(WKPageRef page, WKLayoutMilestones milestones, WKTypeRef userData, const void *clientInfo); 80 78 … … 128 126 129 127 // Version 2 130 WKPageDidReceiveIntentForFrameCallback didReceiveIntentForFrame;131 WKPageRegisterIntentServiceForFrameCallback registerIntentServiceForFrame;128 void (*didReceiveIntentForFrame_unavailable)(void); 129 void (*registerIntentServiceForFrame_unavailable)(void); 132 130 133 131 WKPageDidLayoutCallback didLayout; … … 490 488 WK_EXPORT void WKPageForceRepaint(WKPageRef page, void* context, WKPageForceRepaintFunction function); 491 489 492 WK_EXPORT void WKPageDeliverIntentToFrame(WKPageRef page, WKFrameRef frame, WKIntentDataRef intent);493 494 490 /* 495 491 Some of the more common command name strings include the following, although any WebCore EditorCommand string is supported: -
trunk/Source/WebKit2/UIProcess/WebLoaderClient.cpp
r129545 r141448 32 32 #include <string.h> 33 33 34 #if ENABLE(WEB_INTENTS)35 #include "WebIntentData.h"36 #include "WebIntentServiceInfo.h"37 #endif38 39 34 using namespace WebCore; 40 35 … … 176 171 m_client.didDetectXSSForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.clientInfo); 177 172 } 178 179 #if ENABLE(WEB_INTENTS)180 void WebLoaderClient::didReceiveIntentForFrame(WebPageProxy* page, WebFrameProxy* frame, WebIntentData* intentData, APIObject* userData)181 {182 if (!m_client.didReceiveIntentForFrame)183 return;184 185 m_client.didReceiveIntentForFrame(toAPI(page), toAPI(frame), toAPI(intentData), toAPI(userData), m_client.clientInfo);186 }187 #endif188 189 #if ENABLE(WEB_INTENTS_TAG)190 void WebLoaderClient::registerIntentServiceForFrame(WebPageProxy* page, WebFrameProxy* frame, WebIntentServiceInfo* serviceInfo, APIObject* userData)191 {192 if (!m_client.registerIntentServiceForFrame)193 return;194 195 m_client.registerIntentServiceForFrame(toAPI(page), toAPI(frame), toAPI(serviceInfo), toAPI(userData), m_client.clientInfo);196 }197 #endif198 173 199 174 bool WebLoaderClient::canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy* page, WebFrameProxy* frame, WebProtectionSpace* protectionSpace) -
trunk/Source/WebKit2/UIProcess/WebLoaderClient.h
r129545 r141448 49 49 class WebProtectionSpace; 50 50 51 #if ENABLE(WEB_INTENTS)52 class WebIntentData;53 #endif54 55 #if ENABLE(WEB_INTENTS_TAG)56 class WebIntentServiceInfo;57 #endif58 59 51 class WebLoaderClient : public APIClient<WKPageLoaderClient, kWKPageLoaderClientCurrentVersion> { 60 52 public: … … 74 66 void didRunInsecureContentForFrame(WebPageProxy*, WebFrameProxy*, APIObject*); 75 67 void didDetectXSSForFrame(WebPageProxy*, WebFrameProxy*, APIObject*); 76 #if ENABLE(WEB_INTENTS)77 void didReceiveIntentForFrame(WebPageProxy*, WebFrameProxy*, WebIntentData*, APIObject*);78 #endif79 80 #if ENABLE(WEB_INTENTS_TAG)81 void registerIntentServiceForFrame(WebPageProxy*, WebFrameProxy*, WebIntentServiceInfo*, APIObject*);82 #endif83 68 84 69 // FIXME: didNewFirstVisuallyNonEmptyLayout should be removed. We should consider removing didFirstVisuallyNonEmptyLayoutForFrame -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r141366 r141448 93 93 #include <stdio.h> 94 94 95 #if ENABLE(WEB_INTENTS)96 #include "IntentData.h"97 #include "IntentServiceInfo.h"98 #include "WebIntentData.h"99 #include "WebIntentServiceInfo.h"100 #endif101 102 95 #if USE(COORDINATED_GRAPHICS) 103 96 #include "CoordinatedLayerTreeHostProxyMessages.h" … … 1788 1781 } 1789 1782 1790 #if ENABLE(WEB_INTENTS)1791 void WebPageProxy::deliverIntentToFrame(WebFrameProxy* frame, WebIntentData* webIntentData)1792 {1793 if (!isValid())1794 return;1795 1796 m_process->send(Messages::WebPage::DeliverIntentToFrame(frame->frameID(), webIntentData->store()), m_pageID);1797 }1798 #endif1799 1800 1783 void WebPageProxy::getContentsAsString(PassRefPtr<StringCallback> prpCallback) 1801 1784 { … … 2079 2062 m_loaderClient.didFinishProgress(this); 2080 2063 } 2081 2082 #if ENABLE(WEB_INTENTS_TAG)2083 void WebPageProxy::registerIntentServiceForFrame(uint64_t frameID, const IntentServiceInfo& serviceInfo, CoreIPC::MessageDecoder& decoder)2084 {2085 RefPtr<APIObject> userData;2086 WebContextUserMessageDecoder messageDecoder(userData, m_process.get());2087 if (!decoder.decode(messageDecoder))2088 return;2089 2090 WebFrameProxy* frame = m_process->webFrame(frameID);2091 MESSAGE_CHECK(frame);2092 2093 RefPtr<WebIntentServiceInfo> webIntentServiceInfo = WebIntentServiceInfo::create(serviceInfo);2094 m_loaderClient.registerIntentServiceForFrame(this, frame, webIntentServiceInfo.get(), userData.get());2095 }2096 #endif2097 2064 2098 2065 void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::MessageDecoder& decoder) … … 2382 2349 m_loaderClient.didDetectXSSForFrame(this, frame, userData.get()); 2383 2350 } 2384 2385 #if ENABLE(WEB_INTENTS)2386 void WebPageProxy::didReceiveIntentForFrame(uint64_t frameID, const IntentData& intentData, CoreIPC::MessageDecoder& decoder)2387 {2388 RefPtr<APIObject> userData;2389 WebContextUserMessageDecoder messageDecoder(userData, m_process.get());2390 if (!decoder.decode(messageDecoder))2391 return;2392 2393 WebFrameProxy* frame = m_process->webFrame(frameID);2394 MESSAGE_CHECK(frame);2395 2396 RefPtr<WebIntentData> webIntentData = WebIntentData::create(intentData, m_process.get());2397 m_loaderClient.didReceiveIntentForFrame(this, frame, webIntentData.get(), userData.get());2398 }2399 #endif2400 2351 2401 2352 void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r141361 r141448 125 125 #endif 126 126 127 #if ENABLE(WEB_INTENTS)128 class WebIntentData;129 #endif130 131 127 namespace WebKit { 132 128 … … 168 164 #endif 169 165 170 #if ENABLE(WEB_INTENTS)171 struct IntentData;172 #endif173 174 #if ENABLE(WEB_INTENTS_TAG)175 struct IntentServiceInfo;176 #endif177 178 166 typedef GenericCallback<WKStringRef, StringImpl*> StringCallback; 179 167 typedef GenericCallback<WKSerializedScriptValueRef, WebSerializedScriptValue*> ScriptValueCallback; … … 563 551 void runJavaScriptInMainFrame(const String&, PassRefPtr<ScriptValueCallback>); 564 552 void forceRepaint(PassRefPtr<VoidCallback>); 565 566 #if ENABLE(WEB_INTENTS)567 void deliverIntentToFrame(WebFrameProxy*, WebIntentData*);568 #endif569 553 570 554 float headerHeight(WebFrameProxy*); … … 809 793 void didFinishProgress(); 810 794 811 #if ENABLE(WEB_INTENTS)812 void didReceiveIntentForFrame(uint64_t frameID, const IntentData&, CoreIPC::MessageDecoder&);813 #endif814 #if ENABLE(WEB_INTENTS_TAG)815 void registerIntentServiceForFrame(uint64_t frameID, const IntentServiceInfo&, CoreIPC::MessageDecoder&);816 #endif817 818 795 void decidePolicyForNavigationAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, const WebCore::ResourceRequest&, uint64_t listenerID, CoreIPC::MessageDecoder&, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID); 819 796 void decidePolicyForNewWindowAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, const WebCore::ResourceRequest&, const String& frameName, uint64_t listenerID, CoreIPC::MessageDecoder&); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r140605 r141448 105 105 UnableToImplementPolicy(uint64_t frameID, WebCore::ResourceError error, WebKit::InjectedBundleUserMessageEncoder userData) Variadic 106 106 107 # Intent messages108 #if ENABLE(WEB_INTENTS)109 DidReceiveIntentForFrame(uint64_t frameID, WebKit::IntentData intent, WebKit::InjectedBundleUserMessageEncoder userData) Variadic110 #endif111 #if ENABLE(WEB_INTENTS_TAG)112 RegisterIntentServiceForFrame(uint64_t frameID, WebKit::IntentServiceInfo serviceInfo, WebKit::InjectedBundleUserMessageEncoder userData) Variadic113 #endif114 115 107 # Progress messages 116 108 DidChangeProgress(double value) -
trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp
r141361 r141448 215 215 } 216 216 217 #if ENABLE(WEB_INTENTS)218 void WebProcessProxy::removeMessagePortChannel(uint64_t channelID)219 {220 if (!isValid())221 return;222 223 send(Messages::WebProcess::RemoveMessagePortChannel(channelID), /* destinationID */ 0);224 }225 #endif226 227 217 WebBackForwardListItem* WebProcessProxy::webBackForwardItem(uint64_t itemID) const 228 218 { -
trunk/Source/WebKit2/UIProcess/WebProcessProxy.h
r141361 r141448 86 86 Vector<WebPageProxy*> pages() const; 87 87 88 #if ENABLE(WEB_INTENTS)89 void removeMessagePortChannel(uint64_t channelID);90 #endif91 92 88 WebBackForwardListItem* webBackForwardItem(uint64_t itemID) const; 93 89 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
r131281 r141448 45 45 class InjectedBundleDOMWindowExtension; 46 46 class InjectedBundleHitTestResult; 47 class InjectedBundleIntent;48 class InjectedBundleIntentRequest;49 47 class InjectedBundleNavigationAction; 50 48 class InjectedBundleNodeHandle; … … 64 62 WK_ADD_API_MAPPING(WKBundleHitTestResultRef, InjectedBundleHitTestResult) 65 63 WK_ADD_API_MAPPING(WKBundleInspectorRef, WebInspector) 66 WK_ADD_API_MAPPING(WKBundleIntentRef, InjectedBundleIntent)67 WK_ADD_API_MAPPING(WKBundleIntentRequestRef, InjectedBundleIntentRequest)68 64 WK_ADD_API_MAPPING(WKBundleNavigationActionRef, InjectedBundleNavigationAction) 69 65 WK_ADD_API_MAPPING(WKBundleNodeHandleRef, InjectedBundleNodeHandle) -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
r140769 r141448 55 55 #include <wtf/UnusedParam.h> 56 56 57 #if ENABLE(WEB_INTENTS)58 #include "InjectedBundleIntent.h"59 #endif60 61 57 using namespace WebKit; 62 58 … … 358 354 { 359 355 toImpl(pageRef)->listenForLayoutMilestones(toLayoutMilestones(milestones)); 360 }361 362 void WKBundlePageDeliverIntentToFrame(WKBundlePageRef pageRef, WKBundleFrameRef frameRef, WKBundleIntentRef intentRef)363 {364 #if ENABLE(WEB_INTENTS)365 toImpl(pageRef)->deliverCoreIntentToFrame(toImpl(frameRef)->frameID(), toImpl(intentRef)->coreIntent());366 #endif367 356 } 368 357 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
r140863 r141448 110 110 typedef void (*WKBundlePageWillDestroyGlobalObjectForDOMWindowExtensionCallback)(WKBundlePageRef page, WKBundleDOMWindowExtensionRef, const void* clientInfo); 111 111 typedef bool (*WKBundlePageShouldForceUniversalAccessFromLocalURLCallback)(WKBundlePageRef, WKStringRef url, const void* clientInfo); 112 typedef void (*WKBundlePageDidReceiveIntentForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleIntentRequestRef intentRequest, WKTypeRef* userData, const void* clientInfo);113 typedef void (*WKBundlePageRegisterIntentServiceForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKIntentServiceInfoRef serviceInfo, WKTypeRef* userData, const void* clientInfo);114 112 typedef void (*WKBundlePageDidLayoutCallback)(WKBundlePageRef page, WKLayoutMilestones milestones, WKTypeRef* userData, const void *clientInfo); 115 113 … … 153 151 154 152 // Version 3 155 WKBundlePageDidReceiveIntentForFrameCallback didReceiveIntentForFrame;156 WKBundlePageRegisterIntentServiceForFrameCallback registerIntentServiceForFrame;153 void * didReceiveIntentForFrame_unavailable; 154 void * registerIntentServiceForFrame_unavailable; 157 155 158 156 // Version 4 … … 442 440 WK_EXPORT void WKBundlePageListenForLayoutMilestones(WKBundlePageRef page, WKLayoutMilestones milestones); 443 441 444 WK_EXPORT void WKBundlePageDeliverIntentToFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleIntentRef intent);445 446 442 WK_EXPORT WKBundleInspectorRef WKBundlePageGetInspector(WKBundlePageRef page); 447 443 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
r129545 r141448 34 34 #include <wtf/text/WTFString.h> 35 35 36 #if ENABLE(WEB_INTENTS)37 #include "InjectedBundleIntentRequest.h"38 #endif39 #if ENABLE(WEB_INTENTS_TAG)40 #include "WebIntentServiceInfo.h"41 #endif42 43 36 using namespace WebCore; 44 37 … … 194 187 userData = adoptRef(toImpl(userDataToPass)); 195 188 } 196 197 #if ENABLE(WEB_INTENTS)198 void InjectedBundlePageLoaderClient::didReceiveIntentForFrame(WebPage* page, WebFrame* frame, InjectedBundleIntentRequest* intentRequest, RefPtr<APIObject>& userData)199 {200 if (!m_client.didReceiveIntentForFrame)201 return;202 203 WKTypeRef userDataToPass = 0;204 m_client.didReceiveIntentForFrame(toAPI(page), toAPI(frame), toAPI(intentRequest), &userDataToPass, m_client.clientInfo);205 userData = adoptRef(toImpl(userDataToPass));206 }207 #endif208 209 #if ENABLE(WEB_INTENTS_TAG)210 void InjectedBundlePageLoaderClient::registerIntentServiceForFrame(WebPage* page, WebFrame* frame, WebIntentServiceInfo* service, RefPtr<APIObject>& userData)211 {212 if (!m_client.registerIntentServiceForFrame)213 return;214 215 WKTypeRef userDataToPass = 0;216 m_client.registerIntentServiceForFrame(toAPI(page), toAPI(frame), toAPI(service), &userDataToPass, m_client.clientInfo);217 userData = adoptRef(toImpl(userDataToPass));218 }219 #endif220 189 221 190 void InjectedBundlePageLoaderClient::didFirstLayoutForFrame(WebPage* page, WebFrame* frame, RefPtr<APIObject>& userData) -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
r129545 r141448 48 48 class WebPage; 49 49 class WebFrame; 50 #if ENABLE(WEB_INTENTS)51 class InjectedBundleIntentRequest;52 #endif53 #if ENABLE(WEB_INTENTS_TAG)54 class WebIntentServiceInfo;55 #endif56 50 57 51 class InjectedBundlePageLoaderClient : public APIClient<WKBundlePageLoaderClient, kWKBundlePageLoaderClientCurrentVersion> { … … 72 66 void didRunInsecureContentForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData); 73 67 void didDetectXSSForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData); 74 75 #if ENABLE(WEB_INTENTS)76 void didReceiveIntentForFrame(WebPage*, WebFrame*, InjectedBundleIntentRequest*, RefPtr<APIObject>& userData);77 #endif78 #if ENABLE(WEB_INTENTS_TAG)79 void registerIntentServiceForFrame(WebPage*, WebFrame*, WebIntentServiceInfo*, RefPtr<APIObject>& userData);80 #endif81 68 82 69 void didFirstLayoutForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData); -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r140667 r141448 77 77 #include <WebCore/WindowFeatures.h> 78 78 79 #if ENABLE(WEB_INTENTS)80 #include "InjectedBundleIntentRequest.h"81 #include "IntentData.h"82 #include <WebCore/IntentRequest.h>83 #endif84 85 #if ENABLE(WEB_INTENTS_TAG)86 #include "IntentServiceInfo.h"87 #include "WebIntentServiceInfo.h"88 #endif89 90 79 using namespace WebCore; 91 80 … … 1562 1551 #endif // PLATFORM(MAC) 1563 1552 1564 #if ENABLE(WEB_INTENTS)1565 void WebFrameLoaderClient::dispatchIntent(PassRefPtr<IntentRequest> request)1566 {1567 WebPage* webPage = m_frame->page();1568 if (!webPage)1569 return;1570 1571 RefPtr<APIObject> userData;1572 RefPtr<InjectedBundleIntentRequest> bundleIntentRequest = InjectedBundleIntentRequest::create(request.get());1573 webPage->injectedBundleLoaderClient().didReceiveIntentForFrame(webPage, m_frame, bundleIntentRequest.get(), userData);1574 1575 IntentData intentData(request->intent());1576 webPage->send(Messages::WebPageProxy::DidReceiveIntentForFrame(m_frame->frameID(), intentData, InjectedBundleUserMessageEncoder(userData.get())));1577 }1578 #endif1579 1580 #if ENABLE(WEB_INTENTS_TAG)1581 void WebFrameLoaderClient::registerIntentService(const String& action, const String& type, const KURL& href, const String& title, const String& disposition)1582 {1583 WebPage* webPage = m_frame->page();1584 if (!webPage)1585 return;1586 1587 IntentServiceInfo serviceInfo;1588 serviceInfo.action = action;1589 serviceInfo.type = type;1590 serviceInfo.href = href;1591 serviceInfo.title = title;1592 serviceInfo.disposition = disposition;1593 1594 RefPtr<APIObject> userData;1595 RefPtr<WebIntentServiceInfo> webIntentServiceInfo = WebIntentServiceInfo::create(serviceInfo);1596 webPage->injectedBundleLoaderClient().registerIntentServiceForFrame(webPage, m_frame, webIntentServiceInfo.get(), userData);1597 1598 webPage->send(Messages::WebPageProxy::RegisterIntentServiceForFrame(m_frame->frameID(), serviceInfo, InjectedBundleUserMessageEncoder(userData.get())));1599 }1600 #endif1601 1602 1553 bool WebFrameLoaderClient::shouldUsePluginDocument(const String& /*mimeType*/) const 1603 1554 { -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r139023 r141448 29 29 #include <WebCore/FrameLoaderClient.h> 30 30 31 namespace WebCore {32 #if ENABLE(WEB_INTENTS)33 class IntentRequest;34 #endif35 }36 37 31 namespace WebKit { 38 32 … … 221 215 #endif 222 216 223 #if ENABLE(WEB_INTENTS)224 virtual void dispatchIntent(PassRefPtr<WebCore::IntentRequest>) OVERRIDE;225 #endif226 #if ENABLE(WEB_INTENTS_TAG)227 virtual void registerIntentService(const String& action, const String& type, const WebCore::KURL& href, const String& title, const String& disposition) OVERRIDE;228 #endif229 230 217 virtual bool shouldUsePluginDocument(const String& /*mimeType*/) const OVERRIDE; 231 218 -
trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
r141017 r141448 67 67 #include <wtf/text/StringBuilder.h> 68 68 69 #if ENABLE(WEB_INTENTS)70 #include "IntentData.h"71 #include <WebCore/DOMWindowIntents.h>72 #include <WebCore/DeliveredIntent.h>73 #include <WebCore/Intent.h>74 #include <WebCore/PlatformMessagePortChannel.h>75 #endif76 77 69 #if PLATFORM(MAC) 78 70 #include <WebCore/LegacyWebArchive.h> … … 275 267 WebProcess::shared().downloadManager().convertHandleToDownload(policyDownloadID, mainResourceLoader->loader()->handle(), request, response); 276 268 } 277 278 #if ENABLE(WEB_INTENTS)279 void WebFrame::deliverIntent(const IntentData& intentData)280 {281 OwnPtr<DeliveredIntentClient> dummyClient;282 Vector<uint8_t> dataCopy = intentData.data;283 284 OwnPtr<WebCore::MessagePortChannelArray> channels;285 if (!intentData.messagePorts.isEmpty()) {286 channels = adoptPtr(new WebCore::MessagePortChannelArray(intentData.messagePorts.size()));287 for (size_t i = 0; i < intentData.messagePorts.size(); ++i)288 (*channels)[i] = MessagePortChannel::create(WebProcess::shared().messagePortChannel(intentData.messagePorts.at(i)));289 }290 OwnPtr<WebCore::MessagePortArray> messagePorts = WebCore::MessagePort::entanglePorts(*m_coreFrame->document()->domWindow()->scriptExecutionContext(), channels.release());291 292 RefPtr<DeliveredIntent> deliveredIntent = DeliveredIntent::create(m_coreFrame, dummyClient.release(), intentData.action, intentData.type,293 SerializedScriptValue::adopt(dataCopy), messagePorts.release(),294 intentData.extras);295 WebCore::DOMWindowIntents::from(m_coreFrame->document()->domWindow())->deliver(deliveredIntent.release());296 }297 298 void WebFrame::deliverIntent(WebCore::Intent* intent)299 {300 OwnPtr<DeliveredIntentClient> dummyClient;301 302 OwnPtr<WebCore::MessagePortChannelArray> channels;303 WebCore::MessagePortChannelArray* origChannels = intent->messagePorts();304 if (origChannels && origChannels->size()) {305 channels = adoptPtr(new WebCore::MessagePortChannelArray(origChannels->size()));306 for (size_t i = 0; i < origChannels->size(); ++i)307 (*channels)[i] = origChannels->at(i).release();308 }309 OwnPtr<WebCore::MessagePortArray> messagePorts = WebCore::MessagePort::entanglePorts(*m_coreFrame->document()->domWindow()->scriptExecutionContext(), channels.release());310 311 RefPtr<DeliveredIntent> deliveredIntent = DeliveredIntent::create(m_coreFrame, dummyClient.release(), intent->action(), intent->type(),312 intent->data(), messagePorts.release(), intent->extras());313 WebCore::DOMWindowIntents::from(m_coreFrame->document()->domWindow())->deliver(deliveredIntent.release());314 }315 #endif316 269 317 270 String WebFrame::source() const -
trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h
r139023 r141448 45 45 class IntPoint; 46 46 class IntRect; 47 #if ENABLE(WEB_INTENTS)48 class Intent;49 #endif50 47 class KURL; 51 48 } … … 58 55 class InjectedBundleScriptWorld; 59 56 class WebPage; 60 61 #if ENABLE(WEB_INTENTS)62 struct IntentData;63 #endif64 57 65 58 class WebFrame : public APIObject { … … 85 78 void startDownload(const WebCore::ResourceRequest&); 86 79 void convertMainResourceLoadToDownload(WebCore::MainResourceLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); 87 88 #if ENABLE(WEB_INTENTS)89 void deliverIntent(const IntentData&);90 void deliverIntent(WebCore::Intent*);91 #endif92 80 93 81 String source() const; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r141366 r141448 150 150 #endif 151 151 152 #if ENABLE(WEB_INTENTS)153 #include "IntentData.h"154 #include <WebCore/Intent.h>155 #endif156 157 152 #if ENABLE(VIBRATION) 158 153 #include "WebVibrationClient.h" … … 2255 2250 } 2256 2251 2257 #if ENABLE(WEB_INTENTS)2258 void WebPage::deliverIntentToFrame(uint64_t frameID, const IntentData& intentData)2259 {2260 WebFrame* frame = WebProcess::shared().webFrame(frameID);2261 if (!frame)2262 return;2263 2264 frame->deliverIntent(intentData);2265 }2266 2267 void WebPage::deliverCoreIntentToFrame(uint64_t frameID, Intent* coreIntent)2268 {2269 if (WebFrame* frame = WebProcess::shared().webFrame(frameID))2270 frame->deliverIntent(coreIntent);2271 }2272 #endif2273 2274 2252 void WebPage::preferencesDidChange(const WebPreferencesStore& store) 2275 2253 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r141361 r141448 111 111 class FrameView; 112 112 class HTMLPlugInElement; 113 #if ENABLE(WEB_INTENTS)114 class Intent;115 #endif116 113 class KeyboardEvent; 117 114 class Page; … … 155 152 struct WebPreferencesStore; 156 153 157 #if ENABLE(WEB_INTENTS)158 struct IntentData;159 #endif160 161 154 #if ENABLE(GESTURE_EVENTS) 162 155 class WebGestureEvent; … … 492 485 #endif 493 486 494 #if ENABLE(WEB_INTENTS)495 void deliverCoreIntentToFrame(uint64_t frameID, WebCore::Intent*);496 #endif497 498 487 void replaceSelectionWithText(WebCore::Frame*, const String&); 499 488 void clearSelection(); … … 680 669 #endif 681 670 682 #if ENABLE(WEB_INTENTS)683 void deliverIntentToFrame(uint64_t frameID, const IntentData&);684 #endif685 686 671 static void scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity); 687 672 static void logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r141010 r141448 238 238 SetCanRunModal(bool canRunModal) 239 239 240 # Web Intents241 #if ENABLE(WEB_INTENTS)242 DeliverIntentToFrame(uint64_t frameID, WebKit::IntentData intentData)243 #endif244 245 240 #if PLATFORM(EFL) 246 241 SetThemePath(WTF::String themePath) -
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
r141361 r141448 82 82 #include <wtf/PassRefPtr.h> 83 83 84 #if ENABLE(WEB_INTENTS)85 #include <WebCore/PlatformMessagePortChannel.h>86 #endif87 88 84 #if ENABLE(NETWORK_INFO) 89 85 #include "WebNetworkInfoManagerMessages.h" … … 685 681 return result.iterator->value.get(); 686 682 } 687 688 #if ENABLE(WEB_INTENTS)689 uint64_t WebProcess::addMessagePortChannel(PassRefPtr<PlatformMessagePortChannel> messagePortChannel)690 {691 static uint64_t channelID = 0;692 m_messagePortChannels.add(++channelID, messagePortChannel);693 694 return channelID;695 }696 697 PlatformMessagePortChannel* WebProcess::messagePortChannel(uint64_t channelID)698 {699 return m_messagePortChannels.get(channelID).get();700 }701 702 void WebProcess::removeMessagePortChannel(uint64_t channelID)703 {704 m_messagePortChannels.remove(channelID);705 }706 #endif707 683 708 684 void WebProcess::clearResourceCaches(ResourceCachesToClear resourceCachesToClear) -
trunk/Source/WebKit2/WebProcess/WebProcess.h
r141361 r141448 68 68 class ResourceRequest; 69 69 struct PluginInfo; 70 71 #if ENABLE(WEB_INTENTS)72 class PlatformMessagePortChannel;73 #endif74 70 } 75 71 … … 123 119 void removeWebPage(uint64_t pageID); 124 120 WebPage* focusedWebPage() const; 125 126 #if ENABLE(WEB_INTENTS)127 uint64_t addMessagePortChannel(PassRefPtr<WebCore::PlatformMessagePortChannel>);128 WebCore::PlatformMessagePortChannel* messagePortChannel(uint64_t);129 void removeMessagePortChannel(uint64_t);130 #endif131 121 132 122 InjectedBundle* injectedBundle() const { return m_injectedBundle.get(); } … … 329 319 HashMap<uint64_t, WebFrame*> m_frameMap; 330 320 331 #if ENABLE(WEB_INTENTS)332 HashMap<uint64_t, RefPtr<WebCore::PlatformMessagePortChannel> > m_messagePortChannels;333 #endif334 335 321 typedef HashMap<AtomicString, WebProcessSupplement*> WebProcessSupplementMap; 336 322 WebProcessSupplementMap m_supplements; -
trunk/Source/WebKit2/WebProcess/WebProcess.messages.in
r141167 r141448 27 27 # Create a new page. 28 28 CreateWebPage(uint64_t newPageID, WebKit::WebPageCreationParameters pageCreationParameters) 29 30 #if ENABLE(WEB_INTENTS)31 RemoveMessagePortChannel(uint64_t channelID);32 #endif33 29 34 30 # Visited link tracking. -
trunk/Tools/ChangeLog
r141444 r141448 1 2013-01-31 Anders Carlsson <andersca@apple.com> 2 3 Remove Web Intents code from WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=108506 5 6 Reviewed by Simon Fraser. 7 8 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 9 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: 10 (WTR::InjectedBundlePage::InjectedBundlePage): 11 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: 12 (InjectedBundlePage): 13 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 14 * WebKitTestRunner/InjectedBundle/TestRunner.h: 15 (TestRunner): 16 1 17 2013-01-31 Tommy Widenflycht <tommyw@google.com> 2 18 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r139140 r141448 144 144 void setStopProvisionalFrameLoads(); 145 145 146 // Web intents testing.147 void sendWebIntentResponse(in DOMString reply);148 void deliverWebIntent(in DOMString action, in DOMString type, in DOMString data);149 150 146 // Focus testing. 151 147 void addChromeInputField(in object callback); -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
r140713 r141448 51 51 #if PLATFORM(QT) 52 52 #include "DumpRenderTreeSupportQt.h" 53 #endif54 55 #if ENABLE(WEB_INTENTS)56 #include <WebKit2/WKBundleIntent.h>57 #include <WebKit2/WKBundleIntentRequest.h>58 #endif59 #if ENABLE(WEB_INTENTS_TAG)60 #include <WebKit2/WKIntentServiceInfo.h>61 53 #endif 62 54 … … 328 320 didFinishProgress, // didFinishProgress 329 321 0, // shouldForceUniversalAccessFromLocalURL 330 didReceiveIntentForFrame, // didReceiveIntentForFrame331 registerIntentServiceForFrame, // registerIntentServiceForFrame322 0, // didReceiveIntentForFrame 323 0, // registerIntentServiceForFrame 332 324 0, // didLayout 333 325 }; … … 586 578 } 587 579 588 void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleIntentRequestRef intentRequest, WKTypeRef* userData, const void* clientInfo)589 {590 #if ENABLE(WEB_INTENTS)591 static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->m_currentIntentRequest = intentRequest;592 WKRetainPtr<WKBundleIntentRef> intent(AdoptWK, WKBundleIntentRequestCopyIntent(intentRequest));593 594 StringBuilder stringBuilder;595 stringBuilder.appendLiteral("Received Web Intent: action=");596 WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKBundleIntentCopyAction(intent.get()));597 stringBuilder.append(toWTFString(wkAction.get()));598 stringBuilder.appendLiteral(" type=");599 WKRetainPtr<WKStringRef> wkType(AdoptWK, WKBundleIntentCopyType(intent.get()));600 stringBuilder.append(toWTFString(wkType.get()));601 stringBuilder.append('\n');602 603 const size_t numMessagePorts = WKBundleIntentMessagePortCount(intent.get());604 if (numMessagePorts) {605 stringBuilder.appendLiteral("Have ");606 stringBuilder.appendNumber(numMessagePorts);607 stringBuilder.appendLiteral(" ports\n");608 }609 610 WKRetainPtr<WKURLRef> wkServiceUrl(AdoptWK, WKBundleIntentCopyService(intent.get()));611 if (wkServiceUrl) {612 WKRetainPtr<WKStringRef> wkService(AdoptWK, WKURLCopyString(wkServiceUrl.get()));613 if (wkService && !WKStringIsEmpty(wkService.get())) {614 stringBuilder.appendLiteral("Explicit intent service: ");615 stringBuilder.append(toWTFString(wkService.get()));616 stringBuilder.append('\n');617 }618 }619 620 WKRetainPtr<WKDictionaryRef> wkExtras(AdoptWK, WKBundleIntentCopyExtras(intent.get()));621 WKRetainPtr<WKArrayRef> wkExtraKeys(AdoptWK, WKDictionaryCopyKeys(wkExtras.get()));622 const size_t numExtraKeys = WKArrayGetSize(wkExtraKeys.get());623 for (size_t i = 0; i < numExtraKeys; ++i) {624 WKStringRef wkKey = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkExtraKeys.get(), i));625 WKStringRef wkValue = static_cast<WKStringRef>(WKDictionaryGetItemForKey(wkExtras.get(), wkKey));626 stringBuilder.appendLiteral("Extras[");627 stringBuilder.append(toWTFString(wkKey));628 stringBuilder.appendLiteral("] = ");629 stringBuilder.append(toWTFString(wkValue));630 stringBuilder.append('\n');631 }632 633 WKRetainPtr<WKArrayRef> wkSuggestions(AdoptWK, WKBundleIntentCopySuggestions(intent.get()));634 const size_t numSuggestions = WKArrayGetSize(wkSuggestions.get());635 for (size_t i = 0; i < numSuggestions; ++i) {636 WKStringRef wkSuggestion = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkSuggestions.get(), i));637 stringBuilder.appendLiteral("Have suggestion ");638 stringBuilder.append(toWTFString(wkSuggestion));639 stringBuilder.append('\n');640 }641 642 InjectedBundle::shared().outputText(stringBuilder.toString());643 #endif644 }645 646 void InjectedBundlePage::registerIntentServiceForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKIntentServiceInfoRef serviceInfo, WKTypeRef* userData, const void* clientInfo)647 {648 #if ENABLE(WEB_INTENTS_TAG)649 StringBuilder stringBuilder;650 stringBuilder.appendLiteral("Registered Web Intent Service: action=");651 WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKIntentServiceInfoCopyAction(serviceInfo));652 stringBuilder.append(toWTFString(wkAction.get()));653 stringBuilder.appendLiteral(" type=");654 WKRetainPtr<WKStringRef> wkType(AdoptWK, WKIntentServiceInfoCopyType(serviceInfo));655 stringBuilder.append(toWTFString(wkType.get()));656 stringBuilder.appendLiteral(" title=");657 WKRetainPtr<WKStringRef> wkTitle(AdoptWK, WKIntentServiceInfoCopyTitle(serviceInfo));658 stringBuilder.append(toWTFString(wkTitle.get()));659 stringBuilder.appendLiteral(" url=");660 WKRetainPtr<WKURLRef> wkUrl(AdoptWK, WKIntentServiceInfoCopyHref(serviceInfo));661 if (wkUrl)662 stringBuilder.append(toWTFString(adoptWK(WKURLCopyString(wkUrl.get()))));663 stringBuilder.appendLiteral(" disposition=");664 WKRetainPtr<WKStringRef> wkDisposition(AdoptWK, WKIntentServiceInfoCopyDisposition(serviceInfo));665 stringBuilder.append(toWTFString(wkDisposition.get()));666 stringBuilder.append('\n');667 InjectedBundle::shared().outputText(stringBuilder.toString());668 #endif669 }670 671 580 void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void* clientInfo) 672 581 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
r137127 r141448 41 41 WKBundlePageRef page() const { return m_page; } 42 42 43 #if ENABLE(WEB_INTENTS)44 WKBundleIntentRequestRef currentIntentRequest() const { return m_currentIntentRequest.get(); }45 #endif46 47 43 void dump(); 48 44 … … 80 76 static void didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKErrorRef, const void*); 81 77 static bool shouldCacheResponse(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, const void*); 82 static void didReceiveIntentForFrame(WKBundlePageRef, WKBundleFrameRef, WKBundleIntentRequestRef, WKTypeRef*, const void*);83 static void registerIntentServiceForFrame(WKBundlePageRef, WKBundleFrameRef, WKIntentServiceInfoRef, WKTypeRef*, const void*);84 78 85 79 void didStartProvisionalLoadForFrame(WKBundleFrameRef); … … 181 175 WKRetainPtr<WKBundleScriptWorldRef> m_world; 182 176 WKRetainPtr<WKBundleBackForwardListItemRef> m_previousTestBackForwardListItem; 183 184 #if ENABLE(WEB_INTENTS)185 WKRetainPtr<WKBundleIntentRequestRef> m_currentIntentRequest;186 #endif187 177 }; 188 178 -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r141010 r141448 53 53 #include <wtf/text/CString.h> 54 54 #include <wtf/text/StringBuilder.h> 55 56 #if ENABLE(WEB_INTENTS)57 #include <WebKit2/WKBundleIntent.h>58 #include <WebKit2/WKBundleIntentRequest.h>59 #endif60 55 61 56 namespace WTR { … … 670 665 } 671 666 672 void TestRunner::sendWebIntentResponse(JSStringRef reply)673 {674 #if ENABLE(WEB_INTENTS)675 WKRetainPtr<WKBundleIntentRequestRef> currentRequest = InjectedBundle::shared().page()->currentIntentRequest();676 if (!currentRequest)677 return;678 679 WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());680 JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);681 682 if (reply) {683 WKRetainPtr<WKSerializedScriptValueRef> serializedData(AdoptWK, WKSerializedScriptValueCreate(context, JSValueMakeString(context, reply), 0));684 WKBundleIntentRequestPostResult(currentRequest.get(), serializedData.get());685 } else {686 JSRetainPtr<JSStringRef> errorReply(JSStringCreateWithUTF8CString("ERROR"));687 WKRetainPtr<WKSerializedScriptValueRef> serializedData(AdoptWK, WKSerializedScriptValueCreate(context, JSValueMakeString(context, errorReply.get()), 0));688 WKBundleIntentRequestPostFailure(currentRequest.get(), serializedData.get());689 }690 #endif691 }692 693 void TestRunner::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data)694 {695 #if ENABLE(WEB_INTENTS)696 WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());697 JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);698 699 WKRetainPtr<WKStringRef> actionWK = toWK(action);700 WKRetainPtr<WKStringRef> typeWK = toWK(type);701 WKRetainPtr<WKSerializedScriptValueRef> dataWK(AdoptWK, WKSerializedScriptValueCreate(context, JSValueMakeString(context, data), 0));702 703 WKRetainPtr<WKMutableDictionaryRef> intentInitDict(AdoptWK, WKMutableDictionaryCreate());704 WKRetainPtr<WKStringRef> actionKey(AdoptWK, WKStringCreateWithUTF8CString("action"));705 WKDictionaryAddItem(intentInitDict.get(), actionKey.get(), actionWK.get());706 707 WKRetainPtr<WKStringRef> typeKey(AdoptWK, WKStringCreateWithUTF8CString("type"));708 WKDictionaryAddItem(intentInitDict.get(), typeKey.get(), typeWK.get());709 710 WKRetainPtr<WKStringRef> dataKey(AdoptWK, WKStringCreateWithUTF8CString("data"));711 WKDictionaryAddItem(intentInitDict.get(), dataKey.get(), dataWK.get());712 713 WKRetainPtr<WKBundleIntentRef> wkIntent(AdoptWK, WKBundleIntentCreate(intentInitDict.get()));714 WKBundlePageDeliverIntentToFrame(InjectedBundle::shared().page()->page(), mainFrame, wkIntent.get());715 #endif716 }717 718 667 void TestRunner::setAlwaysAcceptCookies(bool accept) 719 668 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r139194 r141448 246 246 void overridePreference(JSStringRef preference, JSStringRef value); 247 247 248 // Web intents testing.249 void sendWebIntentResponse(JSStringRef reply);250 void deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data);251 252 248 // Cookies testing 253 249 void setAlwaysAcceptCookies(bool);
Note:
See TracChangeset
for help on using the changeset viewer.