WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
wk2-gtk-custom-protocols.diff (text/plain), 25.70 KB, created by
Carlos Garcia Campos
on 2014-01-16 03:09:41 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2014-01-16 03:09:41 PST
Size:
25.70 KB
patch
obsolete
>diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index bfccc3e..45df8ca 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,5 +1,43 @@ > 2014-01-16 Carlos Garcia Campos <cgarcia@igalia.com> > >+ [GTK] Implement custom URI schemes with CustomProtocols >+ https://bugs.webkit.org/show_bug.cgi?id=127091 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The old classes are no longer built for GTK+ and should be removed once >+ other ports using soup backend switch to custom protocols implementation. >+ >+ * GNUmakefile.am: Remove include path. >+ * GNUmakefile.list.am: Remove files from compilation. >+ * PlatformGTK.cmake: Ditto. >+ * UIProcess/API/gtk/WebKitPrivate.h: >+ * UIProcess/API/gtk/WebKitRequestManagerClient.cpp: >+ (startLoading): >+ (stopLoading): >+ (attachRequestManagerClientToContext): >+ * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: >+ (webkitURISchemeRequestCreate): >+ (webkit_uri_scheme_request_get_web_view): >+ (webkitURISchemeRequestReadCallback): >+ (webkit_uri_scheme_request_finish): >+ (webkit_uri_scheme_request_finish_error): >+ * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h: >+ * UIProcess/API/gtk/WebKitWebContext.cpp: >+ (createDefaultWebContext): >+ (webkit_web_context_register_uri_scheme): >+ (webkitWebContextGetRequestManager): >+ (webkitWebContextStartLoadingCustomProtocol): >+ (webkitWebContextStopLoadingCustomProtocol): >+ (webkitWebContextDidFinishLoadingCustomProtocol): >+ * UIProcess/API/gtk/WebKitWebContextPrivate.h: >+ * UIProcess/gtk/WebContextGtk.cpp: >+ (WebKit::WebContext::platformInitializeWebProcess): >+ * WebKit2Prefix.h: Enable CustomProtocols unconditionally for the >+ GTK+ port. >+ >+2014-01-16 Carlos Garcia Campos <cgarcia@igalia.com> >+ > [SOUP] Implement CUSTOM PROTOCOLS > https://bugs.webkit.org/show_bug.cgi?id=125583 > >diff --git a/Source/WebKit2/GNUmakefile.am b/Source/WebKit2/GNUmakefile.am >index 1b453c4..c299b1f 100644 >--- a/Source/WebKit2/GNUmakefile.am >+++ b/Source/WebKit2/GNUmakefile.am >@@ -428,7 +428,6 @@ vpath %.messages.in = \ > $(WebKit2)/UIProcess/Plugins \ > $(WebKit2)/UIProcess/ResourceCache \ > $(WebKit2)/UIProcess/Storage \ >- $(WebKit2)/UIProcess/soup \ > $(WebKit2)/WebProcess \ > $(WebKit2)/WebProcess/ApplicationCache \ > $(WebKit2)/WebProcess/Battery \ >diff --git a/Source/WebKit2/GNUmakefile.list.am b/Source/WebKit2/GNUmakefile.list.am >index 44a0155..bd90d8f 100644 >--- a/Source/WebKit2/GNUmakefile.list.am >+++ b/Source/WebKit2/GNUmakefile.list.am >@@ -160,10 +160,6 @@ webkit2_built_sources += \ > DerivedSources/WebKit2/WebResourceCacheManagerProxyMessages.h \ > DerivedSources/WebKit2/WebResourceLoaderMessageReceiver.cpp \ > DerivedSources/WebKit2/WebResourceLoaderMessages.h \ >- DerivedSources/WebKit2/WebSoupRequestManagerMessageReceiver.cpp \ >- DerivedSources/WebKit2/WebSoupRequestManagerMessages.h \ >- DerivedSources/WebKit2/WebSoupRequestManagerProxyMessageReceiver.cpp \ >- DerivedSources/WebKit2/WebSoupRequestManagerProxyMessages.h \ > DerivedSources/WebKit2/WebVibrationProxyMessageReceiver.cpp \ > DerivedSources/WebKit2/WebVibrationProxyMessages.h > >@@ -519,10 +515,6 @@ webkit2_sources += \ > Source/WebKit2/UIProcess/API/C/gtk/WKView.h \ > Source/WebKit2/UIProcess/API/C/gtk/WKViewPrivate.h \ > Source/WebKit2/UIProcess/API/C/soup/WKAPICastSoup.h \ >- Source/WebKit2/UIProcess/API/C/soup/WKContextSoup.cpp \ >- Source/WebKit2/UIProcess/API/C/soup/WKContextSoup.h \ >- Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.cpp \ >- Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.h \ > Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp \ > Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h \ > Source/WebKit2/UIProcess/API/C/WebKit2_C.h \ >@@ -884,10 +876,6 @@ webkit2_sources += \ > Source/WebKit2/UIProcess/Storage/StorageManager.h \ > Source/WebKit2/UIProcess/soup/WebContextSoup.cpp \ > Source/WebKit2/UIProcess/soup/WebCookieManagerProxySoup.cpp \ >- Source/WebKit2/UIProcess/soup/WebSoupRequestManagerClient.cpp \ >- Source/WebKit2/UIProcess/soup/WebSoupRequestManagerClient.h \ >- Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp \ >- Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.h \ > Source/WebKit2/UIProcess/TextChecker.h \ > Source/WebKit2/UIProcess/TextCheckerCompletion.h \ > Source/WebKit2/UIProcess/TextCheckerCompletion.cpp \ >@@ -1186,8 +1174,6 @@ webkit2_sources += \ > Source/WebKit2/WebProcess/Storage/StorageAreaMap.h \ > Source/WebKit2/WebProcess/Storage/StorageNamespaceImpl.cpp \ > Source/WebKit2/WebProcess/Storage/StorageNamespaceImpl.h \ >- Source/WebKit2/WebProcess/soup/WebSoupRequestManager.cpp \ >- Source/WebKit2/WebProcess/soup/WebSoupRequestManager.h \ > Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp \ > Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp \ > Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.h \ >diff --git a/Source/WebKit2/PlatformGTK.cmake b/Source/WebKit2/PlatformGTK.cmake >index 258a80c..611719c 100644 >--- a/Source/WebKit2/PlatformGTK.cmake >+++ b/Source/WebKit2/PlatformGTK.cmake >@@ -76,9 +76,7 @@ list(APPEND WebKit2_SOURCES > UIProcess/API/C/gtk/WKInspectorClientGtk.cpp > UIProcess/API/C/gtk/WKView.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/gtk/PageClientImpl.cpp >@@ -261,8 +259,6 @@ list(APPEND WebKit2_SOURCES > UIProcess/gtk/WebProcessProxyGtk.cpp > > UIProcess/soup/WebCookieManagerProxySoup.cpp >- UIProcess/soup/WebSoupRequestManagerClient.cpp >- UIProcess/soup/WebSoupRequestManagerProxy.cpp > > WebProcess/Cookies/soup/WebCookieManagerSoup.cpp > WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp >@@ -303,7 +299,6 @@ list(APPEND WebKit2_SOURCES > WebProcess/soup/WebKitSoupRequestGeneric.cpp > WebProcess/soup/WebKitSoupRequestInputStream.cpp > WebProcess/soup/WebProcessSoup.cpp >- WebProcess/soup/WebSoupRequestManager.cpp > ) > > set(WebKit2GTK_INSTALLED_HEADERS >diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h >index 83904ad..bd060ed 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h >+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h >@@ -27,7 +27,6 @@ > #define WebKitPrivate_h > > #include <WebKit2/WKAPICast.h> >-#include <WebKit2/WKContextSoup.h> > #include <WebKit2/WKDownload.h> > #include <WebKit2/WKFindOptions.h> > #include <WebKit2/WKFullScreenClientGtk.h> >@@ -39,7 +38,7 @@ > #include <WebKit2/WKInspectorClientGtk.h> > #include <WebKit2/WKRetainPtr.h> > #include <WebKit2/WKSerializedScriptValue.h> >-#include <WebKit2/WKSoupRequestManager.h> >+#include <WebKit2/WKSoupCustomProtocolRequestManager.h> > #include <WebKit2/WKString.h> > #include <WebKit2/WKTextChecker.h> > #include <WebKit2/WebKit2_C.h> >diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.cpp >index acc1901..72f91ec 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.cpp >+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.cpp >@@ -20,34 +20,30 @@ > #include "config.h" > #include "WebKitRequestManagerClient.h" > >-#include "WebKitURISchemeRequestPrivate.h" > #include "WebKitWebContextPrivate.h" >-#include <wtf/gobject/GRefPtr.h> > > using namespace WebKit; > >-static void didReceiveURIRequest(WKSoupRequestManagerRef soupRequestManagerRef, WKURLRef urlRef, WKPageRef initiatingPageRef, uint64_t requestID, const void* clientInfo) >+static void startLoading(WKSoupCustomProtocolRequestManagerRef soupRequestManagerRef, uint64_t customProtocolID, WKURLRequestRef requestRef, const void* clientInfo) > { >- WebKitWebContext* webContext = WEBKIT_WEB_CONTEXT(clientInfo); >- GRefPtr<WebKitURISchemeRequest> request = adoptGRef(webkitURISchemeRequestCreate(webContext, toImpl(soupRequestManagerRef), toImpl(urlRef), toImpl(initiatingPageRef), requestID)); >- webkitWebContextReceivedURIRequest(webContext, request.get()); >+ webkitWebContextStartLoadingCustomProtocol(WEBKIT_WEB_CONTEXT(clientInfo), customProtocolID, toImpl(requestRef)); > } > >-static void didFailToLoadURIRequest(WKSoupRequestManagerRef, uint64_t requestID, const void* clientInfo) >+static void stopLoading(WKSoupCustomProtocolRequestManagerRef, uint64_t customProtocolID, const void* clientInfo) > { >- webkitWebContextDidFailToLoadURIRequest(WEBKIT_WEB_CONTEXT(clientInfo), requestID); >+ webkitWebContextStopLoadingCustomProtocol(WEBKIT_WEB_CONTEXT(clientInfo), customProtocolID); > } > > void attachRequestManagerClientToContext(WebKitWebContext* webContext) > { >- WKSoupRequestManagerClientV0 wkRequestManagerClient = { >+ WKSoupCustomProtocolRequestManagerClientV0 wkRequestManagerClient = { > { > 0, // version > webContext // clientInfo > }, >- didReceiveURIRequest, >- didFailToLoadURIRequest >+ startLoading, >+ stopLoading > }; >- WKSoupRequestManagerSetClient(toAPI(webkitWebContextGetRequestManager(webContext)), &wkRequestManagerClient.base); >+ WKSoupCustomProtocolRequestManagerSetClient(toAPI(webkitWebContextGetRequestManager(webContext)), &wkRequestManagerClient.base); > } > >diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp >index d0136cd..176067c 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp >+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp >@@ -25,7 +25,6 @@ > #include "WebKitWebContextPrivate.h" > #include "WebKitWebView.h" > #include "WebPageProxy.h" >-#include "WebSoupRequestManagerProxy.h" > #include <WebCore/GOwnPtrSoup.h> > #include <WebCore/ResourceError.h> > #include <libsoup/soup.h> >@@ -54,7 +53,7 @@ static const unsigned int gReadBufferSize = 8192; > > struct _WebKitURISchemeRequestPrivate { > WebKitWebContext* webContext; >- RefPtr<WebSoupRequestManagerProxy> webRequestManager; >+ RefPtr<WebSoupCustomProtocolRequestManager> webRequestManager; > RefPtr<WebPageProxy> initiatingPage; > uint64_t requestID; > CString uri; >@@ -74,22 +73,17 @@ static void webkit_uri_scheme_request_class_init(WebKitURISchemeRequestClass* re > { > } > >-WebKitURISchemeRequest* webkitURISchemeRequestCreate(WebKitWebContext* webContext, WebSoupRequestManagerProxy* webRequestManager, API::URL* webURL, WebPageProxy* initiatingPage, uint64_t requestID) >+WebKitURISchemeRequest* webkitURISchemeRequestCreate(uint64_t requestID, WebKitWebContext* webContext, API::URLRequest* urlRequest, WebPageProxy* initiatingPage) > { > WebKitURISchemeRequest* request = WEBKIT_URI_SCHEME_REQUEST(g_object_new(WEBKIT_TYPE_URI_SCHEME_REQUEST, NULL)); > request->priv->webContext = webContext; >- request->priv->webRequestManager = webRequestManager; >- request->priv->uri = webURL->string().utf8(); >+ request->priv->webRequestManager = webkitWebContextGetRequestManager(webContext); >+ request->priv->uri = urlRequest->resourceRequest().url().string().utf8(); > request->priv->initiatingPage = initiatingPage; > request->priv->requestID = requestID; > return request; > } > >-uint64_t webkitURISchemeRequestGetID(WebKitURISchemeRequest* request) >-{ >- return request->priv->requestID; >-} >- > void webkitURISchemeRequestCancel(WebKitURISchemeRequest* request) > { > if (request->priv->cancellable.get()) >@@ -157,7 +151,8 @@ WebKitWebView* webkit_uri_scheme_request_get_web_view(WebKitURISchemeRequest* re > { > g_return_val_if_fail(WEBKIT_IS_URI_SCHEME_REQUEST(request), 0); > >- return WEBKIT_WEB_VIEW(request->priv->initiatingPage->viewWidget()); >+ // FIXME: initiatingPage is now always NULL, we need to re-implement this somehow. >+ return request->priv->initiatingPage ? WEBKIT_WEB_VIEW(request->priv->initiatingPage->viewWidget()) : nullptr; > } > > static void webkitURISchemeRequestReadCallback(GInputStream* inputStream, GAsyncResult* result, WebKitURISchemeRequest* schemeRequest) >@@ -173,21 +168,25 @@ static void webkitURISchemeRequestReadCallback(GInputStream* inputStream, GAsync > WebKitURISchemeRequestPrivate* priv = request->priv; > RefPtr<API::Data> webData = API::Data::create(reinterpret_cast<const unsigned char*>(priv->readBuffer), bytesRead); > if (!priv->bytesRead) { >- // First chunk read. In case of empty reply an empty API::Data is sent to the WebProcess. >- priv->webRequestManager->didHandleURIRequest(webData.get(), priv->streamLength, String::fromUTF8(priv->mimeType.data()), priv->requestID); >+ // First chunk read. In case of empty reply an empty API::Data is sent to the networking process. >+ WebCore::ResourceResponse response(WebCore::URL(WebCore::URL(), String::fromUTF8(priv->uri)), String::fromUTF8(priv->mimeType.data()), >+ priv->streamLength, emptyString(), emptyString()); >+ priv->webRequestManager->didReceiveResponse(priv->requestID, response); >+ priv->webRequestManager->didLoadData(priv->requestID, webData.get()); > } else if (bytesRead || (!bytesRead && !priv->streamLength)) { >- // Subsequent chunk read. We only send an empty API::Data to the WebProcess when stream length is unknown. >- priv->webRequestManager->didReceiveURIRequestData(webData.get(), priv->requestID); >+ // Subsequent chunk read. We only send an empty API::Data to the networking process when stream length is unknown. >+ priv->webRequestManager->didLoadData(priv->requestID, webData.get()); > } > > if (!bytesRead) { >- webkitWebContextDidFinishURIRequest(request->priv->webContext, request->priv->requestID); >+ priv->webRequestManager->didFinishLoading(request->priv->requestID); >+ webkitWebContextDidFinishLoadingCustomProtocol(request->priv->webContext, request->priv->requestID); > return; > } > > priv->bytesRead += bytesRead; > g_input_stream_read_async(inputStream, priv->readBuffer, gReadBufferSize, G_PRIORITY_DEFAULT, priv->cancellable.get(), >- reinterpret_cast<GAsyncReadyCallback>(webkitURISchemeRequestReadCallback), g_object_ref(request.get())); >+ reinterpret_cast<GAsyncReadyCallback>(webkitURISchemeRequestReadCallback), g_object_ref(request.get())); > } > > /** >@@ -212,7 +211,7 @@ void webkit_uri_scheme_request_finish(WebKitURISchemeRequest* request, GInputStr > request->priv->bytesRead = 0; > request->priv->mimeType = mimeType; > g_input_stream_read_async(inputStream, request->priv->readBuffer, gReadBufferSize, G_PRIORITY_DEFAULT, request->priv->cancellable.get(), >- reinterpret_cast<GAsyncReadyCallback>(webkitURISchemeRequestReadCallback), g_object_ref(request)); >+ reinterpret_cast<GAsyncReadyCallback>(webkitURISchemeRequestReadCallback), g_object_ref(request)); > } > > /** >@@ -232,7 +231,6 @@ void webkit_uri_scheme_request_finish_error(WebKitURISchemeRequest* request, GEr > WebKitURISchemeRequestPrivate* priv = request->priv; > > WebCore::ResourceError resourceError(g_quark_to_string(error->domain), error->code, priv->uri.data(), String::fromUTF8(error->message)); >- priv->webRequestManager->didFailURIRequest(resourceError, priv->requestID); >- >- webkitWebContextDidFinishURIRequest(priv->webContext, priv->requestID); >+ priv->webRequestManager->didFailWithError(priv->requestID, resourceError); >+ webkitWebContextDidFinishLoadingCustomProtocol(priv->webContext, priv->requestID); > } >diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h >index 3867173..5208993 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h >+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h >@@ -24,8 +24,7 @@ > #include "WebKitURISchemeRequest.h" > #include "WebKitWebContext.h" > >-WebKitURISchemeRequest* webkitURISchemeRequestCreate(WebKitWebContext*, WebKit::WebSoupRequestManagerProxy*, API::URL*, WebKit::WebPageProxy*, uint64_t requestID); >-uint64_t webkitURISchemeRequestGetID(WebKitURISchemeRequest*); >+WebKitURISchemeRequest* webkitURISchemeRequestCreate(uint64_t requestID, WebKitWebContext*, API::URLRequest*, WebKit::WebPageProxy*); > void webkitURISchemeRequestCancel(WebKitURISchemeRequest*); > > #endif // WebKitURISchemeRequestPrivate_h >diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp >index 2b1a5f3..df3364c 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp >+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp >@@ -136,7 +136,7 @@ struct _WebKitWebContextPrivate { > GRefPtr<WebKitCookieManager> cookieManager; > GRefPtr<WebKitFaviconDatabase> faviconDatabase; > GRefPtr<WebKitSecurityManager> securityManager; >- RefPtr<WebSoupRequestManagerProxy> requestManager; >+ RefPtr<WebSoupCustomProtocolRequestManager> requestManager; > URISchemeHandlerMap uriSchemeHandlers; > URISchemeRequestMap uriSchemeRequests; > #if ENABLE(GEOLOCATION) >@@ -203,7 +203,7 @@ static gpointer createDefaultWebContext(gpointer) > WebKitWebContextPrivate* priv = webContext->priv; > > priv->context = WebContext::create(WebCore::filenameToString(injectedBundleFilename().data())); >- priv->requestManager = webContext->priv->context->supplement<WebSoupRequestManagerProxy>(); >+ priv->requestManager = webContext->priv->context->supplement<WebSoupCustomProtocolRequestManager>(); > priv->context->setCacheModel(CacheModelPrimaryWebBrowser); > #if ENABLE(NETWORK_PROCESS) > // FIXME: Temporary use an env var until we have API to set the process model. See https://bugs.webkit.org/show_bug.cgi?id=125463. >@@ -620,7 +620,7 @@ void webkit_web_context_register_uri_scheme(WebKitWebContext* context, const cha > > RefPtr<WebKitURISchemeHandler> handler = adoptRef(new WebKitURISchemeHandler(callback, userData, destroyNotify)); > context->priv->uriSchemeHandlers.set(String::fromUTF8(scheme), handler.get()); >- context->priv->requestManager->registerURIScheme(String::fromUTF8(scheme)); >+ context->priv->requestManager->registerSchemeForCustomProtocol(String::fromUTF8(scheme)); > } > > /** >@@ -879,34 +879,36 @@ WebContext* webkitWebContextGetContext(WebKitWebContext* context) > return context->priv->context.get(); > } > >-WebSoupRequestManagerProxy* webkitWebContextGetRequestManager(WebKitWebContext* context) >+WebSoupCustomProtocolRequestManager* webkitWebContextGetRequestManager(WebKitWebContext* context) > { > return context->priv->requestManager.get(); > } > >-void webkitWebContextReceivedURIRequest(WebKitWebContext* context, WebKitURISchemeRequest* request) >+void webkitWebContextStartLoadingCustomProtocol(WebKitWebContext* context, uint64_t customProtocolID, API::URLRequest* urlRequest) > { >- String scheme(String::fromUTF8(webkit_uri_scheme_request_get_scheme(request))); >+ // FIXME: We need to figure out how to get the initiating page. >+ GRefPtr<WebKitURISchemeRequest> request = adoptGRef(webkitURISchemeRequestCreate(customProtocolID, context, urlRequest, nullptr)); >+ String scheme(String::fromUTF8(webkit_uri_scheme_request_get_scheme(request.get()))); > RefPtr<WebKitURISchemeHandler> handler = context->priv->uriSchemeHandlers.get(scheme); > ASSERT(handler.get()); > if (!handler->hasCallback()) > return; > >- context->priv->uriSchemeRequests.set(webkitURISchemeRequestGetID(request), request); >- handler->performCallback(request); >+ context->priv->uriSchemeRequests.set(customProtocolID, request.get()); >+ handler->performCallback(request.get()); > } > >-void webkitWebContextDidFailToLoadURIRequest(WebKitWebContext* context, uint64_t requestID) >+void webkitWebContextStopLoadingCustomProtocol(WebKitWebContext* context, uint64_t customProtocolID) > { >- GRefPtr<WebKitURISchemeRequest> request = context->priv->uriSchemeRequests.get(requestID); >+ GRefPtr<WebKitURISchemeRequest> request = context->priv->uriSchemeRequests.get(customProtocolID); > if (!request.get()) > return; > webkitURISchemeRequestCancel(request.get()); > } > >-void webkitWebContextDidFinishURIRequest(WebKitWebContext* context, uint64_t requestID) >+void webkitWebContextDidFinishLoadingCustomProtocol(WebKitWebContext* context, uint64_t customProtocolID) > { >- context->priv->uriSchemeRequests.remove(requestID); >+ context->priv->uriSchemeRequests.remove(customProtocolID); > } > > void webkitWebContextCreatePageForWebView(WebKitWebContext* context, WebKitWebView* webView, WebKitWebViewGroup* webViewGroup) >diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h >index 81c473c..940dff6 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h >+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h >@@ -29,20 +29,19 @@ > #include "DownloadProxy.h" > #include "WebContext.h" > #include "WebKitPrivate.h" >-#include "WebKitURISchemeRequest.h" > #include "WebKitWebContext.h" > #include "WebKitWebViewGroup.h" >-#include "WebSoupRequestManagerProxy.h" >+#include "WebSoupCustomProtocolRequestManager.h" > > WebKit::WebContext* webkitWebContextGetContext(WebKitWebContext*); > WebKitDownload* webkitWebContextGetOrCreateDownload(WebKit::DownloadProxy*); > WebKitDownload* webkitWebContextStartDownload(WebKitWebContext*, const char* uri, WebKit::WebPageProxy*); > void webkitWebContextRemoveDownload(WebKit::DownloadProxy*); > void webkitWebContextDownloadStarted(WebKitWebContext*, WebKitDownload*); >-WebKit::WebSoupRequestManagerProxy* webkitWebContextGetRequestManager(WebKitWebContext*); >-void webkitWebContextReceivedURIRequest(WebKitWebContext*, WebKitURISchemeRequest*); >-void webkitWebContextDidFailToLoadURIRequest(WebKitWebContext*, uint64_t requestID); >-void webkitWebContextDidFinishURIRequest(WebKitWebContext*, uint64_t requestID); >+WebKit::WebSoupCustomProtocolRequestManager* webkitWebContextGetRequestManager(WebKitWebContext*); >+void webkitWebContextStartLoadingCustomProtocol(WebKitWebContext*, uint64_t customProtocolID, API::URLRequest*); >+void webkitWebContextStopLoadingCustomProtocol(WebKitWebContext*, uint64_t customProtocolID); >+void webkitWebContextDidFinishLoadingCustomProtocol(WebKitWebContext*, uint64_t customProtocolID); > void webkitWebContextCreatePageForWebView(WebKitWebContext*, WebKitWebView*, WebKitWebViewGroup*); > void webkitWebContextWebViewDestroyed(WebKitWebContext*, WebKitWebView*); > WebKitWebView* webkitWebContextGetWebViewForPage(WebKitWebContext*, WebKit::WebPageProxy*); >diff --git a/Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp b/Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp >index 8acef3c..af6109e 100644 >--- a/Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp >+++ b/Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp >@@ -33,6 +33,7 @@ > #include "WebInspectorServer.h" > #include "WebProcessCreationParameters.h" > #include "WebProcessMessages.h" >+#include "WebSoupCustomProtocolRequestManager.h" > #include <WebCore/FileSystem.h> > #include <WebCore/NotImplemented.h> > #include <WebCore/SchemeRegistry.h> >@@ -43,12 +44,6 @@ > #include "NetworkProcessMessages.h" > #endif > >-#if ENABLE(CUSTOM_PROTOCOLS) >-#include "WebSoupCustomProtocolRequestManager.h" >-#else >-#include "WebSoupRequestManagerProxy.h" >-#endif >- > namespace WebKit { > > static void initInspectorServer() >@@ -104,11 +99,7 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para > } > > if (!usesNetworkProcess()) { >-#if ENABLE(CUSTOM_PROTOCOLS) > parameters.urlSchemesRegisteredForCustomProtocols = supplement<WebSoupCustomProtocolRequestManager>()->registeredSchemesForCustomProtocols(); >-#else >- parameters.urlSchemesRegistered = supplement<WebSoupRequestManagerProxy>()->registeredURISchemes(); >-#endif > > supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType); > parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy; >diff --git a/Source/WebKit2/WebKit2Prefix.h b/Source/WebKit2/WebKit2Prefix.h >index 0c959c4..3c17708 100644 >--- a/Source/WebKit2/WebKit2Prefix.h >+++ b/Source/WebKit2/WebKit2Prefix.h >@@ -70,6 +70,7 @@ > > #if PLATFORM(GTK) > #define ENABLE_NETWORK_PROCESS 1 >+#define ENABLE_CUSTOM_PROTOCOLS 1 > #endif > > /* When C++ exceptions are disabled, the C++ library defines |try| and |catch| >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 811eea0..29c0dd0 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,15 @@ >+2014-01-16 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [GTK] Implement custom URI schemes with CustomProtocols >+ https://bugs.webkit.org/show_bug.cgi?id=127091 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Temporarily disable the WebKitWebView check until we figure out >+ how to implement it with CustomProtocols. >+ >+ * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp: >+ > 2014-01-15 Alexey Proskuryakov <ap@apple.com> > > DumpRenderTree doesn't disable web preferences autosave >diff --git a/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp b/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp >index a414853..18b64c6 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp >@@ -146,7 +146,8 @@ public: > test->m_uriSchemeRequest = request; > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(request)); > >- g_assert(webkit_uri_scheme_request_get_web_view(request) == test->m_webView); >+ // FIXME: webkit_uri_scheme_request_get_web_view doesn't work with custom protocols. >+ // g_assert(webkit_uri_scheme_request_get_web_view(request) == test->m_webView); > > GRefPtr<GInputStream> inputStream = adoptGRef(g_memory_input_stream_new()); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(inputStream.get()));
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 127091
:
221354
|
221760
|
221985