Title: [122500] trunk/Source/WebKit2
Revision
122500
Author
[email protected]
Date
2012-07-12 13:44:45 -0700 (Thu, 12 Jul 2012)

Log Message

[WK2] Add missing Network Information API integration to WebContext and WebPage
https://bugs.webkit.org/show_bug.cgi?id=90781

Patch by Christophe Dumez <[email protected]> on 2012-07-12
Reviewed by Anders Carlsson.

Integrate Network Information API to WebPage, WebContext and
properly route messages to the WebNetworkInfoManagerProxy.
Without this, the Network Information tests are crashing for
WebKit2.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
(WebKit::WebContext::~WebContext):
(WebKit::WebContext::disconnectProcess):
(WebKit::WebContext::didReceiveMessage):
(WebKit::WebContext::didReceiveSyncMessage):
* UIProcess/WebContext.h:
(WebKit):
(WebContext):
(WebKit::WebContext::networkInfoManagerProxy):
* UIProcess/WebNetworkInfoManagerProxy.cpp:
(WebKit::WebNetworkInfoManagerProxy::didReceiveSyncMessage):
(WebKit):
* UIProcess/WebNetworkInfoManagerProxy.h:
(WebNetworkInfoManagerProxy):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didReceiveMessage):
(WebKit::WebProcessProxy::didReceiveSyncMessage):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (122499 => 122500)


--- trunk/Source/WebKit2/ChangeLog	2012-07-12 20:39:20 UTC (rev 122499)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-12 20:44:45 UTC (rev 122500)
@@ -1,3 +1,36 @@
+2012-07-12  Christophe Dumez  <[email protected]>
+
+        [WK2] Add missing Network Information API integration to WebContext and WebPage
+        https://bugs.webkit.org/show_bug.cgi?id=90781
+
+        Reviewed by Anders Carlsson.
+
+        Integrate Network Information API to WebPage, WebContext and
+        properly route messages to the WebNetworkInfoManagerProxy.
+        Without this, the Network Information tests are crashing for
+        WebKit2.
+
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::WebContext):
+        (WebKit::WebContext::~WebContext):
+        (WebKit::WebContext::disconnectProcess):
+        (WebKit::WebContext::didReceiveMessage):
+        (WebKit::WebContext::didReceiveSyncMessage):
+        * UIProcess/WebContext.h:
+        (WebKit):
+        (WebContext):
+        (WebKit::WebContext::networkInfoManagerProxy):
+        * UIProcess/WebNetworkInfoManagerProxy.cpp:
+        (WebKit::WebNetworkInfoManagerProxy::didReceiveSyncMessage):
+        (WebKit):
+        * UIProcess/WebNetworkInfoManagerProxy.h:
+        (WebNetworkInfoManagerProxy):
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::didReceiveMessage):
+        (WebKit::WebProcessProxy::didReceiveSyncMessage):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+
 2012-07-12  No'am Rosenthal  <[email protected]>
 
         Move TextureMapperAnimation and texmap/LayerTransform to platform/graphics

Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (122499 => 122500)


--- trunk/Source/WebKit2/UIProcess/WebContext.cpp	2012-07-12 20:39:20 UTC (rev 122499)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp	2012-07-12 20:44:45 UTC (rev 122500)
@@ -70,6 +70,10 @@
 #include "WebBatteryManagerProxy.h"
 #endif
 
+#if ENABLE(NETWORK_INFO)
+#include "WebNetworkInfoManagerProxy.h"
+#endif
+
 #if USE(SOUP)
 #include "WebSoupRequestManagerProxy.h"
 #endif
@@ -143,6 +147,9 @@
     , m_iconDatabase(WebIconDatabase::create(this))
     , m_keyValueStorageManagerProxy(WebKeyValueStorageManagerProxy::create(this))
     , m_mediaCacheManagerProxy(WebMediaCacheManagerProxy::create(this))
+#if ENABLE(NETWORK_INFO)
+    , m_networkInfoManagerProxy(WebNetworkInfoManagerProxy::create(this))
+#endif
     , m_notificationManagerProxy(WebNotificationManagerProxy::create(this))
     , m_pluginSiteDataManager(WebPluginSiteDataManager::create(this))
     , m_resourceCacheManagerProxy(WebResourceCacheManagerProxy::create(this))
