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
89275_wkintent.patch (text/plain), 9.95 KB, created by
Chris Dumez
on 2012-06-17 23:56:11 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2012-06-17 23:56:11 PDT
Size:
9.95 KB
patch
obsolete
>diff --git a/Source/WebKit2/CMakeLists.txt b/Source/WebKit2/CMakeLists.txt >index a70e720..b88c3f9 100644 >--- a/Source/WebKit2/CMakeLists.txt >+++ b/Source/WebKit2/CMakeLists.txt >@@ -278,6 +278,7 @@ SET(WebKit2_SOURCES > UIProcess/API/C/WKHitTestResult.cpp > UIProcess/API/C/WKIconDatabase.cpp > UIProcess/API/C/WKInspector.cpp >+ UIProcess/API/C/WKIntentData.cpp > UIProcess/API/C/WKKeyValueStorageManager.cpp > UIProcess/API/C/WKMediaCacheManager.cpp > UIProcess/API/C/WKNavigationData.cpp >diff --git a/Source/WebKit2/GNUmakefile.list.am b/Source/WebKit2/GNUmakefile.list.am >index 3523918..3e527b6 100644 >--- a/Source/WebKit2/GNUmakefile.list.am >+++ b/Source/WebKit2/GNUmakefile.list.am >@@ -63,6 +63,7 @@ webkit2_h_api += \ > $(WebKit2)/UIProcess/API/C/WKGrammarDetail.h \ > $(WebKit2)/UIProcess/API/C/WKHitTestResult.h \ > $(WebKit2)/UIProcess/API/C/WKInspector.h \ >+ $(WebKit2)/UIProcess/API/C/WKIntentData.h \ > $(WebKit2)/UIProcess/API/C/WKKeyValueStorageManager.h \ > $(WebKit2)/UIProcess/API/C/WKMediaCacheManager.h \ > $(WebKit2)/UIProcess/API/C/WKNativeEvent.h \ >@@ -532,6 +533,8 @@ webkit2_sources += \ > Source/WebKit2/UIProcess/API/C/WKIconDatabase.h \ > Source/WebKit2/UIProcess/API/C/WKInspector.cpp \ > Source/WebKit2/UIProcess/API/C/WKInspector.h \ >+ Source/WebKit2/UIProcess/API/C/WKIntentData.cpp \ >+ Source/WebKit2/UIProcess/API/C/WKIntentData.h \ > Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp \ > Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.h \ > Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp \ >diff --git a/Source/WebKit2/Target.pri b/Source/WebKit2/Target.pri >index 9e5bc4e..960b946 100644 >--- a/Source/WebKit2/Target.pri >+++ b/Source/WebKit2/Target.pri >@@ -161,6 +161,7 @@ HEADERS += \ > UIProcess/API/C/WKHitTestResult.h \ > UIProcess/API/C/WKIconDatabase.h \ > UIProcess/API/C/WKInspector.h \ >+ UIProcess/API/C/WKIntentData.h \ > UIProcess/API/C/WKOpenPanelParameters.h \ > UIProcess/API/C/WKOpenPanelResultListener.h \ > UIProcess/API/C/WKNavigationData.h \ >@@ -517,6 +518,7 @@ SOURCES += \ > UIProcess/API/C/WKHitTestResult.cpp \ > UIProcess/API/C/WKIconDatabase.cpp \ > UIProcess/API/C/WKInspector.cpp \ >+ UIProcess/API/C/WKIntentData.cpp \ > UIProcess/API/C/WKNotification.cpp \ > UIProcess/API/C/WKNotificationManager.cpp \ > UIProcess/API/C/WKNotificationPermissionRequest.cpp \ >diff --git a/Source/WebKit2/UIProcess/API/C/WKIntentData.cpp b/Source/WebKit2/UIProcess/API/C/WKIntentData.cpp >new file mode 100644 >index 0000000..a42f530 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/C/WKIntentData.cpp >@@ -0,0 +1,100 @@ >+/* >+ * 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 "WKIntentData.h" >+ >+#include "ImmutableArray.h" >+#include "ImmutableDictionary.h" >+#include "WKAPICast.h" >+ >+#if ENABLE(WEB_INTENTS) >+#include "WebIntentData.h" >+#endif >+ >+using namespace WebKit; >+ >+WKTypeID WKIntentDataGetTypeID() >+{ >+#if ENABLE(WEB_INTENTS) >+ return toAPI(WebIntentData::APIType); >+#else >+ return 0; >+#endif >+} >+ >+WKStringRef WKIntentDataCopyAction(WKIntentDataRef intentRef) >+{ >+#if ENABLE(WEB_INTENTS) >+ return toCopiedAPI(toImpl(intentRef)->action()); >+#else >+ return 0; >+#endif >+} >+ >+WKStringRef WKIntentDataCopyType(WKIntentDataRef intentRef) >+{ >+#if ENABLE(WEB_INTENTS) >+ return toCopiedAPI(toImpl(intentRef)->payloadType()); >+#else >+ return 0; >+#endif >+} >+ >+WKURLRef WKIntentDataCopyService(WKIntentDataRef intentRef) >+{ >+#if ENABLE(WEB_INTENTS) >+ return toCopiedURLAPI(toImpl(intentRef)->service()); >+#else >+ return 0; >+#endif >+} >+ >+WKArrayRef WKIntentDataCopySuggestions(WKIntentDataRef intentRef) >+{ >+#if ENABLE(WEB_INTENTS) >+ return toAPI(toImpl(intentRef)->suggestions().leakRef()); >+#else >+ return 0; >+#endif >+} >+ >+WKStringRef WKIntentDataCopyExtra(WKIntentDataRef intentRef, WKStringRef key) >+{ >+#if ENABLE(WEB_INTENTS) >+ return toCopiedAPI(toImpl(intentRef)->extra(toWTFString(key))); >+#else >+ return 0; >+#endif >+} >+ >+WKDictionaryRef WKIntentDataCopyExtras(WKIntentDataRef intentRef) >+{ >+#if ENABLE(WEB_INTENTS) >+ return toAPI(toImpl(intentRef)->extras().leakRef()); >+#else >+ return 0; >+#endif >+} >diff --git a/Source/WebKit2/UIProcess/API/C/WKIntentData.h b/Source/WebKit2/UIProcess/API/C/WKIntentData.h >new file mode 100644 >index 0000000..030555b >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/C/WKIntentData.h >@@ -0,0 +1,47 @@ >+/* >+ * 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 WKIntentData_h >+#define WKIntentData_h >+ >+#include <WebKit2/WKBase.h> >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+WK_EXPORT WKTypeID WKIntentDataGetTypeID(); >+WK_EXPORT WKStringRef WKIntentDataCopyAction(WKIntentDataRef intentRef); >+WK_EXPORT WKStringRef WKIntentDataCopyType(WKIntentDataRef intentRef); >+WK_EXPORT WKURLRef WKIntentDataCopyService(WKIntentDataRef intentRef); >+WK_EXPORT WKArrayRef WKIntentDataCopySuggestions(WKIntentDataRef intentRef); >+WK_EXPORT WKStringRef WKIntentDataCopyExtra(WKIntentDataRef intentRef, WKStringRef key); >+WK_EXPORT WKDictionaryRef WKIntentDataCopyExtras(WKIntentDataRef intentRef); >+ >+#ifdef __cplusplus >+} >+#endif >+ >+#endif // WKIntentData_h >diff --git a/Source/WebKit2/UIProcess/WebIntentData.cpp b/Source/WebKit2/UIProcess/WebIntentData.cpp >index 37695a4..96128db 100644 >--- a/Source/WebKit2/UIProcess/WebIntentData.cpp >+++ b/Source/WebKit2/UIProcess/WebIntentData.cpp >@@ -28,6 +28,11 @@ > > #if ENABLE(WEB_INTENTS) > >+#include "ImmutableArray.h" >+#include "ImmutableDictionary.h" >+#include "WebString.h" >+#include "WebURL.h" >+ > namespace WebKit { > > WebIntentData::WebIntentData(const IntentData& store) >@@ -41,6 +46,29 @@ PassRefPtr<WebSerializedScriptValue> WebIntentData::data() const > return WebSerializedScriptValue::adopt(dataCopy); > } > >+PassRefPtr<ImmutableArray> WebIntentData::suggestions() const >+{ >+ const size_t numSuggestions = m_store.suggestions.size(); >+ Vector<RefPtr<APIObject> > wkSuggestions(numSuggestions); >+ for (unsigned i = 0; i < numSuggestions; ++i) >+ wkSuggestions[i] = WebURL::create(m_store.suggestions[i]); >+ return ImmutableArray::adopt(wkSuggestions); >+} >+ >+String WebIntentData::extra(const String& key) const >+{ >+ return m_store.extras.get(key); >+} >+ >+PassRefPtr<ImmutableDictionary> WebIntentData::extras() const >+{ >+ ImmutableDictionary::MapType wkExtras; >+ HashMap<String, String>::const_iterator end = m_store.extras.end(); >+ for (HashMap<String, String>::const_iterator it = m_store.extras.begin(); it != end; ++it) >+ wkExtras.set(it->first, WebString::create(it->second)); >+ return ImmutableDictionary::adopt(wkExtras); >+} >+ > } // namespace WebKit > > #endif // ENABLE(WEB_INTENTS) >diff --git a/Source/WebKit2/UIProcess/WebIntentData.h b/Source/WebKit2/UIProcess/WebIntentData.h >index 3caef50..fcdc77d 100644 >--- a/Source/WebKit2/UIProcess/WebIntentData.h >+++ b/Source/WebKit2/UIProcess/WebIntentData.h >@@ -50,8 +50,9 @@ public: > const String& payloadType() const { return m_store.type; } > const WebCore::KURL& service() const { return m_store.service; } > PassRefPtr<WebSerializedScriptValue> data() const; >- const HashMap<String, String>& extras() const { return m_store.extras; } >- const Vector<WebCore::KURL>& suggestions() const { return m_store.suggestions; } >+ String extra(const String& key) const; >+ PassRefPtr<ImmutableDictionary> extras() const; >+ PassRefPtr<ImmutableArray> suggestions() const; > > private: > WebIntentData(const IntentData&);
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 89275
:
147971
|
147975
|
147979
|
147980
|
147986
|
147987
|
148061
|
148063
|
148828