WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
After final review
0001-EFL-Enable-custom-URI-schemes-with-CustomProtocols.patch (text/plain), 23.35 KB, created by
Pascal Jacquemart
on 2014-10-07 01:43:18 PDT
(
hide
)
Description:
After final review
Filename:
MIME Type:
Creator:
Pascal Jacquemart
Created:
2014-10-07 01:43:18 PDT
Size:
23.35 KB
patch
obsolete
>From e6a76752af5bd2f097789ce764ac01be714c3617 Mon Sep 17 00:00:00 2001 >From: "p.jacquemart" <p.jacquemart@samsung.com> >Date: Fri, 3 Oct 2014 18:34:34 +0100 >Subject: [PATCH] [EFL] Enable custom-URI schemes with CustomProtocols > >--- > ChangeLog | 12 ++++ > Source/WebKit2/ChangeLog | 33 ++++++++++ > Source/WebKit2/PlatformEfl.cmake | 18 +++--- > Source/WebKit2/UIProcess/API/efl/ewk_context.h | 24 +++----- > .../UIProcess/API/efl/ewk_url_scheme_request.cpp | 19 ++++-- > .../API/efl/ewk_url_scheme_request_private.h | 12 ++-- > .../UIProcess/API/efl/tests/test_ewk2_context.cpp | 4 +- > .../soup/WebSoupCustomProtocolRequestManager.cpp | 2 + > .../UIProcess/efl/RequestManagerClientEfl.cpp | 65 +++++++++----------- > .../UIProcess/efl/RequestManagerClientEfl.h | 47 ++++++++++++-- > Source/WebKit2/UIProcess/efl/WebContextEfl.cpp | 4 +- > Source/WebKit2/UIProcess/soup/WebContextSoup.cpp | 2 - > Source/cmake/OptionsEfl.cmake | 2 + > 13 files changed, 162 insertions(+), 82 deletions(-) > >diff --git a/ChangeLog b/ChangeLog >index 9c88736..d92566d 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,15 @@ >+2014-10-03 Pascal Jacquemart <p.jacquemart@samsung.com> >+ >+ [EFL] Enable custom URI schemes with CustomProtocols >+ https://bugs.webkit.org/show_bug.cgi?id=128177 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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 >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 5e052ab..b2802bb 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,36 @@ >+2014-10-03 Pascal Jacquemart <p.jacquemart@samsung.com> >+ >+ [EFL] Enable custom URI schemes with CustomProtocols >+ https://bugs.webkit.org/show_bug.cgi?id=128177 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-03 Csaba Osztrogonác <ossy@webkit.org> > > [GTK] URTBF after r174231. >diff --git a/Source/WebKit2/PlatformEfl.cmake b/Source/WebKit2/PlatformEfl.cmake >index 1982610..4a38362 100644 >--- a/Source/WebKit2/PlatformEfl.cmake >+++ b/Source/WebKit2/PlatformEfl.cmake >@@ -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 >@@ -203,17 +207,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 >@@ -229,6 +228,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" >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context.h b/Source/WebKit2/UIProcess/API/efl/ewk_context.h >index bc7b054..1c65fe3 100644 >--- a/Source/WebKit2/UIProcess/API/efl/ewk_context.h >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_context.h >@@ -257,7 +257,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. > * >@@ -267,24 +267,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, "<html><body><p>Invalid about:%s page</p></body></html>", path); >+ * eina_strbuf_append_printf(buf, "<html><body><p>Invalid application: %s</p></body></html>", 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"); >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp >index 99ff274..f4b90c8 100644 >--- a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp >@@ -29,17 +29,20 @@ > #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) >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h >index 0514738..9a404c7 100644 >--- a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h >@@ -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; >diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp >index 3f1470a..602cc68 100644 >--- a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp >+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp >@@ -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) >diff --git a/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp b/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp >index ad73ad4..59e2589 100644 >--- a/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp >+++ b/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp >@@ -31,6 +31,8 @@ > > #if PLATFORM(GTK) > #include <WebCore/ErrorsGtk.h> >+#elif PLATFORM(EFL) >+#include <WebCore/ErrorsEfl.h> > #endif > > namespace WebKit { >diff --git a/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp b/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp >index 06e1a9f..839b5f4 100644 >--- a/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp >+++ b/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp >@@ -26,70 +26,61 @@ > #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 >diff --git a/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h b/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h >index c9049f6..eabd67d 100644 >--- a/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h >+++ b/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h >@@ -26,7 +26,11 @@ > #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> >@@ -34,18 +38,53 @@ > > 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 >diff --git a/Source/WebKit2/UIProcess/efl/WebContextEfl.cpp b/Source/WebKit2/UIProcess/efl/WebContextEfl.cpp >index 38c6ae1..4d9160d 100644 >--- a/Source/WebKit2/UIProcess/efl/WebContextEfl.cpp >+++ b/Source/WebKit2/UIProcess/efl/WebContextEfl.cpp >@@ -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; >diff --git a/Source/WebKit2/UIProcess/soup/WebContextSoup.cpp b/Source/WebKit2/UIProcess/soup/WebContextSoup.cpp >index 43ee671..7b2210d 100644 >--- a/Source/WebKit2/UIProcess/soup/WebContextSoup.cpp >+++ b/Source/WebKit2/UIProcess/soup/WebContextSoup.cpp >@@ -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 > } > > } >diff --git a/Source/cmake/OptionsEfl.cmake b/Source/cmake/OptionsEfl.cmake >index 1dd1503..cc939d0 100644 >--- a/Source/cmake/OptionsEfl.cmake >+++ b/Source/cmake/OptionsEfl.cmake >@@ -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}\") >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 128177
:
238932
|
239027
|
239030
|
239101
|
239104
|
239211
| 239401