@@ -210,6 +217,11 @@
 
     m_mediaCacheManagerProxy->invalidate();
     m_mediaCacheManagerProxy->clearContext();
+
+#if ENABLE(NETWORK_INFO)
+    m_networkInfoManagerProxy->invalidate();
+    m_networkInfoManagerProxy->clearContext();
+#endif
     
     m_notificationManagerProxy->invalidate();
     m_notificationManagerProxy->clearContext();
@@ -418,6 +430,9 @@
     m_geolocationManagerProxy->invalidate();
     m_keyValueStorageManagerProxy->invalidate();
     m_mediaCacheManagerProxy->invalidate();
+#if ENABLE(NETWORK_INFO)
+    m_networkInfoManagerProxy->invalidate();
+#endif
     m_notificationManagerProxy->invalidate();
     m_resourceCacheManagerProxy->invalidate();
 #if USE(SOUP)
@@ -782,6 +797,13 @@
         m_mediaCacheManagerProxy->didReceiveMessage(connection, messageID, arguments);
         return;
     }
+
+#if ENABLE(NETWORK_INFO)
+    if (messageID.is<CoreIPC::MessageClassWebNetworkInfoManagerProxy>()) {
+        m_networkInfoManagerProxy->didReceiveMessage(connection, messageID, arguments);
+        return;
+    }
+#endif
     
     if (messageID.is<CoreIPC::MessageClassWebNotificationManagerProxy>()) {
         m_notificationManagerProxy->didReceiveMessage(connection, messageID, arguments);
@@ -835,6 +857,13 @@
         m_iconDatabase->didReceiveSyncMessage(connection, messageID, arguments, reply);
         return;
     }
