[SOUP] Remove custom URI schemes implementation
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Oct 2014 12:49:57 +0000 (12:49 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Oct 2014 12:49:57 +0000 (12:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=128169

Patch by Pascal Jacquemart <p.jacquemart@samsung.com> on 2014-10-10
Reviewed by Carlos Garcia Campos.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/C/soup/WKAPICastSoup.h:
* UIProcess/API/C/soup/WKContextSoup.cpp: Removed.
* UIProcess/API/C/soup/WKSoupRequestManager.cpp: Removed.
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveURIRequest): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/soup/WebSoupRequestManagerClient.cpp: Removed.
* UIProcess/soup/WebSoupRequestManagerProxy.cpp: Removed.
* UIProcess/soup/WebSoupRequestManagerProxy.messages.in: Removed.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
* WebProcess/soup/WebKitSoupRequestGeneric.cpp:
(webkitSoupRequestGenericSendAsync):
(webkitSoupRequestGenericSendFinish):
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformInitializeWebProcess):
* WebProcess/soup/WebSoupRequestManager.cpp: Removed.
* WebProcess/soup/WebSoupRequestManager.messages.in: Removed.

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

18 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebProcessCreationParameters.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/UIProcess/API/C/soup/WKAPICastSoup.h
Source/WebKit2/UIProcess/API/C/soup/WKContextSoup.cpp [deleted file]
Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.cpp [deleted file]
Source/WebKit2/UIProcess/WebContext.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/soup/WebSoupRequestManagerClient.cpp [deleted file]
Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp [deleted file]
Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.messages.in [deleted file]
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp
Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp
Source/WebKit2/WebProcess/soup/WebSoupRequestManager.cpp [deleted file]
Source/WebKit2/WebProcess/soup/WebSoupRequestManager.messages.in [deleted file]

index b41c0a4..3e41e3b 100644 (file)
@@ -1,3 +1,36 @@
+2014-10-10  Pascal Jacquemart  <p.jacquemart@samsung.com>
+
+        [SOUP] Remove custom URI schemes implementation
+        https://bugs.webkit.org/show_bug.cgi?id=128169
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        * UIProcess/API/C/soup/WKAPICastSoup.h:
+        * UIProcess/API/C/soup/WKContextSoup.cpp: Removed.
+        * UIProcess/API/C/soup/WKSoupRequestManager.cpp: Removed.
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::WebContext):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didReceiveURIRequest): Deleted.
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/soup/WebSoupRequestManagerClient.cpp: Removed.
+        * UIProcess/soup/WebSoupRequestManagerProxy.cpp: Removed.
+        * UIProcess/soup/WebSoupRequestManagerProxy.messages.in: Removed.
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::WebProcess):
+        * WebProcess/soup/WebKitSoupRequestGeneric.cpp:
+        (webkitSoupRequestGenericSendAsync):
+        (webkitSoupRequestGenericSendFinish):
+        * WebProcess/soup/WebProcessSoup.cpp:
+        (WebKit::WebProcess::platformInitializeWebProcess):
+        * WebProcess/soup/WebSoupRequestManager.cpp: Removed.
+        * WebProcess/soup/WebSoupRequestManager.messages.in: Removed.
+
 2014-10-09  Dean Jackson  <dino@apple.com>
 
         Remove ENABLE_CSS3_CONDITIONAL_RULES
index 1d8f987..d7df538 100644 (file)
@@ -88,9 +88,6 @@ void WebProcessCreationParameters::encode(IPC::ArgumentEncoder& encoder) const
     encoder << urlSchemesRegisteredForCustomProtocols;
 #endif
 #if USE(SOUP)
-#if !ENABLE(CUSTOM_PROTOCOLS)
-    encoder << urlSchemesRegistered;
-#endif
     encoder << cookiePersistentStoragePath;
     encoder << cookiePersistentStorageType;
     encoder.encodeEnum(cookieAcceptPolicy);
