Title: [123158] trunk/Source/WebKit2
Revision
123158
Author
[email protected]
Date
2012-07-19 15:57:28 -0700 (Thu, 19 Jul 2012)

Log Message

[WK2] Add Vibration API integration to WebContext and WebPage
https://bugs.webkit.org/show_bug.cgi?id=91081

Patch by Sudarsana Nagineni <[email protected]> on 2012-07-19
Reviewed by Anders Carlsson.

Integrate Vibration API to WebPage, WebContext and properly route
messages to the WebVibrationProxy.

* UIProcess/API/C/WKContext.cpp:
(WKContextGetVibration):
* UIProcess/API/C/WKContext.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
(WebKit::WebContext::~WebContext):
(WebKit::WebContext::disconnectProcess):
(WebKit::WebContext::didReceiveMessage):
* UIProcess/WebContext.h:
(WebKit):
(WebContext):
(WebKit::WebContext::vibrationProxy):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didReceiveMessage):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (123157 => 123158)


--- trunk/Source/WebKit2/ChangeLog	2012-07-19 22:55:33 UTC (rev 123157)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-19 22:57:28 UTC (rev 123158)
@@ -1,3 +1,30 @@
+2012-07-19  Sudarsana Nagineni  <[email protected]>
+
+        [WK2] Add Vibration API integration to WebContext and WebPage
+        https://bugs.webkit.org/show_bug.cgi?id=91081
+
+        Reviewed by Anders Carlsson.
+
+        Integrate Vibration API to WebPage, WebContext and properly route
+        messages to the WebVibrationProxy.
+
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextGetVibration):
+        * UIProcess/API/C/WKContext.h:
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::WebContext):
+        (WebKit::WebContext::~WebContext):
+        (WebKit::WebContext::disconnectProcess):
+        (WebKit::WebContext::didReceiveMessage):
+        * UIProcess/WebContext.h:
+        (WebKit):
+        (WebContext):
+        (WebKit::WebContext::vibrationProxy):
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::didReceiveMessage):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+
 2012-07-19  No'am Rosenthal  <[email protected]>
 
         [Qt] Enable CSS shaders in Qt (software mode)

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp (123157 => 123158)


--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp	2012-07-19 22:55:33 UTC (rev 123157)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp	2012-07-19 22:57:28 UTC (rev 123158)
@@ -228,6 +228,15 @@
     return toAPI(toImpl(contextRef)->resourceCacheManagerProxy());
 }
 
+WKVibrationRef WKContextGetVibration(WKContextRef contextRef)
+{
+#if ENABLE(VIBRATION)
+    return toAPI(toImpl(contextRef)->vibrationProxy());
+#else
+    return 0;
+#endif
+}
+
 void WKContextStartMemorySampler(WKContextRef contextRef, WKDoubleRef interval)
 {
     toImpl(contextRef)->startMemorySampler(toImpl(interval)->value());

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.h (123157 => 123158)


--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.h	2012-07-19 22:55:33 UTC (rev 123157)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.h	2012-07-19 22:57:28 UTC (rev 123158)
@@ -159,6 +159,7 @@
 WK_EXPORT WKNotificationManagerRef WKContextGetNotificationManager(WKContextRef context);
 WK_EXPORT WKPluginSiteDataManagerRef WKContextGetPluginSiteDataManager(WKContextRef context);
 WK_EXPORT WKResourceCacheManagerRef WKContextGetResourceCacheManager(WKContextRef context);
+WK_EXPORT WKVibrationRef WKContextGetVibration(WKContextRef context);
     
 typedef void (*WKContextGetStatisticsFunction)(WKDictionaryRef statistics, WKErrorRef error, void* functionContext);
 WK_EXPORT void WKContextGetStatistics(WKContextRef context, void* functionContext, WKContextGetStatisticsFunction function);

Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (123157 => 123158)


--- trunk/Source/WebKit2/UIProcess/WebContext.cpp	2012-07-19 22:55:33 UTC (rev 123157)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp	2012-07-19 22:57:28 UTC (rev 123158)
@@ -78,6 +78,10 @@
 #include "WebSoupRequestManagerProxy.h"
 #endif
 
+#if ENABLE(VIBRATION)
+#include "WebVibrationProxy.h"
+#endif
+
 #ifndef NDEBUG
 #include <wtf/RefCountedLeakCounter.h>
 #endif
@@ -156,6 +160,9 @@
 #if USE(SOUP)
     , m_soupRequestManagerProxy(WebSoupRequestManagerProxy::create(this))
 #endif
+#if ENABLE(VIBRATION)
+    , m_vibrationProxy(WebVibrationProxy::create(this))
+#endif
 #if PLATFORM(WIN)
     , m_shouldPaintNativeControls(true)
     , m_initialHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyAlways)
