Diff
Modified: trunk/Source/WebKit2/CMakeLists.txt (122269 => 122270)
--- trunk/Source/WebKit2/CMakeLists.txt 2012-07-10 22:11:54 UTC (rev 122269)
+++ trunk/Source/WebKit2/CMakeLists.txt 2012-07-10 22:14:34 UTC (rev 122270)
@@ -266,6 +266,8 @@
UIProcess/WebTextChecker.cpp
UIProcess/WebTextCheckerClient.cpp
UIProcess/WebUIClient.cpp
+ UIProcess/WebVibrationProvider.cpp
+ UIProcess/WebVibrationProxy.cpp
UIProcess/API/C/WKApplicationCacheManager.cpp
UIProcess/API/C/WKAuthenticationChallenge.cpp
@@ -307,6 +309,7 @@
UIProcess/API/C/WKProtectionSpace.cpp
UIProcess/API/C/WKResourceCacheManager.cpp
UIProcess/API/C/WKTextChecker.cpp
+ UIProcess/API/C/WKVibration.cpp
UIProcess/Authentication/AuthenticationChallengeProxy.cpp
UIProcess/Authentication/AuthenticationDecisionListener.cpp
@@ -433,6 +436,7 @@
WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
WebProcess/WebCoreSupport/WebPopupMenu.cpp
WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp
+ WebProcess/WebCoreSupport/WebVibrationClient.cpp
WebProcess/WebPage/DecoderAdapter.cpp
WebProcess/WebPage/DrawingArea.cpp
@@ -479,6 +483,7 @@
UIProcess/WebPageProxy.messages.in
UIProcess/WebProcessProxy.messages.in
UIProcess/WebResourceCacheManagerProxy.messages.in
+ UIProcess/WebVibrationProxy.messages.in
UIProcess/Downloads/DownloadProxy.messages.in
Modified: trunk/Source/WebKit2/ChangeLog (122269 => 122270)
--- trunk/Source/WebKit2/ChangeLog 2012-07-10 22:11:54 UTC (rev 122269)
+++ trunk/Source/WebKit2/ChangeLog 2012-07-10 22:14:34 UTC (rev 122270)
@@ -1,3 +1,60 @@
+2012-07-10 Sudarsana Nagineni <[email protected]>
+
+ [WK2] Add Vibration API support for WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=90058
+
+ Reviewed by Anders Carlsson.
+
+ Add support for Vibration API to WebKit2.
+
+ * CMakeLists.txt:
+ * DerivedSources.pri:
+ * GNUmakefile.list.am:
+ * Platform/CoreIPC/MessageID.h:
+ * Shared/API/c/WKBase.h:
+ * Shared/APIObject.h:
+ * Target.pri:
+ * UIProcess/API/C/WKAPICast.h:
+ (WebKit):
+ * UIProcess/API/C/WKVibration.cpp: Added.
+ (WKVibrationGetTypeID):
+ (WKVibrationSetProvider):
+ * UIProcess/API/C/WKVibration.h: Added.
+ * UIProcess/WebVibrationProvider.cpp: Added.
+ (WebKit):
+ (WebKit::WebVibrationProvider::vibrate):
+ (WebKit::WebVibrationProvider::cancelVibration):
+ * UIProcess/WebVibrationProvider.h: Added.
+ (WebKit):
+ (WebVibrationProvider):
+ * UIProcess/WebVibrationProxy.cpp: Added.
+ (WebKit):
+ (WebKit::WebVibrationProxy::create):
+ (WebKit::WebVibrationProxy::WebVibrationProxy):
+ (WebKit::WebVibrationProxy::~WebVibrationProxy):
+ (WebKit::WebVibrationProxy::invalidate):
+ (WebKit::WebVibrationProxy::initializeProvider):
+ (WebKit::WebVibrationProxy::didReceiveMessage):
+ (WebKit::WebVibrationProxy::vibrate):
+ (WebKit::WebVibrationProxy::cancelVibration):
+ * UIProcess/WebVibrationProxy.h: Added.
+ (CoreIPC):
+ (WebKit):
+ (WebVibrationProxy):
+ (WebKit::WebVibrationProxy::clearContext):
+ (WebKit::WebVibrationProxy::type):
+ * UIProcess/WebVibrationProxy.messages.in: Added.
+ * WebProcess/WebCoreSupport/WebVibrationClient.cpp: Added.
+ (WebKit):
+ (WebKit::WebVibrationClient::vibrate):
+ (WebKit::WebVibrationClient::cancelVibration):
+ (WebKit::WebVibrationClient::vibrationDestroyed):
+ * WebProcess/WebCoreSupport/WebVibrationClient.h: Added.
+ (WebKit):
+ (WebVibrationClient):
+ (WebKit::WebVibrationClient::WebVibrationClient):
+ (WebKit::WebVibrationClient::~WebVibrationClient):
+
2012-07-10 Carlos Garcia Campos <[email protected]>
[GTK] Add API to clear the cache to WebKit2 GTK+
Modified: trunk/Source/WebKit2/DerivedSources.pri (122269 => 122270)
--- trunk/Source/WebKit2/DerivedSources.pri 2012-07-10 22:11:54 UTC (rev 122269)
+++ trunk/Source/WebKit2/DerivedSources.pri 2012-07-10 22:14:34 UTC (rev 122270)
@@ -103,6 +103,7 @@
WebProcessProxy.messages.in \
WebResourceCacheManager.messages.in \
WebResourceCacheManagerProxy.messages.in \
+ WebVibrationProxy.messages.in \
NPObjectMessageReceiver.messages.in
SCRIPTS = \
Modified: trunk/Source/WebKit2/GNUmakefile.list.am (122269 => 122270)
--- trunk/Source/WebKit2/GNUmakefile.list.am 2012-07-10 22:11:54 UTC (rev 122269)
+++ trunk/Source/WebKit2/GNUmakefile.list.am 2012-07-10 22:14:34 UTC (rev 122270)
@@ -88,6 +88,7 @@
$(WebKit2)/UIProcess/API/C/WKProtectionSpaceTypes.h \
$(WebKit2)/UIProcess/API/C/WKResourceCacheManager.h \
$(WebKit2)/UIProcess/API/C/WKTextChecker.h \
+ $(WebKit2)/UIProcess/API/C/WKVibration.cpp \
$(WebKit2)/UIProcess/API/cpp/WKRetainPtr.h
webkit2gtk_h_api += \
@@ -218,7 +219,9 @@
DerivedSources/WebKit2/WebSoupRequestManagerMessageReceiver.cpp \
DerivedSources/WebKit2/WebSoupRequestManagerMessages.h \
DerivedSources/WebKit2/WebSoupRequestManagerProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebSoupRequestManagerProxyMessages.h
+ DerivedSources/WebKit2/WebSoupRequestManagerProxyMessages.h \
+ DerivedSources/WebKit2/WebVibrationProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebVibrationProxyMessages.h
webkit2gtk_built_sources += \
DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitEnumTypes.cpp \
@@ -596,6 +599,8 @@
Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp \
Source/WebKit2/UIProcess/API/C/WKTextChecker.h \
Source/WebKit2/UIProcess/API/C/WKTextChecker.cpp \
+ Source/WebKit2/UIProcess/API/C/WKVibration.cpp \
+ Source/WebKit2/UIProcess/API/C/WKVibration.h \
Source/WebKit2/UIProcess/API/cpp/WKRetainPtr.h \
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h \
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp \
@@ -891,6 +896,10 @@
Source/WebKit2/UIProcess/WebTextCheckerClient.h \
Source/WebKit2/UIProcess/WebUIClient.cpp \
Source/WebKit2/UIProcess/WebUIClient.h \
+ Source/WebKit2/UIProcess/WebVibrationProvider.cpp \
+ Source/WebKit2/UIProcess/WebVibrationProvider.h \
+ Source/WebKit2/UIProcess/WebVibrationProxy.cpp \
+ Source/WebKit2/UIProcess/WebVibrationProxy.h \
Source/WebKit2/WebKit2Prefix.h \
Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.h \
Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp \
@@ -1081,6 +1090,8 @@
Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.h \
Source/WebKit2/WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp \
Source/WebKit2/WebProcess/WebCoreSupport/WebSearchPopupMenu.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.h \
Source/WebKit2/WebProcess/WebPage/DecoderAdapter.cpp \
Source/WebKit2/WebProcess/WebPage/DecoderAdapter.h \
Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp \
Modified: trunk/Source/WebKit2/Platform/CoreIPC/MessageID.h (122269 => 122270)
--- trunk/Source/WebKit2/Platform/CoreIPC/MessageID.h 2012-07-10 22:11:54 UTC (rev 122269)
+++ trunk/Source/WebKit2/Platform/CoreIPC/MessageID.h 2012-07-10 22:14:34 UTC (rev 122270)
@@ -83,6 +83,7 @@
#if USE(SOUP)
MessageClassWebSoupRequestManagerProxy,
#endif
+ MessageClassWebVibrationProxy,
// Messages sent to a WebConnection
MessageClassWebConnectionLegacy,
Modified: trunk/Source/WebKit2/Shared/API/c/WKBase.h (122269 => 122270)
--- trunk/Source/WebKit2/Shared/API/c/WKBase.h 2012-07-10 22:11:54 UTC (rev 122269)
+++ trunk/Source/WebKit2/Shared/API/c/WKBase.h 2012-07-10 22:14:34 UTC (rev 122270)
@@ -123,6 +123,7 @@
typedef const struct OpaqueWKPreferences* WKPreferencesRef;
typedef const struct OpaqueWKProtectionSpace* WKProtectionSpaceRef;
typedef const struct OpaqueWKTextChecker* WKTextCheckerRef;
+typedef const struct OpaqueWKVibration* WKVibrationRef;
/* WebKit2 Bundle types */
Modified: trunk/Source/WebKit2/Shared/APIObject.h (122269 => 122270)
--- trunk/Source/WebKit2/Shared/APIObject.h 2012-07-10 22:11:54 UTC (rev 122269)
+++ trunk/Source/WebKit2/Shared/APIObject.h 2012-07-10 22:14:34 UTC (rev 122270)
@@ -107,6 +107,7 @@
TypePluginSiteDataManager,
TypePreferences,
TypeTextChecker,
+ TypeVibration,
// Bundle types
TypeBundle,
Modified: trunk/Source/WebKit2/Target.pri (122269 => 122270)
--- trunk/Source/WebKit2/Target.pri 2012-07-10 22:11:54 UTC (rev 122269)
+++ trunk/Source/WebKit2/Target.pri 2012-07-10 22:14:34 UTC (rev 122270)
@@ -180,6 +180,7 @@
UIProcess/API/C/WKPreferencesPrivate.h \
UIProcess/API/C/WKProtectionSpace.h \
UIProcess/API/C/WKProtectionSpaceTypes.h \
+ UIProcess/API/C/WKVibration.h \
UIProcess/API/C/WebKit2.h \
UIProcess/API/C/qt/WKNativeEvent.h \
UIProcess/API/cpp/WKRetainPtr.h \
@@ -280,6 +281,8 @@
UIProcess/WebResourceCacheManagerProxy.h \
UIProcess/WebResourceLoadClient.h \
UIProcess/WebUIClient.h \
+ UIProcess/WebVibrationProvider.h \
+ UIProcess/WebVibrationProxy.h \
UIProcess/qt/QtWebContext.h \
UIProcess/qt/QtWebPageEventHandler.h \
UIProcess/qt/QtGestureRecognizer.h \
@@ -372,6 +375,7 @@
WebProcess/WebCoreSupport/WebPlatformStrategies.h \
WebProcess/WebCoreSupport/WebPopupMenu.h \
WebProcess/WebCoreSupport/WebSearchPopupMenu.h \
+ WebProcess/WebCoreSupport/WebVibrationClient.h \
WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h \
WebProcess/WebPage/DrawingArea.h \
WebProcess/WebPage/DrawingAreaImpl.h \
@@ -550,6 +554,7 @@
UIProcess/API/C/WKPreferences.cpp \
UIProcess/API/C/WKProtectionSpace.cpp \
UIProcess/API/C/WKResourceCacheManager.cpp \
+ UIProcess/API/C/WKVibration.cpp \
UIProcess/API/cpp/qt/WKStringQt.cpp \
UIProcess/API/cpp/qt/WKURLQt.cpp \
UIProcess/API/qt/qwebdownloaditem.cpp \
@@ -645,6 +650,8 @@
UIProcess/WebResourceCacheManagerProxy.cpp \
UIProcess/WebResourceLoadClient.cpp \
UIProcess/WebUIClient.cpp \
+ UIProcess/WebVibrationProvider.cpp \
+ UIProcess/WebVibrationProxy.cpp \
UIProcess/qt/QtWebContext.cpp \
UIProcess/qt/QtWebPageEventHandler.cpp \
UIProcess/qt/QtGestureRecognizer.cpp \
@@ -754,6 +761,7 @@
WebProcess/WebCoreSupport/WebPlatformStrategies.cpp \
WebProcess/WebCoreSupport/WebPopupMenu.cpp \
WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp \
+ WebProcess/WebCoreSupport/WebVibrationClient.cpp \
WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp \
WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp \
WebProcess/WebCoreSupport/qt/WebDragClientQt.cpp \
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h (122269 => 122270)
--- trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h 2012-07-10 22:11:54 UTC (rev 122269)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h 2012-07-10 22:14:34 UTC (rev 122270)
@@ -92,6 +92,7 @@
class WebRenderLayer;
class WebRenderObject;
class WebTextChecker;
+class WebVibrationProxy;
WK_ADD_API_MAPPING(WKApplicationCacheManagerRef, WebApplicationCacheManagerProxy)
WK_ADD_API_MAPPING(WKAuthenticationChallengeRef, AuthenticationChallengeProxy)
@@ -136,6 +137,7 @@
WK_ADD_API_MAPPING(WKRenderLayerRef, WebRenderLayer)
WK_ADD_API_MAPPING(WKRenderObjectRef, WebRenderObject)
WK_ADD_API_MAPPING(WKTextCheckerRef, WebTextChecker)
+WK_ADD_API_MAPPING(WKVibrationRef, WebVibrationProxy)
#if ENABLE(INSPECTOR)
WK_ADD_API_MAPPING(WKInspectorRef, WebInspectorProxy)
Added: trunk/Source/WebKit2/UIProcess/API/C/WKVibration.cpp (0 => 122270)
--- trunk/Source/WebKit2/UIProcess/API/C/WKVibration.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKVibration.cpp 2012-07-10 22:14:34 UTC (rev 122270)
@@ -0,0 +1,51 @@
+/*
+ * 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 "WKVibration.h"
+
+#include "WKAPICast.h"
+
+#if ENABLE(VIBRATION)
+#include "WebVibrationProxy.h"
+#endif
+
+using namespace WebKit;
+
+WKTypeID WKVibrationGetTypeID()
+{
+#if ENABLE(VIBRATION)
+ return toAPI(WebVibrationProxy::APIType);
+#else
+ return 0;
+#endif
+}
+
+void WKVibrationSetProvider(WKVibrationRef vibrationRef, const WKVibrationProvider* wkProvider)
+{
+#if ENABLE(VIBRATION)
+ toImpl(vibrationRef)->initializeProvider(wkProvider);
+#endif
+}
Added: trunk/Source/WebKit2/UIProcess/API/C/WKVibration.h (0 => 122270)
--- trunk/Source/WebKit2/UIProcess/API/C/WKVibration.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKVibration.h 2012-07-10 22:14:34 UTC (rev 122270)
@@ -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.
+ */
+
+#ifndef WKVibration_h
+#define WKVibration_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Provider.
+typedef void (*WKVibrationProviderVibrateCallback)(WKVibrationRef vibrationRef, uint64_t vibrationTime, const void* clientInfo);
+typedef void (*WKVibrationProviderCancelVibrationCallback)(WKVibrationRef vibrationRef, const void* clientInfo);
+
+struct WKVibrationProvider {
+ int version;
+ const void * clientInfo;
+ WKVibrationProviderVibrateCallback vibrate;
+ WKVibrationProviderCancelVibrationCallback cancelVibration;
+};
+typedef struct WKVibrationProvider WKVibrationProvider;
+
+enum { kWKVibrationProviderCurrentVersion = 0 };
+
+WK_EXPORT WKTypeID WKVibrationGetTypeID();
+
+WK_EXPORT void WKVibrationSetProvider(WKVibrationRef vibrationRef, const WKVibrationProvider* provider);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKVibration_h
Added: trunk/Source/WebKit2/UIProcess/WebVibrationProvider.cpp (0 => 122270)
--- trunk/Source/WebKit2/UIProcess/WebVibrationProvider.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebVibrationProvider.cpp 2012-07-10 22:14:34 UTC (rev 122270)
@@ -0,0 +1,54 @@
+/*
+ * 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 "WebVibrationProvider.h"
+
+#if ENABLE(VIBRATION)
+
+#include "WKAPICast.h"
+#include "WebVibrationProxy.h"
+
+namespace WebKit {
+
+void WebVibrationProvider::vibrate(WebVibrationProxy* vibration, uint64_t vibrationTime)
+{
+ if (!m_client.vibrate)
+ return;
+
+ m_client.vibrate(toAPI(vibration), vibrationTime, m_client.clientInfo);
+}
+
+void WebVibrationProvider::cancelVibration(WebVibrationProxy* vibration)
+{
+ if (!m_client.cancelVibration)
+ return;
+
+ m_client.cancelVibration(toAPI(vibration), m_client.clientInfo);
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(VIBRATION)
Added: trunk/Source/WebKit2/UIProcess/WebVibrationProvider.h (0 => 122270)
--- trunk/Source/WebKit2/UIProcess/WebVibrationProvider.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebVibrationProvider.h 2012-07-10 22:14:34 UTC (rev 122270)
@@ -0,0 +1,49 @@
+/*
+ * 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 WebVibrationProvider_h
+#define WebVibrationProvider_h
+
+#if ENABLE(VIBRATION)
+
+#include "APIClient.h"
+#include "WKVibration.h"
+#include <wtf/Forward.h>
+
+namespace WebKit {
+
+class WebVibrationProxy;
+
+class WebVibrationProvider : public APIClient<WKVibrationProvider, kWKVibrationProviderCurrentVersion> {
+public:
+ void vibrate(WebVibrationProxy*, uint64_t vibrationTime);
+ void cancelVibration(WebVibrationProxy*);
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(VIBRATION)
+
+#endif // WebVibrationProvider_h
Added: trunk/Source/WebKit2/UIProcess/WebVibrationProxy.cpp (0 => 122270)
--- trunk/Source/WebKit2/UIProcess/WebVibrationProxy.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebVibrationProxy.cpp 2012-07-10 22:14:34 UTC (rev 122270)
@@ -0,0 +1,76 @@
+/*
+ * 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 "WebVibrationProxy.h"
+
+#if ENABLE(VIBRATION)
+
+#include "WebContext.h"
+
+namespace WebKit {
+
+PassRefPtr<WebVibrationProxy> WebVibrationProxy::create(WebContext* context)
+{
+ return adoptRef(new WebVibrationProxy(context));
+}
+
+WebVibrationProxy::WebVibrationProxy(WebContext* context)
+ : m_context(context)
+{
+}
+
+WebVibrationProxy::~WebVibrationProxy()
+{
+}
+
+void WebVibrationProxy::invalidate()
+{
+ cancelVibration();
+}
+
+void WebVibrationProxy::initializeProvider(const WKVibrationProvider* provider)
+{
+ m_provider.initialize(provider);
+}
+
+void WebVibrationProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+{
+ didReceiveWebVibrationProxyMessage(connection, messageID, arguments);
+}
+
+void WebVibrationProxy::vibrate(uint64_t vibrationTime)
+{
+ m_provider.vibrate(this, vibrationTime);
+}
+
+void WebVibrationProxy::cancelVibration()
+{
+ m_provider.cancelVibration(this);
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(VIBRATION)
Added: trunk/Source/WebKit2/UIProcess/WebVibrationProxy.h (0 => 122270)
--- trunk/Source/WebKit2/UIProcess/WebVibrationProxy.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebVibrationProxy.h 2012-07-10 22:14:34 UTC (rev 122270)
@@ -0,0 +1,78 @@
+/*
+ * 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 WebVibrationProxy_h
+#define WebVibrationProxy_h
+
+#if ENABLE(VIBRATION)
+
+#include "APIObject.h"
+#include "MessageID.h"
+#include "WebVibrationProvider.h"
+#include <wtf/Forward.h>
+
+namespace CoreIPC {
+class ArgumentDecoder;
+class Connection;
+}
+
+namespace WebKit {
+
+class WebContext;
+
+class WebVibrationProxy : public APIObject {
+public:
+ static const Type APIType = TypeVibration;
+
+ static PassRefPtr<WebVibrationProxy> create(WebContext*);
+ virtual ~WebVibrationProxy();
+
+ void invalidate();
+ void clearContext() { m_context = 0; }
+
+ void initializeProvider(const WKVibrationProvider*);
+
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+
+private:
+ explicit WebVibrationProxy(WebContext*);
+
+ virtual Type type() const { return APIType; }
+
+ // Implemented in generated WebVibrationProxyMessageReceiver.cpp
+ void didReceiveWebVibrationProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+
+ void vibrate(uint64_t vibrationTime);
+ void cancelVibration();
+
+ WebContext* m_context;
+ WebVibrationProvider m_provider;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(VIBRATION)
+
+#endif // WebVibrationProxy_h
Added: trunk/Source/WebKit2/UIProcess/WebVibrationProxy.messages.in (0 => 122270)
--- trunk/Source/WebKit2/UIProcess/WebVibrationProxy.messages.in (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebVibrationProxy.messages.in 2012-07-10 22:14:34 UTC (rev 122270)
@@ -0,0 +1,30 @@
+# 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.
+
+#if ENABLE(VIBRATION)
+
+messages -> WebVibrationProxy {
+ Vibrate(uint64_t vibrationTime);
+ CancelVibration();
+}
+
+#endif
Added: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.cpp (0 => 122270)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.cpp (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.cpp 2012-07-10 22:14:34 UTC (rev 122270)
@@ -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.
+ */
+
+#include "config.h"
+#include "WebVibrationClient.h"
+
+#if ENABLE(VIBRATION)
+
+#include "WebPage.h"
+#include "WebProcess.h"
+#include "WebVibrationProxyMessages.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void WebVibrationClient::vibrate(const uint64_t& vibrationTime)
+{
+ WebProcess::shared().connection()->send(Messages::WebVibrationProxy::Vibrate(vibrationTime), m_page->pageID());
+}
+
+void WebVibrationClient::cancelVibration()
+{
+ WebProcess::shared().connection()->send(Messages::WebVibrationProxy::CancelVibration(), m_page->pageID());
+}
+
+void WebVibrationClient::vibrationDestroyed()
+{
+ delete this;
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(VIBRATION)
Added: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.h (0 => 122270)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.h (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.h 2012-07-10 22:14:34 UTC (rev 122270)
@@ -0,0 +1,58 @@
+/*
+ * 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 WebVibrationClient_h
+#define WebVibrationClient_h
+
+#if ENABLE(VIBRATION)
+
+#include <WebCore/VibrationClient.h>
+
+namespace WebKit {
+
+class WebPage;
+
+class WebVibrationClient : public WebCore::VibrationClient {
+public:
+ WebVibrationClient(WebPage* page)
+ : m_page(page)
+ {
+ }
+
+ virtual ~WebVibrationClient() { }
+
+private:
+ virtual void vibrate(const uint64_t& vibrationTime) OVERRIDE;
+ virtual void cancelVibration() OVERRIDE;
+ virtual void vibrationDestroyed() OVERRIDE;
+
+ WebPage* m_page;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(VIBRATION)
+
+#endif // WebVibrationClient_h