@@ -200,10 +197,6 @@ bool WebProcessCreationParameters::decode(IPC::ArgumentDecoder& decoder, WebProc
         return false;
 #endif
 #if USE(SOUP)
-#if !ENABLE(CUSTOM_PROTOCOLS)
-    if (!decoder.decode(parameters.urlSchemesRegistered))
-        return false;
-#endif
     if (!decoder.decode(parameters.cookiePersistentStoragePath))
         return false;
     if (!decoder.decode(parameters.cookiePersistentStorageType))
index 47a9eee..fb8bd9a 100644 (file)
@@ -95,9 +95,6 @@ struct WebProcessCreationParameters {
     Vector<String> urlSchemesRegisteredForCustomProtocols;
 #endif
 #if USE(SOUP)
-#if !ENABLE(CUSTOM_PROTOCOLS)
-    Vector<String> urlSchemesRegistered;
-#endif
     String cookiePersistentStoragePath;
     uint32_t cookiePersistentStorageType;
     HTTPCookieAcceptPolicy cookieAcceptPolicy;
index 0333335..f845006 100644 (file)
@@ -37,8 +37,6 @@ class WebSoupRequestManagerProxy;
 
 #if ENABLE(CUSTOM_PROTOCOLS)
 WK_ADD_API_MAPPING(WKSoupCustomProtocolRequestManagerRef, WebSoupCustomProtocolRequestManager)
-#else
-WK_ADD_API_MAPPING(WKSoupRequestManagerRef, WebSoupRequestManagerProxy)
 #endif
 
 }
diff --git a/Source/WebKit2/UIProcess/API/C/soup/WKContextSoup.cpp b/Source/WebKit2/UIProcess/API/C/soup/WKContextSoup.cpp
deleted file mode 100644 (file)
index 84d21f9..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2012 Igalia S.L.
- *
- * 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 "WKContextSoup.h"
-
-#include "WKAPICast.h"
-#include "WebContext.h"
-
-// Supplements
-#include "WebSoupRequestManagerProxy.h"
-
-using namespace WebKit;
-
-WKSoupRequestManagerRef WKContextGetSoupRequestManager(WKContextRef contextRef)
-{
-    return toAPI(toImpl(contextRef)->supplement<WebSoupRequestManagerProxy>());
-}
-
diff --git a/Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.cpp b/Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.cpp
deleted file mode 100644 (file)
index ecff28c..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2012 Igalia S.L.
- *
- * 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 "WKSoupRequestManager.h"
-
-#include "WKAPICast.h"
-#include "WebSoupRequestManagerProxy.h"
-
-using namespace WebKit;
-
-WKTypeID WKSoupRequestManagerGetTypeID()
-{
-    return toAPI(WebSoupRequestManagerProxy::APIType);
-}
-
-void WKSoupRequestManagerSetClient(WKSoupRequestManagerRef soupRequestManagerRef, const WKSoupRequestManagerClientBase* wkClient)
-{
-    toImpl(soupRequestManagerRef)->initializeClient(wkClient);
-}
-
-void WKSoupRequestManagerRegisterURIScheme(WKSoupRequestManagerRef soupRequestManagerRef, WKStringRef schemeRef)
-{
-    toImpl(soupRequestManagerRef)->registerURIScheme(toWTFString(schemeRef));
-}
-
-void WKSoupRequestManagerDidHandleURIRequest(WKSoupRequestManagerRef soupRequestManagerRef, WKDataRef data, uint64_t contentLength, WKStringRef mimeTypeRef, uint64_t requestID)
-{
-    toImpl(soupRequestManagerRef)->didHandleURIRequest(toImpl(data), contentLength, toWTFString(mimeTypeRef), requestID);
-}
-
-void WKSoupRequestManagerDidReceiveURIRequestData(WKSoupRequestManagerRef soupRequestManagerRef, WKDataRef data, uint64_t requestID)
-{
-    toImpl(soupRequestManagerRef)->didReceiveURIRequestData(toImpl(data), requestID);
-}
index b4d5c78..182a9ac 100644 (file)
 #include <JavaScriptCore/RemoteInspector.h>
 #endif
 
-#if USE(SOUP)
-#if ENABLE(CUSTOM_PROTOCOLS)
+#if USE(SOUP) && ENABLE(CUSTOM_PROTOCOLS)
 #include "WebSoupCustomProtocolRequestManager.h"
-#else
-#include "WebSoupRequestManagerProxy.h"
-#endif
 #endif
 
 #ifndef NDEBUG
@@ -209,12 +205,8 @@ WebContext::WebContext(WebContextConfiguration configuration)
 #if ENABLE(SQL_DATABASE)
     addSupplement<WebDatabaseManagerProxy>();
 #endif
-#if USE(SOUP)
-#if ENABLE(CUSTOM_PROTOCOLS)
+#if USE(SOUP) && ENABLE(CUSTOM_PROTOCOLS)
     addSupplement<WebSoupCustomProtocolRequestManager>();
-#else
-    addSupplement<WebSoupRequestManagerProxy>();
-#endif
 #endif
 #if ENABLE(BATTERY_STATUS)
     addSupplement<WebBatteryManagerProxy>();
index 190c915..fb6d572 100644 (file)
 #include "ArgumentCodersGtk.h"
 #endif
 
-#if USE(SOUP) && !ENABLE(CUSTOM_PROTOCOLS)
-#include "WebSoupRequestManagerProxy.h"
-#endif
-
 #if ENABLE(VIBRATION)
 #include "WebVibrationProxy.h"
 #endif
@@ -5043,13 +5039,6 @@ PassRefPtr<ViewSnapshot> WebPageProxy::takeViewSnapshot()
 }
 #endif
 
