Changeset 141448 in webkit


Ignore:
Timestamp:
Jan 31, 2013 11:11:25 AM (11 years ago)
Author:
andersca@apple.com
Message:

Remove Web Intents code from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=108506

Reviewed by Simon Fraser.

Source/WebKit2:

Since nobody builds with Web Intents enabled anymore, and since the code is going to
be removed from WebCore, remove it from WebKit2.

  • Shared/API/c/WKBase.h:
  • Shared/APIClientTraits.cpp:

(WebKit):

  • Shared/APIObject.h:
  • Shared/IntentData.cpp: Removed.
  • Shared/IntentData.h: Removed.
  • Shared/IntentServiceInfo.cpp: Removed.
  • Shared/IntentServiceInfo.h: Removed.
  • Shared/WebIntentServiceInfo.cpp: Removed.
  • Shared/WebIntentServiceInfo.h: Removed.
  • UIProcess/API/C/WKAPICast.h:

(WebKit):

  • UIProcess/API/C/WKIntentData.cpp: Removed.
  • UIProcess/API/C/WKIntentData.h: Removed.
  • UIProcess/API/C/WKIntentServiceInfo.cpp: Removed.
  • UIProcess/API/C/WKIntentServiceInfo.h: Removed.
  • UIProcess/API/C/WKPage.cpp:
  • UIProcess/API/C/WKPage.h:
  • UIProcess/WebIntentData.cpp: Removed.
  • UIProcess/WebIntentData.h: Removed.
  • UIProcess/WebLoaderClient.cpp:
  • UIProcess/WebLoaderClient.h:

(WebKit):
(WebLoaderClient):

  • UIProcess/WebPageProxy.cpp:
  • UIProcess/WebPageProxy.h:

(WebKit):
(WebPageProxy):

  • UIProcess/WebPageProxy.messages.in:
  • UIProcess/WebProcessProxy.cpp:
  • UIProcess/WebProcessProxy.h:

(WebProcessProxy):

  • WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:

(WebKit):

  • WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp: Removed.
  • WebProcess/InjectedBundle/API/c/WKBundleIntent.h: Removed.
  • WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp: Removed.
  • WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h: Removed.
  • WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
  • WebProcess/InjectedBundle/API/c/WKBundlePage.h:
  • WebProcess/InjectedBundle/InjectedBundleIntent.cpp: Removed.
  • WebProcess/InjectedBundle/InjectedBundleIntent.h: Removed.
  • WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp: Removed.
  • WebProcess/InjectedBundle/InjectedBundleIntentRequest.h: Removed.
  • WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
  • WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:

(WebKit):
(InjectedBundlePageLoaderClient):

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit):

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

(WebFrameLoaderClient):

  • WebProcess/WebPage/WebFrame.cpp:
  • WebProcess/WebPage/WebFrame.h:

(WebCore):
(WebKit):
(WebFrame):

  • WebProcess/WebPage/WebPage.cpp:
  • WebProcess/WebPage/WebPage.h:

(WebCore):
(WebKit):
(WebPage):

  • WebProcess/WebPage/WebPage.messages.in:
  • WebProcess/WebProcess.cpp:
  • WebProcess/WebProcess.h:

(WebCore):
(WebProcess):

  • WebProcess/WebProcess.messages.in:

Tools:

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:

(WTR::InjectedBundlePage::InjectedBundlePage):

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:

(InjectedBundlePage):

  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:
  • WebKitTestRunner/InjectedBundle/TestRunner.h:

(TestRunner):