@@ -237,6 +244,11 @@
     m_soupRequestManagerProxy->clearContext();
 #endif
 
+#if ENABLE(VIBRATION)
+    m_vibrationProxy->invalidate();
+    m_vibrationProxy->clearContext();
+#endif
+
     invalidateCallbackMap(m_dictionaryCallbacks);
 
     platformInvalidateContext();
@@ -438,6 +450,9 @@
 #if USE(SOUP)
     m_soupRequestManagerProxy->invalidate();
 #endif
+#if ENABLE(VIBRATION)
+    m_vibrationProxy->invalidate();
+#endif
 
     // When out of process plug-ins are enabled, we don't want to invalidate the plug-in site data
     // manager just because the web process crashes since it's not involved.
@@ -822,6 +837,13 @@
     }
 #endif
 
+#if ENABLE(VIBRATION)
+    if (messageID.is<CoreIPC::MessageClassWebVibrationProxy>()) {
+        m_vibrationProxy->didReceiveMessage(connection, messageID, arguments);
+        return;
+    }
+#endif
+
     switch (messageID.get<WebContextLegacyMessage::Kind>()) {
         case WebContextLegacyMessage::PostMessage: {
             String messageName;

Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (123157 => 123158)


--- trunk/Source/WebKit2/UIProcess/WebContext.h	2012-07-19 22:55:33 UTC (rev 123157)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h	2012-07-19 22:57:28 UTC (rev 123158)
@@ -67,6 +67,9 @@
 #if USE(SOUP)
 class WebSoupRequestManagerProxy;
 #endif
+#if ENABLE(VIBRATION)
+class WebVibrationProxy;
+#endif
 struct StatisticsData;
 struct WebProcessCreationParameters;
     
@@ -178,6 +181,9 @@
 #if USE(SOUP)
     WebSoupRequestManagerProxy* soupRequestManagerProxy() const { return m_soupRequestManagerProxy.get(); }
 #endif
+#if ENABLE(VIBRATION)
+    WebVibrationProxy* vibrationProxy() const { return m_vibrationProxy.get(); }
+#endif
 
     struct Statistics {
         unsigned wkViewCount;
@@ -329,6 +335,9 @@
 #if USE(SOUP)
     RefPtr<WebSoupRequestManagerProxy> m_soupRequestManagerProxy;
 #endif
+#if ENABLE(VIBRATION)
+    RefPtr<WebVibrationProxy> m_vibrationProxy;
+#endif
 
 #if PLATFORM(WIN)
     bool m_shouldPaintNativeControls;

Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (123157 => 123158)


--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp	2012-07-19 22:55:33 UTC (rev 123157)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp	2012-07-19 22:57:28 UTC (rev 123158)
@@ -328,6 +328,9 @@
 #if USE(SOUP)
         || messageID.is<CoreIPC::MessageClassWebSoupRequestManagerProxy>()
 #endif
+#if ENABLE(VIBRATION)
+        || messageID.is<CoreIPC::MessageClassWebVibrationProxy>()
+#endif
         || messageID.is<CoreIPC::MessageClassWebResourceCacheManagerProxy>()) {
         m_context->didReceiveMessage(connection, messageID, arguments);
         return;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (123157 => 123158)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-07-19 22:55:33 UTC (rev 123157)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-07-19 22:57:28 UTC (rev 123158)
@@ -138,6 +138,10 @@
 #include "IntentData.h"
 #endif
 
+#if ENABLE(VIBRATION)
+#include "WebVibrationClient.h"
+#endif
+
 #if PLATFORM(MAC)
 #include "BuiltInPDFView.h"
 #endif
@@ -288,6 +292,9 @@
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebCore::provideNotification(m_page.get(), new WebNotificationClient(this));
 #endif
+#if ENABLE(VIBRATION)
+    WebCore::provideVibrationTo(m_page.get(), new WebVibrationClient(this));
+#endif
 
     // Qt does not yet call setIsInWindow. Until it does, just leave
     // this line out so plug-ins and video will work. Eventually all platforms
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to