+
+#if ENABLE(NETWORK_INFO)
+    if (messageID.is<CoreIPC::MessageClassWebNetworkInfoManagerProxy>()) {
+        m_networkInfoManagerProxy->didReceiveSyncMessage(connection, messageID, arguments, reply);
+        return;
+    }
+#endif
     
     switch (messageID.get<WebContextLegacyMessage::Kind>()) {
         case WebContextLegacyMessage::PostSynchronousMessage: {

Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (122499 => 122500)


--- trunk/Source/WebKit2/UIProcess/WebContext.h	2012-07-12 20:39:20 UTC (rev 122499)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h	2012-07-12 20:44:45 UTC (rev 122500)
@@ -57,6 +57,9 @@
 class WebIconDatabase;
 class WebKeyValueStorageManagerProxy;
 class WebMediaCacheManagerProxy;
+#if ENABLE(NETWORK_INFO)
+class WebNetworkInfoManagerProxy;
+#endif
 class WebNotificationManagerProxy;
 class WebPageGroup;
 class WebPageProxy;
@@ -166,6 +169,9 @@
     WebIconDatabase* iconDatabase() const { return m_iconDatabase.get(); }
     WebKeyValueStorageManagerProxy* keyValueStorageManagerProxy() const { return m_keyValueStorageManagerProxy.get(); }
     WebMediaCacheManagerProxy* mediaCacheManagerProxy() const { return m_mediaCacheManagerProxy.get(); }
+#if ENABLE(NETWORK_INFO)
+    WebNetworkInfoManagerProxy* networkInfoManagerProxy() const { return m_networkInfoManagerProxy.get(); }
+#endif
     WebNotificationManagerProxy* notificationManagerProxy() const { return m_notificationManagerProxy.get(); }
     WebPluginSiteDataManager* pluginSiteDataManager() const { return m_pluginSiteDataManager.get(); }
     WebResourceCacheManagerProxy* resourceCacheManagerProxy() const { return m_resourceCacheManagerProxy.get(); }
@@ -314,6 +320,9 @@
     RefPtr<WebIconDatabase> m_iconDatabase;
     RefPtr<WebKeyValueStorageManagerProxy> m_keyValueStorageManagerProxy;
     RefPtr<WebMediaCacheManagerProxy> m_mediaCacheManagerProxy;
+#if ENABLE(NETWORK_INFO)
+    RefPtr<WebNetworkInfoManagerProxy> m_networkInfoManagerProxy;
+#endif
     RefPtr<WebNotificationManagerProxy> m_notificationManagerProxy;
     RefPtr<WebPluginSiteDataManager> m_pluginSiteDataManager;
     RefPtr<WebResourceCacheManagerProxy> m_resourceCacheManagerProxy;

Modified: trunk/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp (122499 => 122500)


--- trunk/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp	2012-07-12 20:39:20 UTC (rev 122499)
+++ trunk/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp	2012-07-12 20:44:45 UTC (rev 122500)
@@ -72,6 +72,11 @@
     didReceiveWebNetworkInfoManagerProxyMessage(connection, messageID, arguments);
 }
 
+void WebNetworkInfoManagerProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, WTF::OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+{
+    didReceiveSyncWebNetworkInfoManagerProxyMessage(connection, messageID, arguments, reply);
+}
+
 void WebNetworkInfoManagerProxy::startUpdating()
 {
     if (m_isUpdating)

Modified: trunk/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.h (122499 => 122500)


--- trunk/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.h	2012-07-12 20:39:20 UTC (rev 122499)
+++ trunk/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.h	2012-07-12 20:44:45 UTC (rev 122500)
@@ -59,6 +59,7 @@
     void providerDidChangeNetworkInformation(const WTF::AtomicString& eventType, WebNetworkInfo*);
 
     void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+    void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, WTF::OwnPtr<CoreIPC::ArgumentEncoder>&);
 
 private:
     explicit WebNetworkInfoManagerProxy(WebContext*);

Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (122499 => 122500)


--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp	2012-07-12 20:39:20 UTC (rev 122499)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp	2012-07-12 20:44:45 UTC (rev 122500)
@@ -316,6 +316,9 @@
         || messageID.is<CoreIPC::MessageClassWebIconDatabase>()
         || messageID.is<CoreIPC::MessageClassWebKeyValueStorageManagerProxy>()
         || messageID.is<CoreIPC::MessageClassWebMediaCacheManagerProxy>()
+#if ENABLE(NETWORK_INFO)
+        || messageID.is<CoreIPC::MessageClassWebNetworkInfoManagerProxy>()
+#endif
         || messageID.is<CoreIPC::MessageClassWebNotificationManagerProxy>()
 #if USE(SOUP)
         || messageID.is<CoreIPC::MessageClassWebSoupRequestManagerProxy>()
@@ -343,7 +346,10 @@
         return;
     }
 
-    if (messageID.is<CoreIPC::MessageClassWebContext>() || messageID.is<CoreIPC::MessageClassWebContextLegacy>() 
+    if (messageID.is<CoreIPC::MessageClassWebContext>() || messageID.is<CoreIPC::MessageClassWebContextLegacy>()
+#if ENABLE(NETWORK_INFO)
+        || messageID.is<CoreIPC::MessageClassWebNetworkInfoManagerProxy>()
+#endif
         || messageID.is<CoreIPC::MessageClassDownloadProxy>() || messageID.is<CoreIPC::MessageClassWebIconDatabase>()) {
         m_context->didReceiveSyncMessage(connection, messageID, arguments, reply);
         return;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (122499 => 122500)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-07-12 20:39:20 UTC (rev 122499)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-07-12 20:44:45 UTC (rev 122500)
@@ -130,6 +130,10 @@
 #include "WebBatteryClient.h"
 #endif
 
+#if ENABLE(NETWORK_INFO)
+#include "WebNetworkInfoClient.h"
+#endif
+
 #if ENABLE(WEB_INTENTS)
 #include "IntentData.h"
 #endif
@@ -276,6 +280,9 @@
     WebCore::provideDeviceMotionTo(m_page.get(), new DeviceMotionClientQt);
     WebCore::provideDeviceOrientationTo(m_page.get(), new DeviceOrientationClientQt);
 #endif
+#if ENABLE(NETWORK_INFO)
+    WebCore::provideNetworkInfoTo(m_page.get(), new WebNetworkInfoClient(this));
+#endif
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebCore::provideNotification(m_page.get(), new WebNotificationClient(this));
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to