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), 31.18 KB, created by
Chris Dumez
on 2012-06-05 10:51:33 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2012-06-05 10:51:33 PDT
Size:
31.18 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 38ad555..c3401cf 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,64 @@ >+2012-06-05 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 simple implementation for dispatchIntent in WebFrameLoaderClient. >+ >+ * CMakeLists.txt: >+ * GNUmakefile.list.am: >+ * Shared/API/c/WKBase.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): >+ * UIProcess/WebIntentData.h: Added. >+ (WebKit): >+ (WebIntentData): >+ (WebKit::WebIntentData::create): >+ (WebKit::WebIntentData::title): >+ (WebKit::WebIntentData::mimeType): >+ (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/InjectedBundle/API/c/WKBundlePage.h: >+ * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: >+ (WebKit): >+ (WebKit::InjectedBundlePageLoaderClient::didReceiveIntentForFrame): >+ * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: >+ (WebKit): >+ (InjectedBundlePageLoaderClient): >+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: >+ (WebKit::WebFrameLoaderClient::dispatchIntent): >+ > 2012-06-05 Dongwoo Im <dw.im@samsung.com> > > Add 'isProtocolHandlerRegistered' and 'unregisterProtocolHandler'. >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/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..4e57ec9 >--- /dev/null >+++ b/Source/WebKit2/Shared/IntentData.cpp >@@ -0,0 +1,57 @@ >+/* >+ * 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: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. 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. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "WebCoreArgumentCoders.h" >+ >+using namespace WebCore; >+ >+namespace WebKit { >+ >+void IntentData::encode(CoreIPC::ArgumentEncoder* encoder) const >+{ >+ encoder->encode(action); >+ encoder->encode(type); >+} >+ >+bool IntentData::decode(CoreIPC::ArgumentDecoder* decoder, IntentData& intentData) >+{ >+ if (!decoder->decode(intentData.action)) >+ return false; >+ if (!decoder->decode(intentData.type)) >+ 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..d84e3ad >--- /dev/null >+++ b/Source/WebKit2/Shared/IntentData.h >@@ -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: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. 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. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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&); >+ >+ // FIXME: We should be sending more information across the wire than just the action, >+ // and type. >+ String action; >+ String type; >+}; >+ >+} // namespace WebKit >+ >+#endif // ENABLE(WEB_INTENTS) >+ >+#endif // IntentData_h >diff --git a/Source/WebKit2/Target.pri b/Source/WebKit2/Target.pri >index 216ab5b..c804690 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 \ >@@ -438,6 +440,7 @@ SOURCES += \ > Shared/FontInfo.cpp \ > Shared/ImmutableArray.cpp \ > Shared/ImmutableDictionary.cpp \ >+ Shared/IntentData.cpp \ > Shared/MutableArray.cpp \ > Shared/MutableDictionary.cpp \ > Shared/OriginAndDatabases.cpp \ >@@ -593,6 +596,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..f37bebd 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, WKTypeRef userData, const void *clientInfo); > > // Deprecated > typedef void (*WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef mimeType, const void* clientInfo); >@@ -120,6 +121,7 @@ struct WKPageLoaderClient { > > WKPageCallback interactionOccurredWhileProcessUnresponsive; > WKPagePluginDidFailCallback pluginDidFail; >+ WKPageDidReceiveIntentForFrameCallback didReceiveIntentForFrame; > }; > typedef struct WKPageLoaderClient WKPageLoaderClient; > >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..dfdd6b3 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/WebIntentData.cpp >@@ -0,0 +1,45 @@ >+/* >+ * 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: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. 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. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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() >+{ >+} >+ >+} // 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..48cbc10 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/WebIntentData.h >@@ -0,0 +1,63 @@ >+/* >+ * 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: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. 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. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 <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(); >+ >+ String title() const { return m_store.action; } >+ String mimeType() const { return m_store.type; } >+ >+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..0c2baac 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, APIObject* userData) >+{ >+ if (!m_client.didReceiveIntentForFrame) >+ return; >+ >+ RefPtr<WebIntentData> webIntentData = WebIntentData::create(intentData); >+ m_client.didReceiveIntentForFrame(toAPI(page), toAPI(frame), toAPI(webIntentData.get()), toAPI(userData), 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..be9b463 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&, APIObject*); >+#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..10f139c 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,21 @@ 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, CoreIPC::ArgumentDecoder* arguments) >+{ >+ RefPtr<APIObject> userData; >+ WebContextUserMessageDecoder messageDecoder(userData, m_process->context()); >+ if (!arguments->decode(messageDecoder)) >+ return; >+ >+ WebFrameProxy* frame = process()->webFrame(frameID); >+ MESSAGE_CHECK(frame); >+ >+ m_loaderClient.didReceiveIntentForFrame(this, frame, intentData, userData.get()); >+} >+#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..a6a3e0a 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&, CoreIPC::ArgumentDecoder*); >+#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..bfc2b91 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, WebKit::InjectedBundleUserMessageEncoder userData) >+#endif >+ > # Progress messages > DidChangeProgress(double value) > DidFinishProgress() >diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h >index 153174b..4d6072d 100644 >--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h >+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h >@@ -109,6 +109,7 @@ typedef void (*WKBundlePageWillDisconnectDOMWindowExtensionFromGlobalObjectCallb > typedef void (*WKBundlePageDidReconnectDOMWindowExtensionToGlobalObjectCallback)(WKBundlePageRef page, WKBundleDOMWindowExtensionRef, const void* clientInfo); > typedef void (*WKBundlePageWillDestroyGlobalObjectForDOMWindowExtensionCallback)(WKBundlePageRef page, WKBundleDOMWindowExtensionRef, const void* clientInfo); > typedef bool (*WKBundlePageShouldForceUniversalAccessFromLocalURLCallback)(WKBundlePageRef, WKStringRef url, const void* clientInfo); >+typedef void (*WKBundlePageDidReceiveIntentForFrameCallback)(WKBundlePageRef, WKBundleFrameRef frame, WKIntentDataRef intentData, WKTypeRef* userData, const void* clientInfo); > > struct WKBundlePageLoaderClient { > int version; >@@ -147,6 +148,7 @@ struct WKBundlePageLoaderClient { > // Version 2 > WKBundlePageDidFinishProgressCallback didFinishProgress; > WKBundlePageShouldForceUniversalAccessFromLocalURLCallback shouldForceUniversalAccessFromLocalURL; >+ WKBundlePageDidReceiveIntentForFrameCallback didReceiveIntentForFrame; > }; > typedef struct WKBundlePageLoaderClient WKBundlePageLoaderClient; > >diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp >index 2963dc2..a2fb514 100644 >--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp >+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp >@@ -31,6 +31,7 @@ > #include "WKAPICast.h" > #include "WKBundleAPICast.h" > #include "WebError.h" >+#include "WebIntentData.h" > #include <wtf/text/WTFString.h> > > using namespace WebCore; >@@ -187,6 +188,19 @@ void InjectedBundlePageLoaderClient::didDetectXSSForFrame(WebPage* page, WebFram > userData = adoptRef(toImpl(userDataToPass)); > } > >+#if ENABLE(WEB_INTENTS) >+void InjectedBundlePageLoaderClient::didReceiveIntentForFrame(WebPage* page, WebFrame* frame, const IntentData& intentData, RefPtr<APIObject>& userData) >+{ >+ if (!m_client.didReceiveIntentForFrame) >+ return; >+ >+ WKTypeRef userDataToPass = 0; >+ RefPtr<WebIntentData> webIntentData = WebIntentData::create(intentData); >+ m_client.didReceiveIntentForFrame(toAPI(page), toAPI(frame), toAPI(webIntentData.get()), &userDataToPass, m_client.clientInfo); >+ userData = adoptRef(toImpl(userDataToPass)); >+} >+#endif >+ > void InjectedBundlePageLoaderClient::didFirstLayoutForFrame(WebPage* page, WebFrame* frame, RefPtr<APIObject>& userData) > { > if (!m_client.didFirstLayoutForFrame) >diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h >index 299f19d..ece7aa6 100644 >--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h >+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h >@@ -47,6 +47,10 @@ class InjectedBundleBackForwardListItem; > class WebPage; > class WebFrame; > >+#if ENABLE(WEB_INTENTS) >+struct IntentData; >+#endif >+ > class InjectedBundlePageLoaderClient : public APIClient<WKBundlePageLoaderClient, kWKBundlePageLoaderClientCurrentVersion> { > public: > bool shouldGoToBackForwardListItem(WebPage*, InjectedBundleBackForwardListItem*, RefPtr<APIObject>& userData); >@@ -65,6 +69,10 @@ public: > void didRunInsecureContentForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData); > void didDetectXSSForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData); > >+#if ENABLE(WEB_INTENTS) >+ void didReceiveIntentForFrame(WebPage*, WebFrame*, const IntentData&, RefPtr<APIObject>& userData); >+#endif >+ > void didFirstLayoutForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData); > void didFirstVisuallyNonEmptyLayoutForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData); > void didLayoutForFrame(WebPage*, WebFrame*); >diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >index 946a2cd..b13cb1d 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,23 @@ 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; >+ >+ RefPtr<APIObject> userData; >+ >+ IntentData intentData; >+ Intent* coreIntent = request->intent(); >+ ASSERT(coreIntent); >+ intentData.action = coreIntent->action(); >+ intentData.type = coreIntent->type(); >+ >+ webPage->injectedBundleLoaderClient().didReceiveIntentForFrame(webPage, m_frame, intentData, userData); >+ >+ webPage->send(Messages::WebPageProxy::DidReceiveIntentForFrame(m_frame->frameID(), intentData, InjectedBundleUserMessageEncoder(userData.get()))); > } > #endif > >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index bacb1fb..90c0597 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,13 @@ >+2012-06-05 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]): Fix initialization of WKPageLoaderClient. >+ > 2012-06-05 Dongwoo Im <dw.im@samsung.com> > > Add 'isProtocolHandlerRegistered' and 'unregisterProtocolHandler'. >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