Location:
trunk
Files:
20 deleted
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r141447 r141448  
     12013-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
    1802013-01-31  Brady Eidson  <beidson@apple.com>
    281
  • trunk/Source/WebKit2/Shared/API/c/WKBase.h

    r131281 r141448  
    118118typedef const struct OpaqueWKIconDatabase* WKIconDatabaseRef;
    119119typedef const struct OpaqueWKInspector* WKInspectorRef;
    120 typedef const struct OpaqueWKIntentData* WKIntentDataRef;
    121 typedef const struct OpaqueWKIntentServiceInfo* WKIntentServiceInfoRef;
    122120typedef const struct OpaqueWKKeyValueStorageManager* WKKeyValueStorageManagerRef;
    123121typedef const struct OpaqueWKMediaCacheManager* WKMediaCacheManagerRef;
     
    149147typedef const struct OpaqueWKBundleHitTestResult* WKBundleHitTestResultRef;
    150148typedef const struct OpaqueWKBundleInspector* WKBundleInspectorRef;
    151 typedef const struct OpaqueWKBundleIntent* WKBundleIntentRef;
    152 typedef const struct OpaqueWKBundleIntentRequest* WKBundleIntentRequestRef;
    153149typedef const struct OpaqueWKBundleNavigationAction* WKBundleNavigationActionRef;
    154150typedef const struct OpaqueWKBundleNodeHandle* WKBundleNodeHandleRef;
  • trunk/Source/WebKit2/Shared/APIClientTraits.cpp

    r129810 r141448  
    4040    offsetof(WKBundlePageLoaderClient, didLayoutForFrame),
    4141    offsetof(WKBundlePageLoaderClient, didFinishProgress),
    42     offsetof(WKBundlePageLoaderClient, didReceiveIntentForFrame),
    43     offsetof(WKBundlePageLoaderClient, registerIntentServiceForFrame),
     42    offsetof(WKBundlePageLoaderClient, didReceiveIntentForFrame_unavailable),
     43    offsetof(WKBundlePageLoaderClient, registerIntentServiceForFrame_unavailable),
    4444    sizeof(WKBundlePageLoaderClient)
    4545};
     
    6363const size_t APIClientTraits<WKPageLoaderClient>::interfaceSizesByVersion[] = {
    6464    offsetof(WKPageLoaderClient, didDetectXSSForFrame),
    65     offsetof(WKPageLoaderClient, didReceiveIntentForFrame),
     65    offsetof(WKPageLoaderClient, didReceiveIntentForFrame_unavailable),
    6666    sizeof(WKPageLoaderClient)
    6767};
  • trunk/Source/WebKit2/Shared/APIObject.h

    r136095 r141448  
    9292        TypeIconDatabase,
    9393        TypeInspector,
    94         TypeIntentData,
    95         TypeIntentServiceInfo,
    9694        TypeKeyValueStorageManager,
    9795        TypeMediaCacheManager,
     
    119117        TypeBundleHitTestResult,
    120118        TypeBundleInspector,
    121         TypeBundleIntent,
    122         TypeBundleIntentRequest,
    123119        TypeBundleNavigationAction,
    124120        TypeBundleNodeHandle,
  • trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h

    r139023 r141448  
    7575class WebIconDatabase;
    7676class WebInspectorProxy;
    77 class WebIntentData;
    78 class WebIntentServiceInfo;
    7977class WebKeyValueStorageManagerProxy;
    8078class WebMediaCacheManagerProxy;
     
    120118WK_ADD_API_MAPPING(WKHitTestResultRef, WebHitTestResult)
    121119WK_ADD_API_MAPPING(WKIconDatabaseRef, WebIconDatabase)
    122 WK_ADD_API_MAPPING(WKIntentDataRef, WebIntentData)
    123 WK_ADD_API_MAPPING(WKIntentServiceInfoRef, WebIntentServiceInfo)
    124120WK_ADD_API_MAPPING(WKKeyValueStorageManagerRef, WebKeyValueStorageManagerProxy)
    125121WK_ADD_API_MAPPING(WKMediaCacheManagerRef, WebMediaCacheManagerProxy)
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r141010 r141448  
    761761#endif
    762762
    763 void WKPageDeliverIntentToFrame(WKPageRef page, WKFrameRef frame, WKIntentDataRef intent)
    764 {
    765 #if ENABLE(WEB_INTENTS)
    766     toImpl(page)->deliverIntentToFrame(toImpl(frame), toImpl(intent));
    767 #endif
    768 }
    769 
    770763WKImageRef WKPageCreateSnapshotOfVisibleContent(WKPageRef)
    771764{
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.h

    r141010 r141448  
    7575typedef void (*WKPageWillGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, WKTypeRef userData, const void *clientInfo);
    7676typedef 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);
    7977typedef void (*WKPageDidLayoutCallback)(WKPageRef page, WKLayoutMilestones milestones, WKTypeRef userData, const void *clientInfo);
    8078
     
    128126
    129127    // Version 2
    130     WKPageDidReceiveIntentForFrameCallback                              didReceiveIntentForFrame;
    131     WKPageRegisterIntentServiceForFrameCallback                         registerIntentServiceForFrame;
     128    void                                                                (*didReceiveIntentForFrame_unavailable)(void);
     129    void                                                                (*registerIntentServiceForFrame_unavailable)(void);
    132130
    133131    WKPageDidLayoutCallback                                             didLayout;
     
    490488WK_EXPORT void WKPageForceRepaint(WKPageRef page, void* context, WKPageForceRepaintFunction function);
    491489
    492 WK_EXPORT void WKPageDeliverIntentToFrame(WKPageRef page, WKFrameRef frame, WKIntentDataRef intent);
    493 
    494490/*
    495491    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  
    3232#include <string.h>
    3333
    34 #if ENABLE(WEB_INTENTS)
    35 #include "WebIntentData.h"
    36 #include "WebIntentServiceInfo.h"
    37 #endif
    38 
    3934using namespace WebCore;
    4035
     
    176171    m_client.didDetectXSSForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.clientInfo);
    177172}
    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 #endif
    188 
    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 #endif
    198173
    199174bool WebLoaderClient::canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy* page, WebFrameProxy* frame, WebProtectionSpace* protectionSpace)
  • trunk/Source/WebKit2/UIProcess/WebLoaderClient.h

    r129545 r141448  
    4949class WebProtectionSpace;
    5050
    51 #if ENABLE(WEB_INTENTS)
    52 class WebIntentData;
    53 #endif
    54 
    55 #if ENABLE(WEB_INTENTS_TAG)
    56 class WebIntentServiceInfo;
    57 #endif
    58 
    5951class WebLoaderClient : public APIClient<WKPageLoaderClient, kWKPageLoaderClientCurrentVersion> {
    6052public:
     
    7466    void didRunInsecureContentForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
    7567    void didDetectXSSForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
    76 #if ENABLE(WEB_INTENTS)
    77     void didReceiveIntentForFrame(WebPageProxy*, WebFrameProxy*, WebIntentData*, APIObject*);
    78 #endif
    79 
    80 #if ENABLE(WEB_INTENTS_TAG)
    81     void registerIntentServiceForFrame(WebPageProxy*, WebFrameProxy*, WebIntentServiceInfo*, APIObject*);
    82 #endif
    8368
    8469    // FIXME: didNewFirstVisuallyNonEmptyLayout should be removed. We should consider removing didFirstVisuallyNonEmptyLayoutForFrame
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r141366 r141448  
    9393#include <stdio.h>
    9494
    95 #if ENABLE(WEB_INTENTS)
    96 #include "IntentData.h"
    97 #include "IntentServiceInfo.h"
    98 #include "WebIntentData.h"
    99 #include "WebIntentServiceInfo.h"
    100 #endif
    101 
    10295#if USE(COORDINATED_GRAPHICS)
    10396#include "CoordinatedLayerTreeHostProxyMessages.h"
     
    17881781}
    17891782
    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 #endif
    1799 
    18001783void WebPageProxy::getContentsAsString(PassRefPtr<StringCallback> prpCallback)
    18011784{
     
    20792062    m_loaderClient.didFinishProgress(this);
    20802063}
    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 #endif
    20972064
    20982065void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::MessageDecoder& decoder)
     
    23822349    m_loaderClient.didDetectXSSForFrame(this, frame, userData.get());
    23832350}
    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 #endif
    24002351
    24012352void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value)
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r141361 r141448  
    125125#endif
    126126
    127 #if ENABLE(WEB_INTENTS)
    128 class WebIntentData;
    129 #endif
    130 
    131127namespace WebKit {
    132128
     
    168164#endif
    169165
    170 #if ENABLE(WEB_INTENTS)
    171 struct IntentData;
    172 #endif
    173 
    174 #if ENABLE(WEB_INTENTS_TAG)
    175 struct IntentServiceInfo;
    176 #endif
    177 
    178166typedef GenericCallback<WKStringRef, StringImpl*> StringCallback;
    179167typedef GenericCallback<WKSerializedScriptValueRef, WebSerializedScriptValue*> ScriptValueCallback;
     
    563551    void runJavaScriptInMainFrame(const String&, PassRefPtr<ScriptValueCallback>);
    564552    void forceRepaint(PassRefPtr<VoidCallback>);
    565 
    566 #if ENABLE(WEB_INTENTS)
    567     void deliverIntentToFrame(WebFrameProxy*, WebIntentData*);
    568 #endif
    569553
    570554    float headerHeight(WebFrameProxy*);
     
    809793    void didFinishProgress();
    810794
    811 #if ENABLE(WEB_INTENTS)
    812     void didReceiveIntentForFrame(uint64_t frameID, const IntentData&, CoreIPC::MessageDecoder&);
    813 #endif
    814 #if ENABLE(WEB_INTENTS_TAG)
    815     void registerIntentServiceForFrame(uint64_t frameID, const IntentServiceInfo&, CoreIPC::MessageDecoder&);
    816 #endif
    817    
    818795    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);
    819796    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  
    105105    UnableToImplementPolicy(uint64_t frameID, WebCore::ResourceError error, WebKit::InjectedBundleUserMessageEncoder userData)  Variadic
    106106
    107     # Intent messages
    108 #if ENABLE(WEB_INTENTS)
    109     DidReceiveIntentForFrame(uint64_t frameID, WebKit::IntentData intent, WebKit::InjectedBundleUserMessageEncoder userData) Variadic
    110 #endif
    111 #if ENABLE(WEB_INTENTS_TAG)
    112     RegisterIntentServiceForFrame(uint64_t frameID, WebKit::IntentServiceInfo serviceInfo, WebKit::InjectedBundleUserMessageEncoder userData) Variadic
    113 #endif
    114 
    115107    # Progress messages
    116108    DidChangeProgress(double value)
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp

    r141361 r141448  
    215215}
    216216
    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 #endif
    226 
    227217WebBackForwardListItem* WebProcessProxy::webBackForwardItem(uint64_t itemID) const
    228218{
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.h

    r141361 r141448  
    8686    Vector<WebPageProxy*> pages() const;
    8787
    88 #if ENABLE(WEB_INTENTS)
    89     void removeMessagePortChannel(uint64_t channelID);
    90 #endif
    91 
    9288    WebBackForwardListItem* webBackForwardItem(uint64_t itemID) const;
    9389
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h

    r131281 r141448  
    4545class InjectedBundleDOMWindowExtension;
    4646class InjectedBundleHitTestResult;
    47 class InjectedBundleIntent;
    48 class InjectedBundleIntentRequest;
    4947class InjectedBundleNavigationAction;
    5048class InjectedBundleNodeHandle;
     
    6462WK_ADD_API_MAPPING(WKBundleHitTestResultRef, InjectedBundleHitTestResult)
    6563WK_ADD_API_MAPPING(WKBundleInspectorRef, WebInspector)
    66 WK_ADD_API_MAPPING(WKBundleIntentRef, InjectedBundleIntent)
    67 WK_ADD_API_MAPPING(WKBundleIntentRequestRef, InjectedBundleIntentRequest)
    6864WK_ADD_API_MAPPING(WKBundleNavigationActionRef, InjectedBundleNavigationAction)
    6965WK_ADD_API_MAPPING(WKBundleNodeHandleRef, InjectedBundleNodeHandle)
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp

    r140769 r141448  
    5555#include <wtf/UnusedParam.h>
    5656
    57 #if ENABLE(WEB_INTENTS)
    58 #include "InjectedBundleIntent.h"
    59 #endif
    60 
    6157using namespace WebKit;
    6258
     
    358354{
    359355    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 #endif
    367356}
    368357
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h

    r140863 r141448  
    110110typedef void (*WKBundlePageWillDestroyGlobalObjectForDOMWindowExtensionCallback)(WKBundlePageRef page, WKBundleDOMWindowExtensionRef, const void* clientInfo);
    111111typedef 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);
    114112typedef void (*WKBundlePageDidLayoutCallback)(WKBundlePageRef page, WKLayoutMilestones milestones, WKTypeRef* userData, const void *clientInfo);
    115113
     
    153151
    154152    // Version 3
    155     WKBundlePageDidReceiveIntentForFrameCallback                            didReceiveIntentForFrame;
    156     WKBundlePageRegisterIntentServiceForFrameCallback                       registerIntentServiceForFrame;
     153    void *                                                                  didReceiveIntentForFrame_unavailable;
     154    void *                                                                  registerIntentServiceForFrame_unavailable;
    157155
    158156    // Version 4
     
    442440WK_EXPORT void WKBundlePageListenForLayoutMilestones(WKBundlePageRef page, WKLayoutMilestones milestones);
    443441
    444 WK_EXPORT void WKBundlePageDeliverIntentToFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleIntentRef intent);
    445 
    446442WK_EXPORT WKBundleInspectorRef WKBundlePageGetInspector(WKBundlePageRef page);
    447443
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp

    r129545 r141448  
    3434#include <wtf/text/WTFString.h>
    3535
    36 #if ENABLE(WEB_INTENTS)
    37 #include "InjectedBundleIntentRequest.h"
    38 #endif
    39 #if ENABLE(WEB_INTENTS_TAG)
    40 #include "WebIntentServiceInfo.h"
    41 #endif
    42 
    4336using namespace WebCore;
    4437
     
    194187    userData = adoptRef(toImpl(userDataToPass));
    195188}
    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 #endif
    208 
    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 #endif
    220189
    221190void InjectedBundlePageLoaderClient::didFirstLayoutForFrame(WebPage* page, WebFrame* frame, RefPtr<APIObject>& userData)
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h

    r129545 r141448  
    4848class WebPage;
    4949class WebFrame;
    50 #if ENABLE(WEB_INTENTS)
    51 class InjectedBundleIntentRequest;
    52 #endif
    53 #if ENABLE(WEB_INTENTS_TAG)
    54 class WebIntentServiceInfo;
    55 #endif
    5650
    5751class InjectedBundlePageLoaderClient : public APIClient<WKBundlePageLoaderClient, kWKBundlePageLoaderClientCurrentVersion> {
     
    7266    void didRunInsecureContentForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData);
    7367    void didDetectXSSForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData);
    74 
    75 #if ENABLE(WEB_INTENTS)
    76     void didReceiveIntentForFrame(WebPage*, WebFrame*, InjectedBundleIntentRequest*, RefPtr<APIObject>& userData);
    77 #endif
    78 #if ENABLE(WEB_INTENTS_TAG)
    79     void registerIntentServiceForFrame(WebPage*, WebFrame*, WebIntentServiceInfo*, RefPtr<APIObject>& userData);
    80 #endif
    8168
    8269    void didFirstLayoutForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData);
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r140667 r141448  
    7777#include <WebCore/WindowFeatures.h>
    7878
    79 #if ENABLE(WEB_INTENTS)
    80 #include "InjectedBundleIntentRequest.h"
    81 #include "IntentData.h"
    82 #include <WebCore/IntentRequest.h>
    83 #endif
    84 
    85 #if ENABLE(WEB_INTENTS_TAG)
    86 #include "IntentServiceInfo.h"
    87 #include "WebIntentServiceInfo.h"
    88 #endif
    89 
    9079using namespace WebCore;
    9180
     
    15621551#endif // PLATFORM(MAC)
    15631552
    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 #endif
    1579 
    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 #endif
    1601 
    16021553bool WebFrameLoaderClient::shouldUsePluginDocument(const String& /*mimeType*/) const
    16031554{
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h

    r139023 r141448  
    2929#include <WebCore/FrameLoaderClient.h>
    3030
    31 namespace WebCore {
    32 #if ENABLE(WEB_INTENTS)
    33 class IntentRequest;
    34 #endif
    35 }
    36 
    3731namespace WebKit {
    3832
     
    221215#endif
    222216
    223 #if ENABLE(WEB_INTENTS)
    224     virtual void dispatchIntent(PassRefPtr<WebCore::IntentRequest>) OVERRIDE;
    225 #endif
    226 #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 #endif
    229 
    230217    virtual bool shouldUsePluginDocument(const String& /*mimeType*/) const OVERRIDE;
    231218
  • trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp

    r141017 r141448  
    6767#include <wtf/text/StringBuilder.h>
    6868
    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 #endif
    76 
    7769#if PLATFORM(MAC)
    7870#include <WebCore/LegacyWebArchive.h>
     
    275267    WebProcess::shared().downloadManager().convertHandleToDownload(policyDownloadID, mainResourceLoader->loader()->handle(), request, response);
    276268}
    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 #endif
    316269
    317270String WebFrame::source() const
  • trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h

    r139023 r141448  
    4545class IntPoint;
    4646class IntRect;
    47 #if ENABLE(WEB_INTENTS)
    48 class Intent;
    49 #endif
    5047class KURL;
    5148}
     
    5855class InjectedBundleScriptWorld;
    5956class WebPage;
    60 
    61 #if ENABLE(WEB_INTENTS)
    62 struct IntentData;
    63 #endif
    6457
    6558class WebFrame : public APIObject {
     
    8578    void startDownload(const WebCore::ResourceRequest&);
    8679    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 #endif
    9280
    9381    String source() const;
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r141366 r141448  
    150150#endif
    151151
    152 #if ENABLE(WEB_INTENTS)
    153 #include "IntentData.h"
    154 #include <WebCore/Intent.h>
    155 #endif
    156 
    157152#if ENABLE(VIBRATION)
    158153#include "WebVibrationClient.h"
     
    22552250}
    22562251
    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 #endif
    2273 
    22742252void WebPage::preferencesDidChange(const WebPreferencesStore& store)
    22752253{
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r141361 r141448  
    111111    class FrameView;
    112112    class HTMLPlugInElement;
    113 #if ENABLE(WEB_INTENTS)
    114     class Intent;
    115 #endif
    116113    class KeyboardEvent;
    117114    class Page;
     
    155152struct WebPreferencesStore;
    156153
    157 #if ENABLE(WEB_INTENTS)
    158 struct IntentData;
    159 #endif
    160 
    161154#if ENABLE(GESTURE_EVENTS)
    162155class WebGestureEvent;
     
    492485#endif
    493486
    494 #if ENABLE(WEB_INTENTS)
    495     void deliverCoreIntentToFrame(uint64_t frameID, WebCore::Intent*);
    496 #endif
    497 
    498487    void replaceSelectionWithText(WebCore::Frame*, const String&);
    499488    void clearSelection();
     
    680669#endif
    681670
    682 #if ENABLE(WEB_INTENTS)
    683     void deliverIntentToFrame(uint64_t frameID, const IntentData&);
    684 #endif
    685 
    686671    static void scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
    687672    static void logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in

    r141010 r141448  
    238238    SetCanRunModal(bool canRunModal)
    239239
    240     # Web Intents
    241 #if ENABLE(WEB_INTENTS)
    242     DeliverIntentToFrame(uint64_t frameID, WebKit::IntentData intentData)
    243 #endif
    244 
    245240#if PLATFORM(EFL)
    246241    SetThemePath(WTF::String themePath)
  • trunk/Source/WebKit2/WebProcess/WebProcess.cpp

    r141361 r141448  
    8282#include <wtf/PassRefPtr.h>
    8383
    84 #if ENABLE(WEB_INTENTS)
    85 #include <WebCore/PlatformMessagePortChannel.h>
    86 #endif
    87 
    8884#if ENABLE(NETWORK_INFO)
    8985#include "WebNetworkInfoManagerMessages.h"
     
    685681    return result.iterator->value.get();
    686682}
    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 #endif
    707683
    708684void WebProcess::clearResourceCaches(ResourceCachesToClear resourceCachesToClear)
  • trunk/Source/WebKit2/WebProcess/WebProcess.h

    r141361 r141448  
    6868    class ResourceRequest;
    6969    struct PluginInfo;
    70 
    71 #if ENABLE(WEB_INTENTS)
    72     class PlatformMessagePortChannel;
    73 #endif
    7470}
    7571
     
    123119    void removeWebPage(uint64_t pageID);
    124120    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 #endif
    131121
    132122    InjectedBundle* injectedBundle() const { return m_injectedBundle.get(); }
     
    329319    HashMap<uint64_t, WebFrame*> m_frameMap;
    330320
    331 #if ENABLE(WEB_INTENTS)
    332     HashMap<uint64_t, RefPtr<WebCore::PlatformMessagePortChannel> > m_messagePortChannels;
    333 #endif
    334 
    335321    typedef HashMap<AtomicString, WebProcessSupplement*> WebProcessSupplementMap;
    336322    WebProcessSupplementMap m_supplements;
  • trunk/Source/WebKit2/WebProcess/WebProcess.messages.in

    r141167 r141448  
    2727    # Create a new page.
    2828    CreateWebPage(uint64_t newPageID, WebKit::WebPageCreationParameters pageCreationParameters)
    29 
    30 #if ENABLE(WEB_INTENTS)
    31     RemoveMessagePortChannel(uint64_t channelID);
    32 #endif
    3329
    3430    # Visited link tracking.
  • trunk/Tools/ChangeLog

    r141444 r141448  
     12013-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
    1172013-01-31  Tommy Widenflycht  <tommyw@google.com>
    218
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl

    r139140 r141448  
    144144    void setStopProvisionalFrameLoads();
    145145
    146     // Web intents testing.
    147     void sendWebIntentResponse(in DOMString reply);
    148     void deliverWebIntent(in DOMString action, in DOMString type, in DOMString data);
    149    
    150146    // Focus testing.
    151147    void addChromeInputField(in object callback);
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

    r140713 r141448  
    5151#if PLATFORM(QT)
    5252#include "DumpRenderTreeSupportQt.h"
    53 #endif
    54 
    55 #if ENABLE(WEB_INTENTS)
    56 #include <WebKit2/WKBundleIntent.h>
    57 #include <WebKit2/WKBundleIntentRequest.h>
    58 #endif
    59 #if ENABLE(WEB_INTENTS_TAG)
    60 #include <WebKit2/WKIntentServiceInfo.h>
    6153#endif
    6254
     
    328320        didFinishProgress, // didFinishProgress
    329321        0, // shouldForceUniversalAccessFromLocalURL
    330         didReceiveIntentForFrame, // didReceiveIntentForFrame
    331         registerIntentServiceForFrame, // registerIntentServiceForFrame
     322        0, // didReceiveIntentForFrame
     323        0, // registerIntentServiceForFrame
    332324        0, // didLayout
    333325    };
     
    586578}
    587579
    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 #endif
    644 }
    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 #endif
    669 }
    670 
    671580void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void* clientInfo)
    672581{
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h

    r137127 r141448  
    4141    WKBundlePageRef page() const { return m_page; }
    4242
    43 #if ENABLE(WEB_INTENTS)
    44     WKBundleIntentRequestRef currentIntentRequest() const { return m_currentIntentRequest.get(); }
    45 #endif
    46 
    4743    void dump();
    4844
     
    8076    static void didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKErrorRef, const void*);
    8177    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*);
    8478
    8579    void didStartProvisionalLoadForFrame(WKBundleFrameRef);
     
    181175    WKRetainPtr<WKBundleScriptWorldRef> m_world;
    182176    WKRetainPtr<WKBundleBackForwardListItemRef> m_previousTestBackForwardListItem;
    183 
    184 #if ENABLE(WEB_INTENTS)
    185     WKRetainPtr<WKBundleIntentRequestRef> m_currentIntentRequest;
    186 #endif
    187177};
    188178
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

    r141010 r141448  
    5353#include <wtf/text/CString.h>
    5454#include <wtf/text/StringBuilder.h>
    55 
    56 #if ENABLE(WEB_INTENTS)
    57 #include <WebKit2/WKBundleIntent.h>
    58 #include <WebKit2/WKBundleIntentRequest.h>
    59 #endif
    6055
    6156namespace WTR {
     
    670665}
    671666
    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 #endif
    691 }
    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 #endif
    716 }
    717 
    718667void TestRunner::setAlwaysAcceptCookies(bool accept)
    719668{
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

    r139194 r141448  
    246246    void overridePreference(JSStringRef preference, JSStringRef value);
    247247
    248     // Web intents testing.
    249     void sendWebIntentResponse(JSStringRef reply);
    250     void deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data);
    251 
    252248    // Cookies testing
    253249    void setAlwaysAcceptCookies(bool);
Note: See TracChangeset for help on using the changeset viewer.