-#if USE(SOUP) && !ENABLE(CUSTOM_PROTOCOLS)
-void WebPageProxy::didReceiveURIRequest(String uriString, uint64_t requestID)
-{
-    m_process->context().supplement<WebSoupRequestManagerProxy>()->didReceiveURIRequest(uriString, this, requestID);
-}
-#endif
-
 #if PLATFORM(GTK)
 void WebPageProxy::setComposition(const String& text, Vector<CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd)
 {
index f0b7827..c0c0a34 100644 (file)
@@ -1253,10 +1253,6 @@ private:
     void notifyRevealedSelection();
 #endif // PLATFORM(IOS)
 
-#if USE(SOUP) && !ENABLE(CUSTOM_PROTOCOLS)
-    void didReceiveURIRequest(String uriString, uint64_t requestID);
-#endif
-
     void clearLoadDependentCallbacks();
 
     void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
index 0f455e7..9ece8d6 100644 (file)
@@ -366,13 +366,6 @@ messages -> WebPageProxy {
     SaveRecentSearches(String name, Vector<String> searchItems)
     LoadRecentSearches(String name) -> (Vector<String> result)
 
-#if USE(SOUP)
-#if !ENABLE(CUSTOM_PROTOCOLS)
-    # Soup custom URI request messages
-    DidReceiveURIRequest(String uriString, uint64_t requestID);
-#endif
-#endif
-
     SavePDFToFileInDownloadsFolder(String suggestedFilename, String originatingURLString, IPC::DataReference data)
 
 #if PLATFORM(COCOA)
diff --git a/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerClient.cpp b/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerClient.cpp
deleted file mode 100644 (file)
index 140d05b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2012 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 "WebSoupRequestManagerClient.h"
-
-#include "WKAPICast.h"
-
-namespace WebKit {
-
-bool WebSoupRequestManagerClient::didReceiveURIRequest(WebSoupRequestManagerProxy* soupRequestManager, API::URL* url, WebPageProxy* initiaingPage, uint64_t requestID)
-{
-    if (!m_client.didReceiveURIRequest)
-        return false;
-
-    m_client.didReceiveURIRequest(toAPI(soupRequestManager), toAPI(url), toAPI(initiaingPage), requestID, m_client.base.clientInfo);
-    return true;
-}
-
-void WebSoupRequestManagerClient::didFailToLoadURIRequest(WebSoupRequestManagerProxy* soupRequestManager, uint64_t requestID)
-{
-    if (m_client.didFailToLoadURIRequest)
-        m_client.didFailToLoadURIRequest(toAPI(soupRequestManager), requestID, m_client.base.clientInfo);
-}
-
-} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp b/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp
deleted file mode 100644 (file)
index cd0af18..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2012 Igalia S.L.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * 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 "WebSoupRequestManagerProxy.h"
-
-#include "APIData.h"
-#include "WebContext.h"
-#include "WebSoupRequestManagerMessages.h"
-#include "WebSoupRequestManagerProxyMessages.h"
-
-namespace WebKit {
-
-const char* WebSoupRequestManagerProxy::supplementName()
-{
-    return "WebSoupRequestManagerProxy";
-}
-
-PassRefPtr<WebSoupRequestManagerProxy> WebSoupRequestManagerProxy::create(WebContext* context)
-{
-    return adoptRef(new WebSoupRequestManagerProxy(context));
-}
-
-WebSoupRequestManagerProxy::WebSoupRequestManagerProxy(WebContext* context)
-    : WebContextSupplement(context)
-    , m_loadFailed(false)
-{
-    WebContextSupplement::context()->addMessageReceiver(Messages::WebSoupRequestManagerProxy::messageReceiverName(), *this);
-}
-
-WebSoupRequestManagerProxy::~WebSoupRequestManagerProxy()
-{
-}
-
-void WebSoupRequestManagerProxy::initializeClient(const WKSoupRequestManagerClientBase* client)
-{
-    m_client.initialize(client);
-}
-
-// WebContextSupplement
-
-void WebSoupRequestManagerProxy::contextDestroyed()
-{
-}
-
-void WebSoupRequestManagerProxy::processDidClose(WebProcessProxy*)
-{
-}
-
-void WebSoupRequestManagerProxy::refWebContextSupplement()
-{
-    API::Object::ref();
-}
-
-void WebSoupRequestManagerProxy::derefWebContextSupplement()
-{
-    API::Object::deref();
-}
-
-void WebSoupRequestManagerProxy::registerURIScheme(const String& scheme)
-{
-    if (!context())
-        return;
-
-    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebSoupRequestManager::RegisterURIScheme(scheme));
-
-    ASSERT(!m_registeredURISchemes.contains(scheme));
-    m_registeredURISchemes.append(scheme);
-}
-
-void WebSoupRequestManagerProxy::didHandleURIRequest(const API::Data* requestData, uint64_t contentLength, const String& mimeType, uint64_t requestID)
-{
-    if (!context())
-        return;
-
-    context()->sendToAllProcesses(Messages::WebSoupRequestManager::DidHandleURIRequest(requestData->dataReference(), contentLength, mimeType, requestID));
-}
-
-void WebSoupRequestManagerProxy::didReceiveURIRequestData(const API::Data* requestData, uint64_t requestID)
-{
-    if (!context())
-        return;
-
-    if (m_loadFailed)
-        return;
-
-    context()->sendToAllProcesses(Messages::WebSoupRequestManager::DidReceiveURIRequestData(requestData->dataReference(), requestID));
-}
-
-void WebSoupRequestManagerProxy::didReceiveURIRequest(const String& uriString, WebPageProxy* initiaingPage, uint64_t requestID)
-{
-    if (!m_client.didReceiveURIRequest(this, API::URL::create(uriString).get(), initiaingPage, requestID))
-        didHandleURIRequest(API::Data::create(0, 0).get(), 0, String(), requestID);
-}
-
-void WebSoupRequestManagerProxy::didFailToLoadURIRequest(uint64_t requestID)
-{
-    m_loadFailed = true;
-    m_client.didFailToLoadURIRequest(this, requestID);
-}
-
-void WebSoupRequestManagerProxy::didFailURIRequest(const WebCore::ResourceError& error, uint64_t requestID)
-{
-    if (!context())
-        return;
-
-    m_loadFailed = true;
-    context()->sendToAllProcesses(Messages::WebSoupRequestManager::DidFailURIRequest(error, requestID));
-}
-
-} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.messages.in b/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.messages.in
deleted file mode 100644 (file)
index 18058f5..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2012 Igalia S.L.
-#
-# 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.
-
-messages -> WebSoupRequestManagerProxy {
-    DidFailToLoadURIRequest(uint64_t requestID);
-}
index 7c170b0..a445894 100644 (file)
 #include <JavaScriptCore/RemoteInspector.h>
 #endif
 
-#if USE(SOUP) && !ENABLE(CUSTOM_PROTOCOLS)
-#include "WebSoupRequestManager.h"
-#endif
-
 using namespace JSC;
 using namespace WebCore;
 
@@ -204,9 +200,6 @@ WebProcess::WebProcess()
 #if ENABLE(BATTERY_STATUS)
     addSupplement<WebBatteryManager>();
 #endif
-#if USE(SOUP) && !ENABLE(CUSTOM_PROTOCOLS)
-    addSupplement<WebSoupRequestManager>();
-#endif
     m_plugInAutoStartOriginHashes.add(SessionID::defaultSessionID(), HashMap<unsigned, double>());
 }
 
