[EFL] Enable custom URI schemes with CustomProtocols
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Oct 2014 06:37:40 +0000 (06:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Oct 2014 06:37:40 +0000 (06:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=128177

Patch by Pascal Jacquemart <p.jacquemart@samsung.com> on 2014-10-07
Reviewed by Gyuyoung Kim.

Fixing ewk_context_url_scheme_register() ewebkit2 API
rely on r162449 - CustomProtocols implementation from Carlos Garcia Campos

.:

* Source/cmake/OptionsEfl.cmake: Forcing CUSTOM_PROTOCOLS flag

Source/WebKit2:

* PlatformEfl.cmake:
* UIProcess/API/efl/ewk_context.h:
* UIProcess/API/efl/ewk_url_scheme_request.cpp:
(EwkUrlSchemeRequest::EwkUrlSchemeRequest):
(EwkUrlSchemeRequest::finish):
* UIProcess/API/efl/ewk_url_scheme_request_private.h:
(EwkUrlSchemeRequest::create):
* UIProcess/API/efl/tests/test_ewk2_context.cpp:
(TEST_F):
* UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp:
* UIProcess/efl/RequestManagerClientEfl.cpp:
(WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
(WebKit::RequestManagerClientEfl::startLoading):
(WebKit::RequestManagerClientEfl::stopLoading):
(WebKit::RequestManagerClientEfl::registerURLSchemeHandler):
(WebKit::EwkUrlSchemeHandler::EwkUrlSchemeHandler): Deleted.
(WebKit::RequestManagerClientEfl::didReceiveURIRequest): Deleted.
* UIProcess/efl/RequestManagerClientEfl.h:
* UIProcess/efl/WebContextEfl.cpp:
(WebKit::WebContext::platformInitializeWebProcess):
* UIProcess/soup/WebContextSoup.cpp:
(WebKit::WebContext::platformInitializeNetworkProcess):

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

13 files changed:
ChangeLog
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformEfl.cmake
Source/WebKit2/UIProcess/API/efl/ewk_context.h
Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp
Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h
Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp
Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp
Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp
Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h
Source/WebKit2/UIProcess/efl/WebContextEfl.cpp
Source/WebKit2/UIProcess/soup/WebContextSoup.cpp
Source/cmake/OptionsEfl.cmake

index 9c88736..1bf54d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2014-10-07  Pascal Jacquemart  <p.jacquemart@samsung.com>
+
+        [EFL] Enable custom URI schemes with CustomProtocols
+        https://bugs.webkit.org/show_bug.cgi?id=128177
+
+        Reviewed by Gyuyoung Kim.
+
+        Fixing ewk_context_url_scheme_register() ewebkit2 API
+        rely on r162449 - CustomProtocols implementation from Carlos Garcia Campos
+
+        * Source/cmake/OptionsEfl.cmake: Forcing CUSTOM_PROTOCOLS flag
+
 2014-10-01  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         Bump version to 2.7.0
index 7f85831..e07873d 100644 (file)
@@ -1,3 +1,36 @@
+2014-10-07  Pascal Jacquemart  <p.jacquemart@samsung.com>
+
+        [EFL] Enable custom URI schemes with CustomProtocols
+        https://bugs.webkit.org/show_bug.cgi?id=128177
+
+        Reviewed by Gyuyoung Kim.
+
+        Fixing ewk_context_url_scheme_register() ewebkit2 API
+        rely on r162449 - CustomProtocols implementation from Carlos Garcia Campos
+
+        * PlatformEfl.cmake:
+        * UIProcess/API/efl/ewk_context.h:
+        * UIProcess/API/efl/ewk_url_scheme_request.cpp:
+        (EwkUrlSchemeRequest::EwkUrlSchemeRequest):
+        (EwkUrlSchemeRequest::finish):
+        * UIProcess/API/efl/ewk_url_scheme_request_private.h:
+        (EwkUrlSchemeRequest::create):
+        * UIProcess/API/efl/tests/test_ewk2_context.cpp:
+        (TEST_F):
+        * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp:
+        * UIProcess/efl/RequestManagerClientEfl.cpp:
+        (WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
+        (WebKit::RequestManagerClientEfl::startLoading):
+        (WebKit::RequestManagerClientEfl::stopLoading):
+        (WebKit::RequestManagerClientEfl::registerURLSchemeHandler):
+        (WebKit::EwkUrlSchemeHandler::EwkUrlSchemeHandler): Deleted.
+        (WebKit::RequestManagerClientEfl::didReceiveURIRequest): Deleted.
+        * UIProcess/efl/RequestManagerClientEfl.h:
+        * UIProcess/efl/WebContextEfl.cpp:
+        (WebKit::WebContext::platformInitializeWebProcess):
+        * UIProcess/soup/WebContextSoup.cpp:
+        (WebKit::WebContext::platformInitializeNetworkProcess):
+
 2014-10-07  Sungmann Cho  <sungmann.cho@navercorp.com>
 
         Remove WKPageCreateSnapshotOfVisibleContent API.
index fb8bcab..c0bdece 100644 (file)
@@ -30,6 +30,9 @@ list(APPEND WebKit2_SOURCES
 
     Shared/Downloads/soup/DownloadSoup.cpp
 
+    Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp
+    Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp
+
     Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
 
     Shared/cairo/ShareableBitmapCairo.cpp
@@ -67,9 +70,8 @@ list(APPEND WebKit2_SOURCES
     UIProcess/API/C/efl/WKPopupMenuListener.cpp
     UIProcess/API/C/efl/WKViewEfl.cpp
 
-    UIProcess/API/C/soup/WKContextSoup.cpp
     UIProcess/API/C/soup/WKCookieManagerSoup.cpp
-    UIProcess/API/C/soup/WKSoupRequestManager.cpp
+    UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp
 
     UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp
 
@@ -125,6 +127,10 @@ list(APPEND WebKit2_SOURCES
 
     UIProcess/Launcher/efl/ProcessLauncherEfl.cpp
 
+    UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp
+    UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp
+    UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp
+
     UIProcess/Network/soup/NetworkProcessProxySoup.cpp
 
     UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
@@ -169,8 +175,6 @@ list(APPEND WebKit2_SOURCES
 
     UIProcess/soup/WebContextSoup.cpp
     UIProcess/soup/WebCookieManagerProxySoup.cpp
-    UIProcess/soup/WebSoupRequestManagerClient.cpp
-    UIProcess/soup/WebSoupRequestManagerProxy.cpp
 
     WebProcess/Cookies/soup/WebCookieManagerSoup.cpp
     WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp
@@ -206,17 +210,12 @@ list(APPEND WebKit2_SOURCES
     WebProcess/soup/WebKitSoupRequestGeneric.cpp
     WebProcess/soup/WebKitSoupRequestInputStream.cpp
     WebProcess/soup/WebProcessSoup.cpp
-    WebProcess/soup/WebSoupRequestManager.cpp
 )
 
 list(APPEND WebKit2_MESSAGES_IN_FILES
     UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in
 
-    UIProcess/soup/WebSoupRequestManagerProxy.messages.in
-
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.messages.in
-
-    WebProcess/soup/WebSoupRequestManager.messages.in
 )
 
 list(APPEND WebKit2_INCLUDE_DIRECTORIES
@@ -232,6 +231,7 @@ list(APPEND WebKit2_INCLUDE_DIRECTORIES
     "${WEBKIT2_DIR}/Shared/API/c/efl"
     "${WEBKIT2_DIR}/Shared/CoordinatedGraphics"
     "${WEBKIT2_DIR}/Shared/Downloads/soup"
+    "${WEBKIT2_DIR}/Shared/Network/CustomProtocols/soup"
     "${WEBKIT2_DIR}/Shared/efl"
     "${WEBKIT2_DIR}/Shared/soup"
     "${WEBKIT2_DIR}/Shared/unix"
index e17670b..dd91b68 100644 (file)
@@ -260,7 +260,7 @@ EAPI Ewk_Storage_Manager *ewk_context_storage_manager_get(const Ewk_Context *con
  * When an URL request with @a scheme is made in the #Ewk_Context, the callback
  * function provided will be called with a #Ewk_Url_Scheme_Request.
  *
- * It is possible to handle URL scheme requests asynchronously, by calling ewk_url_scheme_ref() on the
+ * It is possible to handle URL scheme requests asynchronously, by calling ewk_object_ref() on the
  * #Ewk_Url_Scheme_Request and calling ewk_url_scheme_request_finish() later when the data of
  * the request is available.
  *
@@ -270,24 +270,20 @@ EAPI Ewk_Storage_Manager *ewk_context_storage_manager_get(const Ewk_Context *con
  * @param user_data data to pass to callback function
  *
  * @code
- * static void about_url_scheme_request_cb(Ewk_Url_Scheme_Request *request, void *user_data)
+ * static void custom_url_scheme_request_cb(Ewk_Url_Scheme_Request *request, void *user_data)
  * {
- *     const char *path;
+ *     const char *scheme;
  *     char *contents_data = NULL;
- *     unsigned int contents_length = 0;
- *
- *     path = ewk_url_scheme_request_path_get(request);
- *     if (!strcmp(path, "plugins")) {
- *         // Initialize contents_data with the contents of plugins about page, and set its length to contents_length
- *     } else if (!strcmp(path, "memory")) {
- *         // Initialize contents_data with the contents of memory about page, and set its length to contents_length
- *     } else if (!strcmp(path, "applications")) {
- *         // Initialize contents_data with the contents of application about page, and set its length to contents_length
+ *     unsigned contents_length = 0;
+ *
+ *     scheme = ewk_url_scheme_request_scheme_get(request);
+ *     if (!strcmp(scheme, "myapp")) {
+ *         // Initialize contents_data with a welcome page, and set its length to contents_length
  *     } else {
  *         Eina_Strbuf *buf = eina_strbuf_new();
- *         eina_strbuf_append_printf(buf, "&lt;html&gt;&lt;body&gt;&lt;p&gt;Invalid about:%s page&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;", path);
+ *         eina_strbuf_append_printf(buf, "&lt;html&gt;&lt;body&gt;&lt;p&gt;Invalid application: %s&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;", scheme);
  *         contents_data = eina_strbuf_string_steal(buf);
- *         contents_length = strlen(contents);
+ *         contents_length = strlen(contents_data);
  *         eina_strbuf_free(buf);
  *     }
  *     ewk_url_scheme_request_finish(request, contents_data, contents_length, "text/html");
index 99ff274..f4b90c8 100644 (file)
 #include "WKData.h"
 #include "WKString.h"
 #include "WKURL.h"
+#include "WebSoupCustomProtocolRequestManager.h"
+
 #include "ewk_url_scheme_request_private.h"
 
 using namespace WebKit;
 
-EwkUrlSchemeRequest::EwkUrlSchemeRequest(WKSoupRequestManagerRef manager, WKURLRef url, uint64_t requestID)
+EwkUrlSchemeRequest::EwkUrlSchemeRequest(WKSoupCustomProtocolRequestManagerRef manager, API::URLRequest* urlRequest, uint64_t requestID)
     : m_wkRequestManager(manager)
-    , m_url(url)
     , m_requestID(requestID)
-    , m_scheme(AdoptWK, WKURLCopyScheme(url))
-    , m_path(AdoptWK, WKURLCopyPath(url))
 {
+    WKURLRef url = toCopiedURLAPI(urlRequest->resourceRequest().url());
+    m_url = WKEinaSharedString(url);
+    m_scheme = WKEinaSharedString(AdoptWK, WKURLCopyScheme(url));
+    m_path = WKEinaSharedString(AdoptWK, WKURLCopyPath(url));
 }
 
 uint64_t EwkUrlSchemeRequest::id() const
@@ -68,7 +71,13 @@ void EwkUrlSchemeRequest::finish(const void* contentData, uint64_t contentLength
     WKRetainPtr<WKStringRef> wkMimeType = mimeType ? adoptWK(WKStringCreateWithUTF8CString(mimeType)) : 0;
 
     // In case of empty reply an empty WKDataRef is sent to the WebProcess.
-    WKSoupRequestManagerDidHandleURIRequest(m_wkRequestManager.get(), wkData.get(), contentLength, wkMimeType.get(), m_requestID);
+    WebCore::ResourceResponse response(WebCore::URL(WebCore::URL(), String::fromUTF8(m_url)),
+        String::fromUTF8(mimeType), contentLength, emptyString());
+
+    toImpl(m_wkRequestManager.get())->didReceiveResponse(m_requestID, response);
+    toImpl(m_wkRequestManager.get())->didLoadData(m_requestID, toImpl(wkData.get()));
+    toImpl(m_wkRequestManager.get())->didFinishLoading(m_requestID);
+    toImpl(m_wkRequestManager.get())->stopLoading(m_requestID);
 }
 
 const char* ewk_url_scheme_request_scheme_get(const Ewk_Url_Scheme_Request* request)
index 0514738..9a404c7 100644 (file)
@@ -30,7 +30,7 @@
 #include "WKBase.h"
 #include "WKEinaSharedString.h"
 #include "WKRetainPtr.h"
-#include "WKSoupRequestManager.h"
+#include "WKSoupCustomProtocolRequestManager.h"
 #include "ewk_object_private.h"
 
 /**
@@ -41,12 +41,12 @@ class EwkUrlSchemeRequest : public EwkObject {
 public:
     EWK_OBJECT_DECLARE(EwkUrlSchemeRequest)
 
-    static PassRefPtr<EwkUrlSchemeRequest> create(WKSoupRequestManagerRef manager, WKURLRef url, uint64_t requestID)
+    static PassRefPtr<EwkUrlSchemeRequest> create(WKSoupCustomProtocolRequestManagerRef manager, API::URLRequest* urlRequest, uint64_t requestID)
     {
-        if (!manager || !url)
+        if (!manager || !urlRequest)
             return 0;
 
-        return adoptRef(new EwkUrlSchemeRequest(manager, url, requestID));
+        return adoptRef(new EwkUrlSchemeRequest(manager, urlRequest, requestID));
     }
 
     uint64_t id() const;
@@ -57,9 +57,9 @@ public:
     void finish(const void* contentData, uint64_t contentLength, const char* mimeType);
 
 private:
-    EwkUrlSchemeRequest(WKSoupRequestManagerRef manager, WKURLRef urlRef, uint64_t requestID);
+    EwkUrlSchemeRequest(WKSoupCustomProtocolRequestManagerRef manager, API::URLRequest* urlRequest, uint64_t requestID);
 
-    WKRetainPtr<WKSoupRequestManagerRef> m_wkRequestManager;
+    WKRetainPtr<WKSoupCustomProtocolRequestManagerRef> m_wkRequestManager;
     WKEinaSharedString m_url;
     uint64_t m_requestID;
     WKEinaSharedString m_scheme;
index c6447e4..dbb6878 100644 (file)
@@ -115,12 +115,10 @@ TEST_F(EWK2ContextTest, ewk_context_storage_manager_get)
 
 TEST_F(EWK2ContextTest, ewk_context_url_scheme_register)
 {
-#if ENABLE(CUSTOM_PROTOCOL)
-    ewk_context_url_scheme_register(ewk_view_context_get(webView()), "fooscheme", schemeRequestCallback, 0);
+    ewk_context_url_scheme_register(ewk_view_context_get(webView()), "fooscheme", schemeRequestCallback, nullptr);
     ewk_view_url_set(webView(), "fooscheme:MyPath");
 
     ASSERT_TRUE(waitUntilTrue(finishTest, testTimeoutSeconds));
-#endif
 }
 
 TEST_F(EWK2ContextTest, ewk_context_cache_model)
index 06e1a9f..839b5f4 100644 (file)
 #include "config.h"
 #include "RequestManagerClientEfl.h"
 
-#include "WKContextSoup.h"
-#include "WKSoupRequestManager.h"
 #include "ewk_context_private.h"
 #include "ewk_url_scheme_request_private.h"
 
 namespace WebKit {
 
-struct EwkUrlSchemeHandler {
-    Ewk_Url_Scheme_Request_Cb callback;
-    void* userData;
-
-    EwkUrlSchemeHandler()
-        : callback(0)
-        , userData(0)
-    { }
-
-    EwkUrlSchemeHandler(Ewk_Url_Scheme_Request_Cb callback, void* userData)
-        : callback(callback)
-        , userData(userData)
-    { }
-};
-
 static inline RequestManagerClientEfl* toRequestManagerClientEfl(const void* clientInfo)
 {
     return static_cast<RequestManagerClientEfl*>(const_cast<void*>(clientInfo));
 }
 
-void RequestManagerClientEfl::didReceiveURIRequest(WKSoupRequestManagerRef soupRequestManagerRef, WKURLRef urlRef, WKPageRef, uint64_t requestID, const void* clientInfo)
-{
-    RequestManagerClientEfl* requestManager = toRequestManagerClientEfl(clientInfo);
-
-    RefPtr<EwkUrlSchemeRequest> schemeRequest = EwkUrlSchemeRequest::create(soupRequestManagerRef, urlRef, requestID);
-    EwkUrlSchemeHandler handler = requestManager->m_urlSchemeHandlers.get(schemeRequest->scheme());
-    if (!handler.callback)
-        return;
-
-    handler.callback(schemeRequest.get(), handler.userData);
-}
-
 RequestManagerClientEfl::RequestManagerClientEfl(WKContextRef context)
-    : m_soupRequestManager(WKContextGetSoupRequestManager(context))
 {
+    m_requestManager = toAPI(toImpl(context)->supplement<WebSoupCustomProtocolRequestManager>());
     ASSERT(m_soupRequestManager);
 
-    WKSoupRequestManagerClientV0 wkRequestManagerClient;
-    memset(&wkRequestManagerClient, 0, sizeof(WKSoupRequestManagerClientV0));
+    WKSoupCustomProtocolRequestManagerClientV0 wkRequestManagerClient;
+    memset(&wkRequestManagerClient, 0, sizeof(WKSoupCustomProtocolRequestManagerClientV0));
 
     wkRequestManagerClient.base.version = 0;
     wkRequestManagerClient.base.clientInfo = this;
-    wkRequestManagerClient.didReceiveURIRequest = didReceiveURIRequest;
+    wkRequestManagerClient.startLoading = startLoading;
+    wkRequestManagerClient.stopLoading = stopLoading;
 
-    WKSoupRequestManagerSetClient(m_soupRequestManager.get(), &wkRequestManagerClient.base);
+    WKSoupCustomProtocolRequestManagerSetClient(m_requestManager.get(), &wkRequestManagerClient.base);
 }
 
-RequestManagerClientEfl::~RequestManagerClientEfl()
+void RequestManagerClientEfl::startLoading(WKSoupCustomProtocolRequestManagerRef manager, uint64_t customProtocolID, WKURLRequestRef requestRef, const void* clientInfo)
 {
+    RequestManagerClientEfl* client = toRequestManagerClientEfl(clientInfo);
+    RefPtr<EwkUrlSchemeRequest> request = EwkUrlSchemeRequest::create(manager, toImpl(requestRef), customProtocolID);
+    String scheme(String::fromUTF8(request.get()->scheme()));
+    RefPtr<WebKitURISchemeHandler> handler = (client->m_uriSchemeHandlers).get(scheme);
+    ASSERT(handler.get());
+    if (!handler->hasCallback())
+        return;
+
+    (client->m_uriSchemeRequests).set(customProtocolID, request);
+    handler->performCallback(request.get());
+}
+
+void RequestManagerClientEfl::stopLoading(WKSoupCustomProtocolRequestManagerRef manager, uint64_t customProtocolID, const void* clientInfo)
+{
+    UNUSED_PARAM(manager);
+
+    RequestManagerClientEfl* client = toRequestManagerClientEfl(clientInfo);
+    (client->m_uriSchemeRequests).remove(customProtocolID);
 }
 
 void RequestManagerClientEfl::registerURLSchemeHandler(const String& scheme, Ewk_Url_Scheme_Request_Cb callback, void* userData)
 {
     ASSERT(callback);
 
-    m_urlSchemeHandlers.set(scheme, EwkUrlSchemeHandler(callback, userData));
-    WKSoupRequestManagerRegisterURIScheme(m_soupRequestManager.get(), adoptWK(toCopiedAPI(scheme)).get());
+    RefPtr<WebKitURISchemeHandler> handler = adoptRef(new WebKitURISchemeHandler(callback, userData));
+    m_uriSchemeHandlers.set(scheme, handler);
+    toImpl(m_requestManager.get())->registerSchemeForCustomProtocol(scheme);
 }
 
 } // namespace WebKit
index c9049f6..eabd67d 100644 (file)
 #ifndef RequestManagerClientEfl_h
 #define RequestManagerClientEfl_h
 
+#include "WebContext.h"
+#include "WebSoupCustomProtocolRequestManager.h"
 #include "ewk_context_private.h"
+#include "ewk_url_scheme_request_private.h"
+
 #include <WebKit/WKBase.h>
 #include <WebKit/WKRetainPtr.h>
 #include <wtf/HashMap.h>
 
 namespace WebKit {
 
+class WebKitURISchemeHandler: public RefCounted<WebKitURISchemeHandler> {
+public:
+    WebKitURISchemeHandler()
+        : m_callback(nullptr)
+        , m_userData(nullptr)
+    {
+    }
+
+    WebKitURISchemeHandler(Ewk_Url_Scheme_Request_Cb callback, void* userData)
+        : m_callback(callback)
+        , m_userData(userData)
+    {
+    }
+
+    bool hasCallback()
+    {
+        return m_callback;
+    }
+
+    void performCallback(EwkUrlSchemeRequest* request)
+    {
+        ASSERT(m_callback);
+
+        m_callback(request, m_userData);
+    }
+
+private:
+    Ewk_Url_Scheme_Request_Cb m_callback;
+    void* m_userData;
+};
+
+typedef HashMap<String, RefPtr<WebKitURISchemeHandler> > URISchemeHandlerMap;
+typedef HashMap<uint64_t, RefPtr<EwkUrlSchemeRequest> > URISchemeRequestMap;
+
 class RequestManagerClientEfl {
 public:
     explicit RequestManagerClientEfl(WKContextRef);
-    ~RequestManagerClientEfl();
 
     void registerURLSchemeHandler(const String& scheme, Ewk_Url_Scheme_Request_Cb callback, void* userData);
 
 private:
-    static void didReceiveURIRequest(WKSoupRequestManagerRef, WKURLRef, WKPageRef, uint64_t requestID, const void* clientInfo);
+    static void startLoading(WKSoupCustomProtocolRequestManagerRef, uint64_t customProtocolID, WKURLRequestRef, const void* clientInfo);
+    static void stopLoading(WKSoupCustomProtocolRequestManagerRef, uint64_t customProtocolID, const void* clientInfo);
 
-    WKRetainPtr<WKSoupRequestManagerRef> m_soupRequestManager;
-    HashMap<String, class EwkUrlSchemeHandler> m_urlSchemeHandlers;
+    WKRetainPtr<WKSoupCustomProtocolRequestManagerRef> m_requestManager;
+    URISchemeHandlerMap m_uriSchemeHandlers;
+    URISchemeRequestMap m_uriSchemeRequests;
 };
 
 } // namespace WebKit
index 38c6ae1..4d9160d 100644 (file)
@@ -31,7 +31,7 @@
 #include "WebInspectorServer.h"
 #include "WebProcessCreationParameters.h"
 #include "WebProcessMessages.h"
-#include "WebSoupRequestManagerProxy.h"
+#include "WebSoupCustomProtocolRequestManager.h"
 #include <Efreet.h>
 #include <WebCore/ApplicationCacheStorage.h>
 #include <WebCore/IconDatabase.h>
@@ -89,7 +89,7 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
 {
     initializeInspectorServer();
 
-    parameters.urlSchemesRegistered = supplement<WebSoupRequestManagerProxy>()->registeredURISchemes();
+    parameters.urlSchemesRegisteredForCustomProtocols = supplement<WebSoupCustomProtocolRequestManager>()->registeredSchemesForCustomProtocols();
     supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType);
     parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
     parameters.ignoreTLSErrors = m_ignoreTLSErrors;
index 43ee671..7b2210d 100644 (file)
@@ -40,9 +40,7 @@ void WebContext::platformInitializeNetworkProcess(NetworkProcessCreationParamete
     parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
     parameters.ignoreTLSErrors = m_ignoreTLSErrors;
     parameters.languages = WebCore::userPreferredLanguages();
-#if ENABLE(CUSTOM_PROTOCOLS)
     parameters.urlSchemesRegisteredForCustomProtocols = supplement<WebSoupCustomProtocolRequestManager>()->registeredSchemesForCustomProtocols();
-#endif
 }
 
 }
index 1dd1503..cc939d0 100644 (file)
@@ -308,5 +308,7 @@ if (ENABLE_FTL_JIT)
     set(HAVE_LLVM ON)
 endif ()
 
+add_definitions(-DENABLE_CUSTOM_PROTOCOLS=1)
+
 # [E]WebKit2 tests need a hint to find out where processes such as WebProcess are located at.
 add_definitions(-DWEBKIT_EXEC_PATH=\"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}\")