WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
88340_wk2_dispatchIntent.patch (text/plain), 29.04 KB, created by
Chris Dumez
on 2012-06-07 00:05:19 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2012-06-07 00:05:19 PDT
Size:
29.04 KB
patch
obsolete
>diff --git a/Source/WebKit2/CMakeLists.txt b/Source/WebKit2/CMakeLists.txt >index 3c15710..8c6bb84 100644 >--- a/Source/WebKit2/CMakeLists.txt >+++ b/Source/WebKit2/CMakeLists.txt >@@ -122,6 +122,7 @@ SET(WebKit2_SOURCES > Shared/FontInfo.cpp > Shared/ImmutableArray.cpp > Shared/ImmutableDictionary.cpp >+ Shared/IntentData.cpp > Shared/MutableArray.cpp > Shared/MutableDictionary.cpp > Shared/OriginAndDatabases.cpp >@@ -236,6 +237,7 @@ SET(WebKit2_SOURCES > UIProcess/WebIconDatabase.cpp > UIProcess/WebIconDatabaseClient.cpp > UIProcess/WebInspectorProxy.cpp >+ UIProcess/WebIntentData.cpp > UIProcess/WebKeyValueStorageManagerProxy.cpp > UIProcess/WebLayerTreeRenderer.cpp > UIProcess/WebLoaderClient.cpp >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index c7ac94e..1b3c6b5 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,61 @@ >+2012-06-06 Christophe Dumez <christophe.dumez@intel.com> >+ >+ [WK2] Add implementation for dispatchIntent in WebFrameLoaderClient >+ https://bugs.webkit.org/show_bug.cgi?id=88340 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add implementation for dispatchIntent() in WebFrameLoaderClient. >+ >+ * CMakeLists.txt: >+ * GNUmakefile.list.am: >+ * Shared/API/c/WKBase.h: >+ * Shared/APIClientTraits.h: >+ * Shared/APIObject.h: >+ * Shared/IntentData.cpp: Added. >+ (WebKit): >+ (WebKit::IntentData::encode): >+ (WebKit::IntentData::decode): >+ * Shared/IntentData.h: Added. >+ (CoreIPC): >+ (WebKit): >+ (IntentData): >+ * Target.pri: >+ * UIProcess/API/C/WKAPICast.h: >+ (WebKit): >+ * UIProcess/API/C/WKPage.h: >+ * UIProcess/API/gtk/WebKitLoaderClient.cpp: >+ (attachLoaderClientToView): >+ * UIProcess/WebIntentData.cpp: Added. >+ (WebKit): >+ (WebKit::WebIntentData::WebIntentData): >+ (WebKit::WebIntentData::~WebIntentData): >+ (WebKit::WebIntentData::data): >+ * UIProcess/WebIntentData.h: Added. >+ (WebKit): >+ (WebIntentData): >+ (WebKit::WebIntentData::create): >+ (WebKit::WebIntentData::action): >+ (WebKit::WebIntentData::payloadType): >+ (WebKit::WebIntentData::extras): >+ (WebKit::WebIntentData::suggestions): >+ (WebKit::WebIntentData::type): >+ * UIProcess/WebLoaderClient.cpp: >+ (WebKit): >+ (WebKit::WebLoaderClient::didReceiveIntentForFrame): >+ * UIProcess/WebLoaderClient.h: >+ (WebKit): >+ (WebLoaderClient): >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit): >+ (WebKit::WebPageProxy::didReceiveIntentForFrame): >+ * UIProcess/WebPageProxy.h: >+ (WebKit): >+ (WebPageProxy): >+ * UIProcess/WebPageProxy.messages.in: >+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: >+ (WebKit::WebFrameLoaderClient::dispatchIntent): >+ > 2012-06-06 chandra Shekar Vallala <chandra.vallala@motorola.com> > > [WK2-Gtk]Compilation errors with flag CONTEXT_MENUS=0 >diff --git a/Source/WebKit2/GNUmakefile.list.am b/Source/WebKit2/GNUmakefile.list.am >index e345d92..76614ed 100644 >--- a/Source/WebKit2/GNUmakefile.list.am >+++ b/Source/WebKit2/GNUmakefile.list.am >@@ -360,6 +360,8 @@ webkit2_sources += \ > Source/WebKit2/Shared/ImmutableArray.h \ > Source/WebKit2/Shared/ImmutableDictionary.cpp \ > Source/WebKit2/Shared/ImmutableDictionary.h \ >+ Source/WebKit2/Shared/IntentData.cpp \ >+ Source/WebKit2/Shared/IntentData.h \ > Source/WebKit2/Shared/LayerTreeContext.h \ > Source/WebKit2/Shared/MutableArray.cpp \ > Source/WebKit2/Shared/MutableArray.h \ >@@ -793,6 +795,8 @@ webkit2_sources += \ > Source/WebKit2/UIProcess/WebIconDatabaseClient.h \ > Source/WebKit2/UIProcess/WebInspectorProxy.cpp \ > Source/WebKit2/UIProcess/WebInspectorProxy.h \ >+ Source/WebKit2/UIProcess/WebIntentData.cpp \ >+ Source/WebKit2/UIProcess/WebIntentData.h \ > Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp \ > Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h \ > Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp \ >diff --git a/Source/WebKit2/Shared/API/c/WKBase.h b/Source/WebKit2/Shared/API/c/WKBase.h >index 28e7aed..4776606 100644 >--- a/Source/WebKit2/Shared/API/c/WKBase.h >+++ b/Source/WebKit2/Shared/API/c/WKBase.h >@@ -98,6 +98,7 @@ typedef const struct OpaqueWKGrammarDetail* WKGrammarDetailRef; > typedef const struct OpaqueWKHitTestResult* WKHitTestResultRef; > typedef const struct OpaqueWKIconDatabase* WKIconDatabaseRef; > typedef const struct OpaqueWKInspector* WKInspectorRef; >+typedef const struct OpaqueWKIntentData* WKIntentDataRef; > typedef const struct OpaqueWKKeyValueStorageManager* WKKeyValueStorageManagerRef; > typedef const struct OpaqueWKMediaCacheManager* WKMediaCacheManagerRef; > typedef const struct OpaqueWKNavigationData* WKNavigationDataRef; >diff --git a/Source/WebKit2/Shared/APIClientTraits.h b/Source/WebKit2/Shared/APIClientTraits.h >index 1fa3f36..8c1b164 100644 >--- a/Source/WebKit2/Shared/APIClientTraits.h >+++ b/Source/WebKit2/Shared/APIClientTraits.h >@@ -53,7 +53,7 @@ template<> struct APIClientTraits<WKPageContextMenuClient> { > }; > > template<> struct APIClientTraits<WKPageLoaderClient> { >- static const size_t interfaceSizesByVersion[2]; >+ static const size_t interfaceSizesByVersion[3]; > }; > > template<> struct APIClientTraits<WKPageUIClient> { >diff --git a/Source/WebKit2/Shared/APIObject.h b/Source/WebKit2/Shared/APIObject.h >index 89e8875..96c6726 100644 >--- a/Source/WebKit2/Shared/APIObject.h >+++ b/Source/WebKit2/Shared/APIObject.h >@@ -88,6 +88,7 @@ public: > TypeGrammarDetail, > TypeIconDatabase, > TypeInspector, >+ TypeIntentData, > TypeKeyValueStorageManager, > TypeMediaCacheManager, > TypeNavigationData, >diff --git a/Source/WebKit2/Shared/IntentData.cpp b/Source/WebKit2/Shared/IntentData.cpp >new file mode 100644 >index 0000000..4e85f0c >--- /dev/null >+++ b/Source/WebKit2/Shared/IntentData.cpp >@@ -0,0 +1,74 @@ >+/* >+ * Copyright (C) 2012 Intel Corporation. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * * Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * * Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in >+ * the documentation and/or other materials provided with the >+ * distribution. >+ * * Neither the name of Intel Corporation nor the names of its >+ * contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "IntentData.h" >+ >+#if ENABLE(WEB_INTENTS) >+ >+#include "APIObject.h" >+#include "DataReference.h" >+#include "WebCoreArgumentCoders.h" >+ >+using namespace WebCore; >+ >+namespace WebKit { >+ >+void IntentData::encode(CoreIPC::ArgumentEncoder* encoder) const >+{ >+ encoder->encode(action); >+ encoder->encode(type); >+ encoder->encode(CoreIPC::DataReference(data)); >+ encoder->encode(extras); >+ encoder->encode(suggestions); >+} >+ >+bool IntentData::decode(CoreIPC::ArgumentDecoder* decoder, IntentData& intentData) >+{ >+ if (!decoder->decode(intentData.action)) >+ return false; >+ if (!decoder->decode(intentData.type)) >+ return false; >+ CoreIPC::DataReference data; >+ if (!decoder->decode(data)) >+ return false; >+ intentData.data.append(data.data(), data.size()); >+ if (!decoder->decode(intentData.extras)) >+ return false; >+ if (!decoder->decode(intentData.suggestions)) >+ return false; >+ >+ return true; >+} >+ >+} // namespace WebKit >+ >+#endif // ENABLE(WEB_INTENTS) >+ >diff --git a/Source/WebKit2/Shared/IntentData.h b/Source/WebKit2/Shared/IntentData.h >new file mode 100644 >index 0000000..372b1b8 >--- /dev/null >+++ b/Source/WebKit2/Shared/IntentData.h >@@ -0,0 +1,62 @@ >+/* >+ * Copyright (C) 2012 Intel Corporation. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * * Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * * Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in >+ * the documentation and/or other materials provided with the >+ * distribution. >+ * * Neither the name of Intel Corporation nor the names of its >+ * contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef IntentData_h >+#define IntentData_h >+ >+#if ENABLE(WEB_INTENTS) >+ >+#include "APIObject.h" >+#include "GenericCallback.h" >+#include <wtf/text/WTFString.h> >+ >+namespace CoreIPC { >+class ArgumentDecoder; >+class ArgumentEncoder; >+} >+ >+namespace WebKit { >+ >+struct IntentData { >+ void encode(CoreIPC::ArgumentEncoder*) const; >+ static bool decode(CoreIPC::ArgumentDecoder*, IntentData&); >+ >+ String action; >+ String type; >+ Vector<uint8_t> data; >+ HashMap<String, String> extras; >+ Vector<WebCore::KURL> suggestions; >+}; >+ >+} // namespace WebKit >+ >+#endif // ENABLE(WEB_INTENTS) >+ >+#endif // IntentData_h >diff --git a/Source/WebKit2/Target.pri b/Source/WebKit2/Target.pri >index 3cbe91f..4fc51d0 100644 >--- a/Source/WebKit2/Target.pri >+++ b/Source/WebKit2/Target.pri >@@ -76,6 +76,7 @@ HEADERS += \ > Shared/ImageOptions.h \ > Shared/ImmutableArray.h \ > Shared/ImmutableDictionary.h \ >+ Shared/IntentData.h \ > Shared/LayerTreeContext.h \ > Shared/MutableArray.h \ > Shared/MutableDictionary.h \ >@@ -251,6 +252,7 @@ HEADERS += \ > UIProcess/WebIconDatabase.h \ > UIProcess/WebIconDatabaseClient.h \ > UIProcess/WebInspectorProxy.h \ >+ UIProcess/WebIntentData.h \ > UIProcess/WebKeyValueStorageManagerProxy.h \ > UIProcess/WebLayerTreeRenderer.h \ > UIProcess/WebLoaderClient.h \ >@@ -439,6 +441,7 @@ SOURCES += \ > Shared/FontInfo.cpp \ > Shared/ImmutableArray.cpp \ > Shared/ImmutableDictionary.cpp \ >+ Shared/IntentData.cpp \ > Shared/MutableArray.cpp \ > Shared/MutableDictionary.cpp \ > Shared/OriginAndDatabases.cpp \ >@@ -594,6 +597,7 @@ SOURCES += \ > UIProcess/WebIconDatabase.cpp \ > UIProcess/WebIconDatabaseClient.cpp \ > UIProcess/WebInspectorProxy.cpp \ >+ UIProcess/WebIntentData.cpp \ > UIProcess/WebKeyValueStorageManagerProxy.cpp \ > UIProcess/WebLayerTreeRenderer.cpp \ > UIProcess/WebLoaderClient.cpp \ >diff --git a/Source/WebKit2/UIProcess/API/C/WKAPICast.h b/Source/WebKit2/UIProcess/API/C/WKAPICast.h >index e47b05f..c7c73f0 100644 >--- a/Source/WebKit2/UIProcess/API/C/WKAPICast.h >+++ b/Source/WebKit2/UIProcess/API/C/WKAPICast.h >@@ -70,6 +70,7 @@ class WebGrammarDetail; > class WebHitTestResult; > class WebIconDatabase; > class WebInspectorProxy; >+class WebIntentData; > class WebKeyValueStorageManagerProxy; > class WebMediaCacheManagerProxy; > class WebNavigationData; >@@ -107,6 +108,7 @@ WK_ADD_API_MAPPING(WKGeolocationPositionRef, WebGeolocationPosition) > WK_ADD_API_MAPPING(WKGrammarDetailRef, WebGrammarDetail) > WK_ADD_API_MAPPING(WKHitTestResultRef, WebHitTestResult) > WK_ADD_API_MAPPING(WKIconDatabaseRef, WebIconDatabase) >+WK_ADD_API_MAPPING(WKIntentDataRef, WebIntentData) > WK_ADD_API_MAPPING(WKKeyValueStorageManagerRef, WebKeyValueStorageManagerProxy) > WK_ADD_API_MAPPING(WKMediaCacheManagerRef, WebMediaCacheManagerProxy) > WK_ADD_API_MAPPING(WKNavigationDataRef, WebNavigationData) >diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.h b/Source/WebKit2/UIProcess/API/C/WKPage.h >index 47c076f..d752687 100644 >--- a/Source/WebKit2/UIProcess/API/C/WKPage.h >+++ b/Source/WebKit2/UIProcess/API/C/WKPage.h >@@ -73,6 +73,7 @@ typedef bool (*WKPageShouldGoToBackForwardListItemCallback)(WKPageRef page, WKBa > typedef void (*WKPageDidNewFirstVisuallyNonEmptyLayoutCallback)(WKPageRef page, WKTypeRef userData, const void *clientInfo); > typedef void (*WKPageWillGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, WKTypeRef userData, const void *clientInfo); > typedef void (*WKPagePluginDidFailCallback)(WKPageRef page, WKErrorCode errorCode, WKStringRef mimeType, WKStringRef pluginIdentifier, WKStringRef pluginVersion, const void* clientInfo); >+typedef void (*WKPageDidReceiveIntentForFrameCallback)(WKPageRef page, WKFrameRef frame, WKIntentDataRef intent, const void *clientInfo); > > // Deprecated > typedef void (*WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef mimeType, const void* clientInfo); >@@ -120,10 +121,13 @@ struct WKPageLoaderClient { > > WKPageCallback interactionOccurredWhileProcessUnresponsive; > WKPagePluginDidFailCallback pluginDidFail; >+ >+ // Version 2 >+ WKPageDidReceiveIntentForFrameCallback didReceiveIntentForFrame; > }; > typedef struct WKPageLoaderClient WKPageLoaderClient; > >-enum { kWKPageLoaderClientCurrentVersion = 1 }; >+enum { kWKPageLoaderClientCurrentVersion = 2 }; > > // Policy Client. > typedef void (*WKPageDecidePolicyForNavigationActionCallback)(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo); >diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp >index 158c7fc..60bc5e5 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp >+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp >@@ -149,6 +149,7 @@ void attachLoaderClientToView(WebKitWebView* webView) > 0, // willGoToBackForwardListItem > 0, // interactionOccurredWhileProcessUnresponsive > 0, // pluginDidFail >+ 0, // didReceiveIntentForFrame > }; > WKPageRef wkPage = toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView))); > WKPageSetPageLoaderClient(wkPage, &wkLoaderClient); >diff --git a/Source/WebKit2/UIProcess/WebIntentData.cpp b/Source/WebKit2/UIProcess/WebIntentData.cpp >new file mode 100644 >index 0000000..75a428e >--- /dev/null >+++ b/Source/WebKit2/UIProcess/WebIntentData.cpp >@@ -0,0 +1,56 @@ >+/* >+ * Copyright (C) 2012 Intel Corporation. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * * Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * * Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in >+ * the documentation and/or other materials provided with the >+ * distribution. >+ * * Neither the name of Intel Corporation nor the names of its >+ * contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "WebIntentData.h" >+ >+#if ENABLE(WEB_INTENTS) >+ >+namespace WebKit { >+ >+WebIntentData::WebIntentData(const IntentData& store) >+ : m_store(store) >+{ >+} >+ >+WebIntentData::~WebIntentData() >+{ >+} >+ >+PassRefPtr<WebSerializedScriptValue> WebIntentData::data() const >+{ >+ Vector<uint8_t> dataCopy = m_store.data; >+ return WebSerializedScriptValue::adopt(dataCopy); >+} >+ >+} // namespace WebKit >+ >+#endif // ENABLE(WEB_INTENTS) >+ >diff --git a/Source/WebKit2/UIProcess/WebIntentData.h b/Source/WebKit2/UIProcess/WebIntentData.h >new file mode 100644 >index 0000000..e8a6691 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/WebIntentData.h >@@ -0,0 +1,72 @@ >+/* >+ * Copyright (C) 2012 Intel Corporation. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * * Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * * Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in >+ * the documentation and/or other materials provided with the >+ * distribution. >+ * * Neither the name of Intel Corporation nor the names of its >+ * contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef WebIntentData_h >+#define WebIntentData_h >+ >+#if ENABLE(WEB_INTENTS) >+ >+#include "APIObject.h" >+#include "IntentData.h" >+#include "WebSerializedScriptValue.h" >+#include <wtf/PassRefPtr.h> >+ >+namespace WebKit { >+ >+class WebIntentData : public APIObject { >+public: >+ static const Type APIType = TypeIntentData; >+ >+ static PassRefPtr<WebIntentData> create(const IntentData& store) >+ { >+ return adoptRef(new WebIntentData(store)); >+ } >+ >+ virtual ~WebIntentData(); >+ >+ const String& action() const { return m_store.action; } >+ const String& payloadType() const { return m_store.type; } >+ PassRefPtr<WebSerializedScriptValue> data() const; >+ const HashMap<String, String>& extras() const { return m_store.extras; } >+ const Vector<WebCore::KURL>& suggestions() const { return m_store.suggestions; } >+ >+private: >+ WebIntentData(const IntentData&); >+ >+ virtual Type type() const { return APIType; } >+ >+ IntentData m_store; >+}; >+ >+} // namespace WebKit >+ >+#endif // ENABLE(WEB_INTENTS) >+ >+#endif // WebIntentData_h >diff --git a/Source/WebKit2/UIProcess/WebLoaderClient.cpp b/Source/WebKit2/UIProcess/WebLoaderClient.cpp >index 9275012..94732a2 100644 >--- a/Source/WebKit2/UIProcess/WebLoaderClient.cpp >+++ b/Source/WebKit2/UIProcess/WebLoaderClient.cpp >@@ -27,8 +27,9 @@ > #include "WebLoaderClient.h" > > #include "ImmutableArray.h" >-#include "WebBackForwardListItem.h" > #include "WKAPICast.h" >+#include "WebBackForwardListItem.h" >+#include "WebIntentData.h" > #include <string.h> > > using namespace WebCore; >@@ -163,6 +164,17 @@ void WebLoaderClient::didDetectXSSForFrame(WebPageProxy* page, WebFrameProxy* fr > m_client.didDetectXSSForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.clientInfo); > } > >+#if ENABLE(WEB_INTENTS) >+void WebLoaderClient::didReceiveIntentForFrame(WebPageProxy* page, WebFrameProxy* frame, const IntentData& intentData) >+{ >+ if (!m_client.didReceiveIntentForFrame) >+ return; >+ >+ RefPtr<WebIntentData> webIntentData = WebIntentData::create(intentData); >+ m_client.didReceiveIntentForFrame(toAPI(page), toAPI(frame), toAPI(webIntentData.get()), m_client.clientInfo); >+} >+#endif >+ > bool WebLoaderClient::canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy* page, WebFrameProxy* frame, WebProtectionSpace* protectionSpace) > { > if (!m_client.canAuthenticateAgainstProtectionSpaceInFrame) >diff --git a/Source/WebKit2/UIProcess/WebLoaderClient.h b/Source/WebKit2/UIProcess/WebLoaderClient.h >index 8cf687b..f52d068 100644 >--- a/Source/WebKit2/UIProcess/WebLoaderClient.h >+++ b/Source/WebKit2/UIProcess/WebLoaderClient.h >@@ -47,6 +47,10 @@ class WebFrameProxy; > class WebPageProxy; > class WebProtectionSpace; > >+#if ENABLE(WEB_INTENTS) >+struct IntentData; >+#endif >+ > class WebLoaderClient : public APIClient<WKPageLoaderClient, kWKPageLoaderClientCurrentVersion> { > public: > void didStartProvisionalLoadForFrame(WebPageProxy*, WebFrameProxy*, APIObject*); >@@ -64,6 +68,9 @@ public: > void didDisplayInsecureContentForFrame(WebPageProxy*, WebFrameProxy*, APIObject*); > void didRunInsecureContentForFrame(WebPageProxy*, WebFrameProxy*, APIObject*); > void didDetectXSSForFrame(WebPageProxy*, WebFrameProxy*, APIObject*); >+#if ENABLE(WEB_INTENTS) >+ void didReceiveIntentForFrame(WebPageProxy*, WebFrameProxy*, const IntentData&); >+#endif > > // FIXME: didFirstVisuallyNonEmptyLayoutForFrame and didNewFirstVisuallyNonEmptyLayout should be merged. > // The only reason for both to exist is to experiment with different heuristics for the time being. >diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp >index 2b538e5..a983d86 100644 >--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp >@@ -33,6 +33,7 @@ > #include "DrawingAreaProxy.h" > #include "EventDispatcherMessages.h" > #include "FindIndicator.h" >+#include "IntentData.h" > #include "Logging.h" > #include "MessageID.h" > #include "NativeWebKeyboardEvent.h" >@@ -2136,6 +2137,16 @@ void WebPageProxy::didDetectXSSForFrame(uint64_t frameID, CoreIPC::ArgumentDecod > m_loaderClient.didDetectXSSForFrame(this, frame, userData.get()); > } > >+#if ENABLE(WEB_INTENTS) >+void WebPageProxy::didReceiveIntentForFrame(uint64_t frameID, const IntentData& intentData) >+{ >+ WebFrameProxy* frame = process()->webFrame(frameID); >+ MESSAGE_CHECK(frame); >+ >+ m_loaderClient.didReceiveIntentForFrame(this, frame, intentData); >+} >+#endif >+ > void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value) > { > WebFrameProxy* frame = process()->webFrame(frameID); >diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h >index a37f5ca..f4d3af0 100644 >--- a/Source/WebKit2/UIProcess/WebPageProxy.h >+++ b/Source/WebKit2/UIProcess/WebPageProxy.h >@@ -155,6 +155,10 @@ struct WindowGeometry; > class WebGestureEvent; > #endif > >+#if ENABLE(WEB_INTENTS) >+struct IntentData; >+#endif >+ > typedef GenericCallback<WKStringRef, StringImpl*> StringCallback; > typedef GenericCallback<WKSerializedScriptValueRef, WebSerializedScriptValue*> ScriptValueCallback; > >@@ -704,6 +708,10 @@ private: > void didStartProgress(); > void didChangeProgress(double); > void didFinishProgress(); >+ >+#if ENABLE(WEB_INTENTS) >+ void didReceiveIntentForFrame(uint64_t frameID, const IntentData&); >+#endif > > void decidePolicyForNavigationAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, const WebCore::ResourceRequest&, uint64_t listenerID, CoreIPC::ArgumentDecoder*, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID); > void decidePolicyForNewWindowAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, const WebCore::ResourceRequest&, const String& frameName, uint64_t listenerID, CoreIPC::ArgumentDecoder*); >diff --git a/Source/WebKit2/UIProcess/WebPageProxy.messages.in b/Source/WebKit2/UIProcess/WebPageProxy.messages.in >index de60a71..2570441 100644 >--- a/Source/WebKit2/UIProcess/WebPageProxy.messages.in >+++ b/Source/WebKit2/UIProcess/WebPageProxy.messages.in >@@ -89,6 +89,11 @@ messages -> WebPageProxy { > DecidePolicyForNewWindowAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, WebCore::ResourceRequest request, WTF::String frameName, uint64_t listenerID, WebKit::InjectedBundleUserMessageEncoder userData) > UnableToImplementPolicy(uint64_t frameID, WebCore::ResourceError error, WebKit::InjectedBundleUserMessageEncoder userData) > >+ # Intent messages >+#if ENABLE(WEB_INTENTS) >+ DidReceiveIntentForFrame(uint64_t frameID, WebKit::IntentData intent) >+#endif >+ > # Progress messages > DidChangeProgress(double value) > DidFinishProgress() >diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >index 946a2cd..f1029e8 100644 >--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >@@ -33,6 +33,7 @@ > #include "InjectedBundleDOMWindowExtension.h" > #include "InjectedBundleNavigationAction.h" > #include "InjectedBundleUserMessageCoders.h" >+#include "IntentData.h" > #include "PlatformCertificateInfo.h" > #include "PluginView.h" > #include "StringPairVector.h" >@@ -1538,9 +1539,22 @@ bool WebFrameLoaderClient::shouldCacheResponse(DocumentLoader*, unsigned long id > #endif // PLATFORM(WIN) && USE(CFNETWORK) > > #if ENABLE(WEB_INTENTS) >-void WebFrameLoaderClient::dispatchIntent(PassRefPtr<IntentRequest>) >+void WebFrameLoaderClient::dispatchIntent(PassRefPtr<IntentRequest> request) > { >- notImplemented(); >+ WebPage* webPage = m_frame->page(); >+ if (!webPage) >+ return; >+ >+ IntentData intentData; >+ Intent* coreIntent = request->intent(); >+ ASSERT(coreIntent); >+ intentData.action = coreIntent->action(); >+ intentData.type = coreIntent->type(); >+ intentData.data = coreIntent->data()->data(); >+ intentData.extras = coreIntent->extras(); >+ intentData.suggestions = coreIntent->suggestions(); >+ >+ webPage->send(Messages::WebPageProxy::DidReceiveIntentForFrame(m_frame->frameID(), intentData)); > } > #endif > >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 4cac9ba..29c54ab 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,14 @@ >+2012-06-07 Christophe Dumez <christophe.dumez@intel.com> >+ >+ [WK2] Add implementation for dispatchIntent in WebFrameLoaderClient >+ https://bugs.webkit.org/show_bug.cgi?id=88340 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * MiniBrowser/mac/BrowserWindowController.m: >+ (-[BrowserWindowController awakeFromNib]): Update initialization of >+ WKPageLoaderClient. >+ > 2012-06-06 Mariusz Grzegorczyk <mariusz.g@samsung.com> > > [EFL][WK2] Compile webkit1 and webkit2 by default. >diff --git a/Tools/MiniBrowser/mac/BrowserWindowController.m b/Tools/MiniBrowser/mac/BrowserWindowController.m >index 131bfa4..5c09f27 100644 >--- a/Tools/MiniBrowser/mac/BrowserWindowController.m >+++ b/Tools/MiniBrowser/mac/BrowserWindowController.m >@@ -612,6 +612,7 @@ - (void)awakeFromNib > 0, // willGoToBackForwardListItem > 0, // interactionOccurredWhileProcessUnresponsive > 0, // pluginDidFail >+ 0, // didReceiveIntentForFrame > }; > WKPageSetPageLoaderClient(_webView.pageRef, &loadClient); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 88340
:
145826
|
145831
|
145832
|
145839
|
145944
|
146213
|
147273
|
147281
|
147349
|
147403