index 55c5037..5675f92 100644 (file)
 
 #include <wtf/text/CString.h>
 
-#if !ENABLE(CUSTOM_PROTOCOLS)
-#include "WebProcess.h"
-#include "WebSoupRequestManager.h"
-#endif
-
 using namespace WebKit;
 
 G_DEFINE_TYPE(WebKitSoupRequestGeneric, webkit_soup_request_generic, SOUP_TYPE_REQUEST)
@@ -55,8 +50,6 @@ static void webkitSoupRequestGenericSendAsync(SoupRequest* request, GCancellable
     CustomProtocolManagerImpl* customProtocolManager = WEBKIT_SOUP_REQUEST_GENERIC_GET_CLASS(request)->customProtocolManager;
     ASSERT(customProtocolManager);
     customProtocolManager->send(g_task_new(request, cancellable, callback, userData));
-#else
-    WebProcess::shared().supplement<WebSoupRequestManager>()->send(g_task_new(request, cancellable, callback, userData));
 #endif
 }
 
@@ -68,7 +61,7 @@ static GInputStream* webkitSoupRequestGenericSendFinish(SoupRequest* request, GA
     ASSERT(customProtocolManager);
     return customProtocolManager->finish(G_TASK(result), error);
 #else
-    return WebProcess::shared().supplement<WebSoupRequestManager>()->finish(G_TASK(result), error);
+    return nullptr;
 #endif
 }
 
