[SOUP] Add stubs for CustomProtocol classes
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jan 2014 07:50:46 +0000 (07:50 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jan 2014 07:50:46 +0000 (07:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=126343

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt:
* GNUmakefile.am:
* GNUmakefile.list.am:
* PlatformGTK.cmake:
* Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp: Added.
(WebKit::generateCustomProtocolID):
(WebKit::WebSoupRequestAsyncData::WebSoupRequestAsyncData):
(WebKit::WebSoupRequestAsyncData::~WebSoupRequestAsyncData):
(WebKit::WebSoupRequestAsyncData::requestFailed):
(WebKit::WebSoupRequestAsyncData::releaseTask):
(WebKit::CustomProtocolManager::supplementName):
(WebKit::CustomProtocolManager::CustomProtocolManager):
(WebKit::CustomProtocolManager::initializeConnection):
(WebKit::CustomProtocolManager::initialize):
* Shared/Network/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode): Move
urlSchemesRegisteredForCustomProtocols encoding out of platform
ifdefs, since it's already guarded by ENABLE(CUSTOM_PROTOCOLS).
(WebKit::NetworkProcessCreationParameters::decode): Ditto.
* Shared/Network/NetworkProcessCreationParameters.h: Ditto.
* UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp: Added.
(WebKit::CustomProtocolManagerProxy::CustomProtocolManagerProxy):
(WebKit::CustomProtocolManagerProxy::startLoading):
(WebKit::CustomProtocolManagerProxy::stopLoading):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162190 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.am
Source/WebKit2/GNUmakefile.list.am
Source/WebKit2/PlatformGTK.cmake
Source/WebKit2/Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp [new file with mode: 0644]
Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.cpp
Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.h
Source/WebKit2/UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp [new file with mode: 0644]

index abd82ba..6114dff 100644 (file)
@@ -31,6 +31,7 @@ set(WebKit2_INCLUDE_DIRECTORIES
     "${WEBKIT2_DIR}/UIProcess/InspectorServer"
     "${WEBKIT2_DIR}/UIProcess/Launcher"
     "${WEBKIT2_DIR}/UIProcess/Network"
+    "${WEBKIT2_DIR}/UIProcess/Network/CustomProtocols"
     "${WEBKIT2_DIR}/UIProcess/Notifications"
     "${WEBKIT2_DIR}/UIProcess/Plugins"
     "${WEBKIT2_DIR}/UIProcess/Storage"
@@ -589,6 +590,8 @@ set(WebKit2_MESSAGES_IN_FILES
 
     Shared/Plugins/NPObjectMessageReceiver.messages.in
 
+    Shared/Network/CustomProtocols/CustomProtocolManager.messages.in
+
     UIProcess/DrawingAreaProxy.messages.in
     UIProcess/WebApplicationCacheManagerProxy.messages.in
     UIProcess/WebBatteryManagerProxy.messages.in
index d10bdb8..28a41b6 100644 (file)
@@ -1,3 +1,35 @@
+2014-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [SOUP] Add stubs for CustomProtocol classes
+        https://bugs.webkit.org/show_bug.cgi?id=126343
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * GNUmakefile.list.am:
+        * PlatformGTK.cmake:
+        * Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp: Added.
+        (WebKit::generateCustomProtocolID):
+        (WebKit::WebSoupRequestAsyncData::WebSoupRequestAsyncData):
+        (WebKit::WebSoupRequestAsyncData::~WebSoupRequestAsyncData):
+        (WebKit::WebSoupRequestAsyncData::requestFailed):
+        (WebKit::WebSoupRequestAsyncData::releaseTask):
+        (WebKit::CustomProtocolManager::supplementName):
+        (WebKit::CustomProtocolManager::CustomProtocolManager):
+        (WebKit::CustomProtocolManager::initializeConnection):
+        (WebKit::CustomProtocolManager::initialize):
+        * Shared/Network/NetworkProcessCreationParameters.cpp:
+        (WebKit::NetworkProcessCreationParameters::encode): Move
+        urlSchemesRegisteredForCustomProtocols encoding out of platform
+        ifdefs, since it's already guarded by ENABLE(CUSTOM_PROTOCOLS).
+        (WebKit::NetworkProcessCreationParameters::decode): Ditto.
+        * Shared/Network/NetworkProcessCreationParameters.h: Ditto.
+        * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp: Added.
+        (WebKit::CustomProtocolManagerProxy::CustomProtocolManagerProxy):
+        (WebKit::CustomProtocolManagerProxy::startLoading):
+        (WebKit::CustomProtocolManagerProxy::stopLoading):
+
 2014-01-16  Tim Horton  <timothy_horton@apple.com>
 
         On iOS, zooming in with a TileController-backed main frame makes hundreds of tiles
index 494b04d..cbaccbf 100644 (file)
@@ -121,6 +121,7 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPP
        -I$(srcdir)/Source/WebKit2/UIProcess/Launcher \
        -I$(srcdir)/Source/WebKit2/UIProcess/Launcher/gtk \
        -I$(srcdir)/Source/WebKit2/UIProcess/Network \
+       -I$(srcdir)/Source/WebKit2/UIProcess/Network/CustomProtocols \
        -I$(srcdir)/Source/WebKit2/UIProcess/Notifications \
        -I$(srcdir)/Source/WebKit2/UIProcess/Plugins \
        -I$(srcdir)/Source/WebKit2/UIProcess/Plugins/unix \
@@ -414,6 +415,7 @@ vpath %.messages.in = \
        $(WebKit2)/PluginProcess \
        $(WebKit2)/Shared \
        $(WebKit2)/Shared/Authentication \
+       $(WebKit2)/Shared/Network/CustomProtocols \
        $(WebKit2)/Shared/Plugins \
        $(WebKit2)/UIProcess \
        $(WebKit2)/UIProcess/ApplicationCache \
index 471d8b1..99c118f 100644 (file)
@@ -54,6 +54,8 @@ webkit2_built_sources += \
        DerivedSources/WebKit2/AuthenticationManagerMessages.h \
        DerivedSources/WebKit2/CustomProtocolManagerProxyMessageReceiver.cpp \
        DerivedSources/WebKit2/CustomProtocolManagerProxyMessages.h \
+       DerivedSources/WebKit2/CustomProtocolManagerMessageReceiver.cpp \
+       DerivedSources/WebKit2/CustomProtocolManagerMessages.h \
        DerivedSources/WebKit2/DownloadProxyMessageReceiver.cpp \
        DerivedSources/WebKit2/DownloadProxyMessages.h \
        DerivedSources/WebKit2/DrawingAreaMessageReceiver.cpp \
@@ -401,6 +403,7 @@ webkit2_sources += \
        Source/WebKit2/Shared/NativeWebMouseEvent.h \
        Source/WebKit2/Shared/NativeWebWheelEvent.h \
        Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.h \
+       Source/WebKit2/Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp \
        Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.cpp \
        Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.h \
        Source/WebKit2/Shared/Network/NetworkProcessSupplement.h \
@@ -832,6 +835,8 @@ webkit2_sources += \
        Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp \
        Source/WebKit2/UIProcess/Launcher/ProcessLauncher.cpp \
        Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h \
+       Source/WebKit2/UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h \
+       Source/WebKit2/UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp \
        Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp \
        Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h \
        Source/WebKit2/UIProcess/Network/soup/NetworkProcessProxySoup.cpp \
index fcca853..0405feb 100644 (file)
@@ -37,6 +37,8 @@ list(APPEND WebKit2_SOURCES
 
     Shared/Downloads/soup/DownloadSoup.cpp
 
+    Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp
+
     Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
 
     Shared/cairo/ShareableBitmapCairo.cpp
@@ -233,6 +235,8 @@ list(APPEND WebKit2_SOURCES
 
     UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
 
+    UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp
+
     UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
     UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
 
diff --git a/Source/WebKit2/Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp b/Source/WebKit2/Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp
new file mode 100644 (file)
index 0000000..42b5948
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2013 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "CustomProtocolManager.h"
+
+#if ENABLE(CUSTOM_PROTOCOLS)
+
+#include "ChildProcess.h"
+#include "CustomProtocolManagerMessages.h"
+#include "CustomProtocolManagerProxyMessages.h"
+#include "WebCoreArgumentCoders.h"
+#include "WebProcessCreationParameters.h"
+#include <WebCore/NotImplemented.h>
+#include <WebCore/ResourceError.h>
+#include <WebCore/ResourceRequest.h>
+#include <WebCore/ResourceResponse.h>
+#include <WebCore/URL.h>
+
+#if ENABLE(NETWORK_PROCESS)
+#include "NetworkProcessCreationParameters.h"
+#endif
+
+namespace WebKit {
+
+const char* CustomProtocolManager::supplementName()
+{
+    return "CustomProtocolManager";
+}
+
+CustomProtocolManager::CustomProtocolManager(ChildProcess* childProcess)
+    : m_childProcess(childProcess)
+    , m_messageQueue(WorkQueue::create("com.apple.WebKit.CustomProtocolManager"))
+{
+}
+
+void CustomProtocolManager::initializeConnection(IPC::Connection* connection)
+{
+    connection->addWorkQueueMessageReceiver(Messages::CustomProtocolManager::messageReceiverName(), m_messageQueue.get(), this);
+}
+
+void CustomProtocolManager::initialize(const WebProcessCreationParameters&)
+{
+}
+
+#if ENABLE(NETWORK_PROCESS)
+void CustomProtocolManager::initialize(const NetworkProcessCreationParameters&)
+{
+}
+#endif
+
+void CustomProtocolManager::registerScheme(const String&)
+{
+    notImplemented();
+}
+
+void CustomProtocolManager::unregisterScheme(const String&)
+{
+    notImplemented();
+}
+
+bool CustomProtocolManager::supportsScheme(const String&)
+{
+    notImplemented();
+    return false;
+}
+
+void CustomProtocolManager::didFailWithError(uint64_t, const WebCore::ResourceError&)
+{
+    notImplemented();
+}
+
+void CustomProtocolManager::didLoadData(uint64_t, const IPC::DataReference&)
+{
+    notImplemented();
+}
+
+void CustomProtocolManager::didReceiveResponse(uint64_t, const WebCore::ResourceResponse&, uint32_t)
+{
+    notImplemented();
+}
+
+void CustomProtocolManager::didFinishLoading(uint64_t)
+{
+    notImplemented();
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(CUSTOM_PROTOCOLS)
index e16f5ea..a26a5a1 100644 (file)
@@ -43,14 +43,14 @@ void NetworkProcessCreationParameters::encode(IPC::ArgumentEncoder& encoder) con
     encoder << diskCacheDirectory;
     encoder << diskCacheDirectoryExtensionHandle;
     encoder << shouldUseTestingNetworkSession;
+#if ENABLE(CUSTOM_PROTOCOLS)
+    encoder << urlSchemesRegisteredForCustomProtocols;
+#endif
 #if PLATFORM(MAC)
     encoder << parentProcessName;
     encoder << uiProcessBundleIdentifier;
     encoder << nsURLCacheMemoryCapacity;
     encoder << nsURLCacheDiskCapacity;
-#if ENABLE(CUSTOM_PROTOCOLS)
-    encoder << urlSchemesRegisteredForCustomProtocols;
-#endif
     encoder << httpProxy;
     encoder << httpsProxy;
 #endif
@@ -75,6 +75,10 @@ bool NetworkProcessCreationParameters::decode(IPC::ArgumentDecoder& decoder, Net
         return false;
     if (!decoder.decode(result.shouldUseTestingNetworkSession))
         return false;
+#if ENABLE(CUSTOM_PROTOCOLS)
+    if (!decoder.decode(result.urlSchemesRegisteredForCustomProtocols))
+        return false;
+#endif
 #if PLATFORM(MAC)
     if (!decoder.decode(result.parentProcessName))
         return false;
@@ -84,10 +88,6 @@ bool NetworkProcessCreationParameters::decode(IPC::ArgumentDecoder& decoder, Net
         return false;
     if (!decoder.decode(result.nsURLCacheDiskCapacity))
         return false;
-#if ENABLE(CUSTOM_PROTOCOLS)
-    if (!decoder.decode(result.urlSchemesRegisteredForCustomProtocols))
-        return false;
-#endif
     if (!decoder.decode(result.httpProxy))
         return false;
     if (!decoder.decode(result.httpsProxy))
index bf6e7b5..1ba8d8e 100644 (file)
@@ -58,16 +58,16 @@ struct NetworkProcessCreationParameters {
 
     bool shouldUseTestingNetworkSession;
 
+#if ENABLE(CUSTOM_PROTOCOLS)
+    Vector<String> urlSchemesRegisteredForCustomProtocols;
+#endif
+
 #if PLATFORM(MAC)
     String parentProcessName;
     String uiProcessBundleIdentifier;
     uint64_t nsURLCacheMemoryCapacity;
     uint64_t nsURLCacheDiskCapacity;
 
-#if ENABLE(CUSTOM_PROTOCOLS)
-    Vector<String> urlSchemesRegisteredForCustomProtocols;
-#endif
-
     String httpProxy;
     String httpsProxy;
 #endif
diff --git a/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp b/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp
new file mode 100644 (file)
index 0000000..57b99e4
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2013 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "CustomProtocolManagerProxy.h"
+
+#if ENABLE(CUSTOM_PROTOCOLS)
+
+#include "ChildProcessProxy.h"
+#include "CustomProtocolManagerMessages.h"
+#include "CustomProtocolManagerProxyMessages.h"
+#include <WebCore/NotImplemented.h>
+#include <WebCore/ResourceRequest.h>
+
+namespace WebKit {
+
+CustomProtocolManagerProxy::CustomProtocolManagerProxy(ChildProcessProxy* childProcessProxy)
+    : m_childProcessProxy(childProcessProxy)
+{
+    ASSERT(m_childProcessProxy);
+    m_childProcessProxy->addMessageReceiver(Messages::CustomProtocolManagerProxy::messageReceiverName(), *this);
+}
+
+void CustomProtocolManagerProxy::startLoading(uint64_t, const WebCore::ResourceRequest&)
+{
+    notImplemented();
+}
+
+void CustomProtocolManagerProxy::stopLoading(uint64_t)
+{
+    notImplemented();
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(CUSTOM_PROTOCOLS)