index 0aaa35c..84f7c4d 100644 (file)
 #include <wtf/gobject/GRefPtr.h>
 #include <wtf/gobject/GUniquePtr.h>
 
-#if !ENABLE(CUSTOM_PROTOCOLS)
-#include "WebSoupRequestManager.h"
-#endif
-
 namespace WebKit {
 
 static uint64_t getCacheDiskFreeSize(SoupCache* cache)
@@ -170,11 +166,6 @@ void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters
     if (!parameters.languages.isEmpty())
         setSoupSessionAcceptLanguage(parameters.languages);
 
-#if !ENABLE(CUSTOM_PROTOCOLS)
-    for (size_t i = 0; i < parameters.urlSchemesRegistered.size(); i++)
-        supplement<WebSoupRequestManager>()->registerURIScheme(parameters.urlSchemesRegistered[i]);
-#endif
-
     setIgnoreTLSErrors(parameters.ignoreTLSErrors);
 
     WebCore::addLanguageChangeObserver(this, languageChanged);
diff --git a/Source/WebKit2/WebProcess/soup/WebSoupRequestManager.cpp b/Source/WebKit2/WebProcess/soup/WebSoupRequestManager.cpp
deleted file mode 100644 (file)
index e71ee40..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (C) 2012, 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 "WebSoupRequestManager.h"
-
-#include "DataReference.h"
-#include "WebErrors.h"
-#include "WebKitSoupRequestGeneric.h"
-#include "WebKitSoupRequestInputStream.h"
-#include "WebPageProxyMessages.h"
-#include "WebProcess.h"
-#include "WebSoupRequestManagerMessages.h"
-#include "WebSoupRequestManagerProxyMessages.h"
-#include <WebCore/ResourceHandle.h>
-#include <WebCore/ResourceRequest.h>
-#include <WebCore/SoupNetworkSession.h>
-#include <wtf/gobject/GUniquePtr.h>
-#include <wtf/text/CString.h>
-
-namespace WebKit {
-
-static uint64_t generateSoupRequestID()
-{
-    static uint64_t uniqueSoupRequestID = 1;
-    return uniqueSoupRequestID++;
-}
-
-struct WebSoupRequestAsyncData {
-    WebSoupRequestAsyncData(GTask* task, WebKitSoupRequestGeneric* requestGeneric)
-        : task(task)
-        , request(requestGeneric)
-        , cancellable(g_task_get_cancellable(task))
-    {
-        // If the struct contains a null request, it is because the request failed.
-        g_object_add_weak_pointer(G_OBJECT(request), reinterpret_cast<void**>(&request));
-    }
-
-    ~WebSoupRequestAsyncData()
-    {
-        if (request)
-            g_object_remove_weak_pointer(G_OBJECT(request), reinterpret_cast<void**>(&request));
-    }
-
-    bool requestFailed()
-    {
-        return g_cancellable_is_cancelled(cancellable.get()) || !request;
-    }
-
-    GRefPtr<GTask> releaseTask()
-    {
-        GTask* returnValue = task;
-        task = 0;
-        return adoptGRef(returnValue);
-    }
-
-    GTask* task;
-    WebKitSoupRequestGeneric* request;
-    GRefPtr<GCancellable> cancellable;
-    GRefPtr<GInputStream> stream;
-};
-
-const char* WebSoupRequestManager::supplementName()
-{
-    return "WebSoupRequestManager";
-}
-
-WebSoupRequestManager::WebSoupRequestManager(WebProcess* process)
-    : m_process(process)
-    , m_schemes(adoptGRef(g_ptr_array_new_with_free_func(g_free)))
-{
-    m_process->addMessageReceiver(Messages::WebSoupRequestManager::messageReceiverName(), *this);
-}
-
-WebSoupRequestManager::~WebSoupRequestManager()
-{
-}
-
-void WebSoupRequestManager::registerURIScheme(const String& scheme)
-{
-    if (m_schemes->len)
-        g_ptr_array_remove_index_fast(m_schemes.get(), m_schemes->len - 1);
-    g_ptr_array_add(m_schemes.get(), g_strdup(scheme.utf8().data()));
-    g_ptr_array_add(m_schemes.get(), 0);
-
-    SoupSession* session = WebCore::SoupNetworkSession::defaultSession().soupSession();
-    SoupRequestClass* genericRequestClass = static_cast<SoupRequestClass*>(g_type_class_ref(WEBKIT_TYPE_SOUP_REQUEST_GENERIC));
-    genericRequestClass->schemes = const_cast<const char**>(reinterpret_cast<char**>(m_schemes->pdata));
-    soup_session_add_feature_by_type(session, WEBKIT_TYPE_SOUP_REQUEST_GENERIC);
-}
-
-void WebSoupRequestManager::didHandleURIRequest(const IPC::DataReference& requestData, uint64_t contentLength, const String& mimeType, uint64_t requestID)
-{
-    WebSoupRequestAsyncData* data = m_requestMap.get(requestID);
-    ASSERT(data);
-    GRefPtr<GTask> task = data->releaseTask();
-    ASSERT(task.get());
-
-    WebKitSoupRequestGeneric* request = WEBKIT_SOUP_REQUEST_GENERIC(g_task_get_source_object(task.get()));
-    webkitSoupRequestGenericSetContentLength(request, contentLength ? contentLength : -1);
-    webkitSoupRequestGenericSetContentType(request, !mimeType.isEmpty() ? mimeType.utf8().data() : 0);
-
-    GInputStream* dataStream;
-    if (!requestData.size()) {
-        // Empty reply, just create and empty GMemoryInputStream.
-        dataStream = g_memory_input_stream_new();
-        m_requestMap.remove(requestID);
-    } else if (requestData.size() == contentLength) {
-        // We don't expect more data, so we can just create a GMemoryInputStream with all the data.
-        dataStream = g_memory_input_stream_new_from_data(g_memdup(requestData.data(), requestData.size()), contentLength, g_free);
-        m_requestMap.remove(requestID);
-    } else {
-        // We expect more data chunks from the UI process.
-        dataStream = webkitSoupRequestInputStreamNew(contentLength);
-        data->stream = dataStream;
-        webkitSoupRequestInputStreamAddData(WEBKIT_SOUP_REQUEST_INPUT_STREAM(dataStream), requestData.data(), requestData.size());
-    }
-    g_task_return_pointer(task.get(), dataStream, g_object_unref);
-}
-
-void WebSoupRequestManager::didReceiveURIRequestData(const IPC::DataReference& requestData, uint64_t requestID)
-{
-    WebSoupRequestAsyncData* data = m_requestMap.get(requestID);
-    // The data might have been removed from the request map if a previous chunk failed
-    // and a new message was sent by the UI process before being notified about the failure.
-    if (!data)
-        return;
-    ASSERT(data->stream.get());
-
-    if (data->requestFailed()) {
-        // ResourceRequest failed or it was cancelled. It doesn't matter here the error or if it was cancelled,
-        // because that's already handled by the resource handle client, we just want to notify the UI process
-        // to stop reading data from the user input stream. If UI process already sent all the data we simply
-        // finish silently.
-        if (!webkitSoupRequestInputStreamFinished(WEBKIT_SOUP_REQUEST_INPUT_STREAM(data->stream.get())))
-            m_process->parentProcessConnection()->send(Messages::WebSoupRequestManagerProxy::DidFailToLoadURIRequest(requestID), 0);
-        m_requestMap.remove(requestID);
-
-        return;
-    }
-
-    webkitSoupRequestInputStreamAddData(WEBKIT_SOUP_REQUEST_INPUT_STREAM(data->stream.get()), requestData.data(), requestData.size());
-    if (webkitSoupRequestInputStreamFinished(WEBKIT_SOUP_REQUEST_INPUT_STREAM(data->stream.get())))
-        m_requestMap.remove(requestID);
-}
-
-void WebSoupRequestManager::didFailURIRequest(const WebCore::ResourceError& error, uint64_t requestID)
-{
-    WebSoupRequestAsyncData* data = m_requestMap.get(requestID);
-    ASSERT(data);
-    GRefPtr<GTask> task = data->releaseTask();
-    ASSERT(task.get());
-
-    g_task_return_new_error(task.get(), g_quark_from_string(error.domain().utf8().data()),
-        error.errorCode(), "%s", error.localizedDescription().utf8().data());
-    m_requestMap.remove(requestID);
-}
-
-void WebSoupRequestManager::send(GTask* task)
-{
-    WebKitSoupRequestGeneric* request = WEBKIT_SOUP_REQUEST_GENERIC(g_task_get_source_object(task));
-    SoupRequest* soupRequest = SOUP_REQUEST(request);
-    GUniquePtr<char> uriString(soup_uri_to_string(soup_request_get_uri(soupRequest), FALSE));
-
-    uint64_t requestID = generateSoupRequestID();
-    m_requestMap.set(requestID, std::make_unique<WebSoupRequestAsyncData>(task, request));
-
-    uint64_t initiatingPageID = WebCore::ResourceRequest(soupRequest).initiatingPageID();
-    m_process->parentProcessConnection()->send(Messages::WebPageProxy::DidReceiveURIRequest(String::fromUTF8(uriString.get()), requestID), initiatingPageID);
-}
-
-GInputStream* WebSoupRequestManager::finish(GTask* task, GError** error)
-{
-    gpointer inputStream = g_task_propagate_pointer(task, error);
-    return inputStream ? G_INPUT_STREAM(inputStream) : 0;
-}
-
-} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/soup/WebSoupRequestManager.messages.in b/Source/WebKit2/WebProcess/soup/WebSoupRequestManager.messages.in
deleted file mode 100644 (file)
index 24afa95..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2012 Igalia S.L.
-#
-# 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.
-
-messages -> WebSoupRequestManager {
-    RegisterURIScheme(String uriScheme);
-    DidHandleURIRequest(IPC::DataReference requestData, uint64_t contentLength, String mimeType, uint64_t requestID);
-    DidReceiveURIRequestData(IPC::DataReference requestData, uint64_t requestID);
-    DidFailURIRequest(WebCore::ResourceError error, uint64_t requestID);
-}