<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[208959] trunk/Source/WebKit2</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/208959">208959</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-11-21 23:49:55 -0800 (Mon, 21 Nov 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[SOUP] Simplify custom protocols handler implementation
https://bugs.webkit.org/show_bug.cgi?id=164922
Reviewed by Michael Catanzaro.
We are using too many classes for this and also the C API that is not needed, because both GTK+ and EFL have
their own APIs and this is not used by WTR at all.
* PlatformEfl.cmake: Remove files from compilation.
* PlatformGTK.cmake: Ditto.
* Shared/API/c/WKBase.h:
* Shared/API/c/soup/WKBaseSoup.h: Removed.
* UIProcess/API/APICustomProtocolManagerClient.h: Added.
(API::CustomProtocolManagerClient::~CustomProtocolManagerClient):
(API::CustomProtocolManagerClient::startLoading):
(API::CustomProtocolManagerClient::stopLoading):
(API::CustomProtocolManagerClient::invalidate):
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/soup/WKAPICastSoup.h: Removed.
* UIProcess/API/C/soup/WKContextSoup.h: Removed.
* UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp: Removed.
* UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: Removed.
* UIProcess/API/C/soup/WKSoupRequestManager.h: Removed.
* UIProcess/API/efl/ewk_context.cpp: Remove unneeded include.
* UIProcess/API/efl/ewk_url_scheme_request.cpp: Use CustomProtocolManagerProxy instead of WKSoupCustomProtocolRequestManagerRef.
(EwkUrlSchemeRequest::EwkUrlSchemeRequest):
(EwkUrlSchemeRequest::finish):
(EwkUrlSchemeRequest::invalidate):
* UIProcess/API/efl/ewk_url_scheme_request_private.h:
(EwkUrlSchemeRequest::create):
(EwkUrlSchemeRequest::manager):
* UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp: Added.
(attachCustomProtocolManagerClientToContext):
* UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h.
* UIProcess/API/gtk/WebKitPrivate.h:
* UIProcess/API/gtk/WebKitRequestManagerClient.cpp: Removed.
* UIProcess/API/gtk/WebKitRequestManagerClient.h: Removed.
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp: Use CustomProtocolManagerProxy instead of WebSoupCustomProtocolRequestManager.
(webkitURISchemeRequestCreate):
(webkitURISchemeRequestCancel):
(webkitURISchemeRequestGetManager):
(webkitURISchemeRequestInvalidate):
(webkitURISchemeRequestReadCallback):
(webkit_uri_scheme_request_finish_error):
* UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkitWebContextDispose):
(webkit_web_context_register_uri_scheme):
(webkitWebContextStartLoadingCustomProtocol):
(webkitWebContextInvalidateCustomProtocolRequests):
* UIProcess/API/gtk/WebKitWebContextPrivate.h:
* UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
* UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
(WebKit::CustomProtocolManagerProxy::processDidClose):
* UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
(WebKit::CustomProtocolManagerProxy::processDidClose): Invalidate the client.
(WebKit::CustomProtocolManagerProxy::startLoading): Notify the client.
(WebKit::CustomProtocolManagerProxy::stopLoading): Ditto.
(WebKit::CustomProtocolManagerProxy::didReceiveResponse): Notify the network process.
(WebKit::CustomProtocolManagerProxy::didLoadData): Ditto.
(WebKit::CustomProtocolManagerProxy::didFailWithError): Ditto.
(WebKit::CustomProtocolManagerProxy::didFinishLoading): Ditto.
* UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp: Removed.
* UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h: Removed.
* UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp: Removed.
* UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h: Removed.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didClose): Notify the CustomProtocolManagerProxy.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool): Initialize the CustomProtocolManagerClient and remove the all supplement.
(WebKit::WebProcessPool::setCustomProtocolManagerClient):
(WebKit::WebProcessPool::registerSchemeForCustomProtocol): In case of soup cache the given protocol.
(WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): In case of soup delete the given protocol from the cache.
* UIProcess/WebProcessPool.h:
* UIProcess/efl/RequestManagerClientEfl.cpp: Do not use the C API, but API::CustomProtocolManagerClient.
(WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
(WebKit::RequestManagerClientEfl::registerURLSchemeHandler):
* UIProcess/efl/RequestManagerClientEfl.h:
* UIProcess/efl/WebProcessPoolEfl.cpp:
* UIProcess/gtk/WebProcessPoolGtk.cpp:
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess): Use m_urlSchemesRegisteredForCustomProtocols to
build the list of custom protocols to send to the network process.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformEflcmake">trunk/Source/WebKit2/PlatformEfl.cmake</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKit2SharedAPIcWKBaseh">trunk/Source/WebKit2/Shared/API/c/WKBase.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKAPICasth">trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIeflewk_contextcpp">trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIeflewk_url_scheme_requestcpp">trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIeflewk_url_scheme_request_privateh">trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitURISchemeRequestcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitURISchemeRequestPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkCustomProtocolsCustomProtocolManagerProxyh">trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkCustomProtocolsmacCustomProtocolManagerProxyMacmm">trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkCustomProtocolssoupCustomProtocolManagerProxySoupcpp">trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkNetworkProcessProxycpp">trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolcpp">trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolh">trunk/Source/WebKit2/UIProcess/WebProcessPool.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcesseflRequestManagerClientEflcpp">trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcesseflRequestManagerClientEflh">trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcesseflWebProcessPoolEflcpp">trunk/Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkWebProcessPoolGtkcpp">trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcesssoupWebProcessPoolSoupcpp">trunk/Source/WebKit2/UIProcess/soup/WebProcessPoolSoup.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPICustomProtocolManagerClienth">trunk/Source/WebKit2/UIProcess/API/APICustomProtocolManagerClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitCustomProtocolManagerClientcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitCustomProtocolManagerClienth">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li>trunk/Source/WebKit2/Shared/API/c/soup/</li>
<li><a href="#trunkSourceWebKit2UIProcessAPICsoupWKAPICastSouph">trunk/Source/WebKit2/UIProcess/API/C/soup/WKAPICastSoup.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICsoupWKContextSouph">trunk/Source/WebKit2/UIProcess/API/C/soup/WKContextSoup.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICsoupWKSoupCustomProtocolRequestManagercpp">trunk/Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICsoupWKSoupCustomProtocolRequestManagerh">trunk/Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICsoupWKSoupRequestManagerh">trunk/Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitRequestManagerClientcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitRequestManagerClienth">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkCustomProtocolssoupWebSoupCustomProtocolRequestManagercpp">trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkCustomProtocolssoupWebSoupCustomProtocolRequestManagerh">trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkCustomProtocolssoupWebSoupCustomProtocolRequestManagerClientcpp">trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkCustomProtocolssoupWebSoupCustomProtocolRequestManagerClienth">trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/ChangeLog        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -1,3 +1,90 @@
</span><ins>+2016-11-21 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [SOUP] Simplify custom protocols handler implementation
+ https://bugs.webkit.org/show_bug.cgi?id=164922
+
+ Reviewed by Michael Catanzaro.
+
+ We are using too many classes for this and also the C API that is not needed, because both GTK+ and EFL have
+ their own APIs and this is not used by WTR at all.
+
+ * PlatformEfl.cmake: Remove files from compilation.
+ * PlatformGTK.cmake: Ditto.
+ * Shared/API/c/WKBase.h:
+ * Shared/API/c/soup/WKBaseSoup.h: Removed.
+ * UIProcess/API/APICustomProtocolManagerClient.h: Added.
+ (API::CustomProtocolManagerClient::~CustomProtocolManagerClient):
+ (API::CustomProtocolManagerClient::startLoading):
+ (API::CustomProtocolManagerClient::stopLoading):
+ (API::CustomProtocolManagerClient::invalidate):
+ * UIProcess/API/C/WKAPICast.h:
+ * UIProcess/API/C/soup/WKAPICastSoup.h: Removed.
+ * UIProcess/API/C/soup/WKContextSoup.h: Removed.
+ * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp: Removed.
+ * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: Removed.
+ * UIProcess/API/C/soup/WKSoupRequestManager.h: Removed.
+ * UIProcess/API/efl/ewk_context.cpp: Remove unneeded include.
+ * UIProcess/API/efl/ewk_url_scheme_request.cpp: Use CustomProtocolManagerProxy instead of WKSoupCustomProtocolRequestManagerRef.
+ (EwkUrlSchemeRequest::EwkUrlSchemeRequest):
+ (EwkUrlSchemeRequest::finish):
+ (EwkUrlSchemeRequest::invalidate):
+ * UIProcess/API/efl/ewk_url_scheme_request_private.h:
+ (EwkUrlSchemeRequest::create):
+ (EwkUrlSchemeRequest::manager):
+ * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp: Added.
+ (attachCustomProtocolManagerClientToContext):
+ * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h.
+ * UIProcess/API/gtk/WebKitPrivate.h:
+ * UIProcess/API/gtk/WebKitRequestManagerClient.cpp: Removed.
+ * UIProcess/API/gtk/WebKitRequestManagerClient.h: Removed.
+ * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: Use CustomProtocolManagerProxy instead of WebSoupCustomProtocolRequestManager.
+ (webkitURISchemeRequestCreate):
+ (webkitURISchemeRequestCancel):
+ (webkitURISchemeRequestGetManager):
+ (webkitURISchemeRequestInvalidate):
+ (webkitURISchemeRequestReadCallback):
+ (webkit_uri_scheme_request_finish_error):
+ * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
+ * UIProcess/API/gtk/WebKitWebContext.cpp:
+ (webkitWebContextConstructed):
+ (webkitWebContextDispose):
+ (webkit_web_context_register_uri_scheme):
+ (webkitWebContextStartLoadingCustomProtocol):
+ (webkitWebContextInvalidateCustomProtocolRequests):
+ * UIProcess/API/gtk/WebKitWebContextPrivate.h:
+ * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
+ * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
+ (WebKit::CustomProtocolManagerProxy::processDidClose):
+ * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
+ (WebKit::CustomProtocolManagerProxy::processDidClose): Invalidate the client.
+ (WebKit::CustomProtocolManagerProxy::startLoading): Notify the client.
+ (WebKit::CustomProtocolManagerProxy::stopLoading): Ditto.
+ (WebKit::CustomProtocolManagerProxy::didReceiveResponse): Notify the network process.
+ (WebKit::CustomProtocolManagerProxy::didLoadData): Ditto.
+ (WebKit::CustomProtocolManagerProxy::didFailWithError): Ditto.
+ (WebKit::CustomProtocolManagerProxy::didFinishLoading): Ditto.
+ * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp: Removed.
+ * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h: Removed.
+ * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp: Removed.
+ * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h: Removed.
+ * UIProcess/Network/NetworkProcessProxy.cpp:
+ (WebKit::NetworkProcessProxy::didClose): Notify the CustomProtocolManagerProxy.
+ * UIProcess/WebProcessPool.cpp:
+ (WebKit::WebProcessPool::WebProcessPool): Initialize the CustomProtocolManagerClient and remove the all supplement.
+ (WebKit::WebProcessPool::setCustomProtocolManagerClient):
+ (WebKit::WebProcessPool::registerSchemeForCustomProtocol): In case of soup cache the given protocol.
+ (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): In case of soup delete the given protocol from the cache.
+ * UIProcess/WebProcessPool.h:
+ * UIProcess/efl/RequestManagerClientEfl.cpp: Do not use the C API, but API::CustomProtocolManagerClient.
+ (WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
+ (WebKit::RequestManagerClientEfl::registerURLSchemeHandler):
+ * UIProcess/efl/RequestManagerClientEfl.h:
+ * UIProcess/efl/WebProcessPoolEfl.cpp:
+ * UIProcess/gtk/WebProcessPoolGtk.cpp:
+ * UIProcess/soup/WebProcessPoolSoup.cpp:
+ (WebKit::WebProcessPool::platformInitializeNetworkProcess): Use m_urlSchemesRegisteredForCustomProtocols to
+ build the list of custom protocols to send to the network process.
+
</ins><span class="cx"> 2016-11-21 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> Fix Sierra CMake build after r208452
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformEfl.cmake (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformEfl.cmake        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/PlatformEfl.cmake        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -76,7 +76,6 @@
</span><span class="cx"> UIProcess/API/C/efl/WKViewEfl.cpp
</span><span class="cx">
</span><span class="cx"> UIProcess/API/C/soup/WKCookieManagerSoup.cpp
</span><del>- UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp
</del><span class="cx">
</span><span class="cx"> UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp
</span><span class="cx">
</span><span class="lines">@@ -131,8 +130,6 @@
</span><span class="cx"> UIProcess/Launcher/efl/ProcessLauncherEfl.cpp
</span><span class="cx">
</span><span class="cx"> UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp
</span><del>- UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp
- UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp
</del><span class="cx">
</span><span class="cx"> UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
</span><span class="cx"> UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
</span><span class="lines">@@ -256,6 +253,7 @@
</span><span class="cx"> "${WEBKIT2_DIR}/Shared/efl"
</span><span class="cx"> "${WEBKIT2_DIR}/Shared/soup"
</span><span class="cx"> "${WEBKIT2_DIR}/Shared/unix"
</span><ins>+ "${WEBKIT2_DIR}/UIProcess/API"
</ins><span class="cx"> "${WEBKIT2_DIR}/UIProcess/API/C/cairo"
</span><span class="cx"> "${WEBKIT2_DIR}/UIProcess/API/C/CoordinatedGraphics"
</span><span class="cx"> "${WEBKIT2_DIR}/UIProcess/API/C/efl"
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/PlatformGTK.cmake        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -101,7 +101,6 @@
</span><span class="cx"> UIProcess/API/C/gtk/WKView.cpp
</span><span class="cx">
</span><span class="cx"> UIProcess/API/C/soup/WKCookieManagerSoup.cpp
</span><del>- UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp
</del><span class="cx">
</span><span class="cx"> UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp
</span><span class="cx"> UIProcess/API/gtk/PageClientImpl.cpp
</span><span class="lines">@@ -134,6 +133,8 @@
</span><span class="cx"> UIProcess/API/gtk/WebKitCookieManagerPrivate.h
</span><span class="cx"> UIProcess/API/gtk/WebKitCredential.cpp
</span><span class="cx"> UIProcess/API/gtk/WebKitCredential.h
</span><ins>+ UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp
+ UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h
</ins><span class="cx"> UIProcess/API/gtk/WebKitDefines.h
</span><span class="cx"> UIProcess/API/gtk/WebKitDownload.cpp
</span><span class="cx"> UIProcess/API/gtk/WebKitDownload.h
</span><span class="lines">@@ -210,8 +211,6 @@
</span><span class="cx"> UIProcess/API/gtk/WebKitPrintOperationPrivate.h
</span><span class="cx"> UIProcess/API/gtk/WebKitPrivate.cpp
</span><span class="cx"> UIProcess/API/gtk/WebKitPrivate.h
</span><del>- UIProcess/API/gtk/WebKitRequestManagerClient.cpp
- UIProcess/API/gtk/WebKitRequestManagerClient.h
</del><span class="cx"> UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp
</span><span class="cx"> UIProcess/API/gtk/WebKitResponsePolicyDecision.h
</span><span class="cx"> UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h
</span><span class="lines">@@ -283,8 +282,6 @@
</span><span class="cx"> UIProcess/linux/MemoryPressureMonitor.cpp
</span><span class="cx">
</span><span class="cx"> UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp
</span><del>- UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp
- UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp
</del><span class="cx">
</span><span class="cx"> UIProcess/Plugins/gtk/PluginInfoCache.cpp
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAPIcWKBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/API/c/WKBase.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/API/c/WKBase.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/Shared/API/c/WKBase.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -34,10 +34,6 @@
</span><span class="cx"> #include <WebKit/WKBaseGtk.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if defined(USE_SOUP)
-#include <WebKit/WKBaseSoup.h>
-#endif
-
</del><span class="cx"> #if defined(BUILDING_EFL__)
</span><span class="cx"> #include <WebKit/WKBaseEfl.h>
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPICustomProtocolManagerClienthfromrev208958trunkSourceWebKit2UIProcessAPICsoupWKAPICastSouph"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/API/APICustomProtocolManagerClient.h (from rev 208958, trunk/Source/WebKit2/UIProcess/API/C/soup/WKAPICastSoup.h) (0 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APICustomProtocolManagerClient.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/APICustomProtocolManagerClient.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+#include <wtf/Forward.h>
+
+namespace WebKit {
+class CustomProtocolManagerProxy;
+}
+
+namespace WebCore {
+class ResourceRequest;
+}
+
+namespace API {
+
+class CustomProtocolManagerClient {
+public:
+ virtual ~CustomProtocolManagerClient() { }
+
+ virtual bool startLoading(WebKit::CustomProtocolManagerProxy&, uint64_t /* customProtocolID */, const WebCore::ResourceRequest&) { return false; }
+ virtual void stopLoading(WebKit::CustomProtocolManagerProxy&, uint64_t /* customProtocolID */) { }
+
+ virtual void invalidate(WebKit::CustomProtocolManagerProxy&) { }
+};
+
+} // namespace API
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKAPICasth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -552,10 +552,6 @@
</span><span class="cx"> #include "WKAPICastGtk.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if USE(SOUP)
-#include "WKAPICastSoup.h"
-#endif
-
</del><span class="cx"> #if defined(BUILDING_EFL__)
</span><span class="cx"> #include "WKAPICastEfl.h"
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICsoupWKAPICastSouph"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/C/soup/WKAPICastSoup.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/soup/WKAPICastSoup.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/C/soup/WKAPICastSoup.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-/*
- * Portions 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.
- */
-
-#ifndef WKAPICastSoup_h
-#define WKAPICastSoup_h
-
-#ifndef WKAPICast_h
-#error "Please #include \"WKAPICast.h\" instead of this file directly."
-#endif
-
-namespace WebKit {
-
-class WebSoupCustomProtocolRequestManager;
-
-WK_ADD_API_MAPPING(WKSoupCustomProtocolRequestManagerRef, WebSoupCustomProtocolRequestManager)
-
-}
-
-#endif // WKAPICastSoup_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICsoupWKContextSouph"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/C/soup/WKContextSoup.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/soup/WKContextSoup.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/C/soup/WKContextSoup.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-/*
- * 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.
- */
-
-#ifndef WKContextSoup_h
-#define WKContextSoup_h
-
-#include <WebKit/WKBase.h>
-#include <WebKit/WKSoupRequestManager.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-WK_EXPORT WKSoupRequestManagerRef WKContextGetSoupRequestManager(WKContextRef context);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* WKContextSoup_h */
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICsoupWKSoupCustomProtocolRequestManagercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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 "WKSoupCustomProtocolRequestManager.h"
-
-#include "WKAPICast.h"
-#include "WebSoupCustomProtocolRequestManager.h"
-
-using namespace WebKit;
-
-WKTypeID WKSoupCustomProtocolRequestManagerGetTypeID()
-{
- return toAPI(WebSoupCustomProtocolRequestManager::APIType);
-}
-
-void WKSoupCustomProtocolRequestManagerSetClient(WKSoupCustomProtocolRequestManagerRef soupRequestManagerRef, const WKSoupCustomProtocolRequestManagerClientBase* wkClient)
-{
- toImpl(soupRequestManagerRef)->initializeClient(wkClient);
-}
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICsoupWKSoupCustomProtocolRequestManagerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -1,58 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.
- */
-
-#ifndef WKSoupCustomProtocolRequestManager_h
-#define WKSoupCustomProtocolRequestManager_h
-
-#include <WebKit/WKBase.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void (*WKSoupCustomProtocolRequestManagerStartLoadingCallback)(WKSoupCustomProtocolRequestManagerRef soupManagerRef, uint64_t customProtocolID, WKURLRequestRef requestRef, const void* clientInfo);
-typedef void (*WKSoupCustomProtocolRequestManagerStopLoadingCallback)(WKSoupCustomProtocolRequestManagerRef soupManagerRef, uint64_t customProtocolID, const void* clientInfo);
-
-typedef struct WKSoupCustomProtocolRequestManagerClientBase {
- int version;
- const void* clientInfo;
-} WKSoupCustomProtocolRequestManagerClientBase;
-
-typedef struct WKSoupCustomProtocolRequestManagerClientV0 {
- WKSoupCustomProtocolRequestManagerClientBase base;
-
- WKSoupCustomProtocolRequestManagerStartLoadingCallback startLoading;
- WKSoupCustomProtocolRequestManagerStopLoadingCallback stopLoading;
-} WKSoupCustomProtocolRequestManagerClientV0;
-
-WK_EXPORT WKTypeID WKSoupCustomProtocolRequestManagerGetTypeID();
-
-WK_EXPORT void WKSoupCustomProtocolRequestManagerSetClient(WKSoupCustomProtocolRequestManagerRef, const WKSoupCustomProtocolRequestManagerClientBase*);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* WKSoupCustomProtocolRequestManager_h */
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICsoupWKSoupRequestManagerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -1,61 +0,0 @@
</span><del>-/*
- * 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.
- */
-
-#ifndef WKSoupRequestManager_h
-#define WKSoupRequestManager_h
-
-#include <WebKit/WKBase.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void (*WKSoupRequestManagerDidReceiveURIRequestCallback)(WKSoupRequestManagerRef soupRequestManagerRef, WKURLRef urlRef, WKPageRef pageRef, uint64_t requestID, const void* clientInfo);
-typedef void (*WKSoupRequestManagerDidFailToLoadURIRequestCallback)(WKSoupRequestManagerRef soupRequestManagerRef, uint64_t requestID, const void* clientInfo);
-
-typedef struct WKSoupRequestManagerClientBase {
- int version;
- const void* clientInfo;
-} WKSoupRequestManagerClientBase;
-
-typedef struct WKSoupRequestManagerClientV0 {
- WKSoupRequestManagerClientBase base;
-
- WKSoupRequestManagerDidReceiveURIRequestCallback didReceiveURIRequest;
- WKSoupRequestManagerDidFailToLoadURIRequestCallback didFailToLoadURIRequest;
-} WKSoupRequestManagerClientV0;
-
-WK_EXPORT WKTypeID WKSoupRequestManagerGetTypeID();
-
-WK_EXPORT void WKSoupRequestManagerSetClient(WKSoupRequestManagerRef, const WKSoupRequestManagerClientBase* client);
-WK_EXPORT void WKSoupRequestManagerRegisterURIScheme(WKSoupRequestManagerRef, WKStringRef schemeRef);
-WK_EXPORT void WKSoupRequestManagerDidHandleURIRequest(WKSoupRequestManagerRef, WKDataRef, uint64_t contentLength, WKStringRef mimeTypeRef, uint64_t requestID);
-WK_EXPORT void WKSoupRequestManagerDidReceiveURIRequestData(WKSoupRequestManagerRef, WKDataRef, uint64_t requestID);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* WKSoupRequestManager_h */
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIeflewk_contextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include "RequestManagerClientEfl.h"
</span><span class="cx"> #include "WKAPICast.h"
</span><span class="cx"> #include "WKContextPrivate.h"
</span><del>-#include "WKContextSoup.h"
</del><span class="cx"> #include "WKNumber.h"
</span><span class="cx"> #include "WKString.h"
</span><span class="cx"> #include "WebIconDatabase.h"
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIeflewk_url_scheme_requestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -31,14 +31,13 @@
</span><span class="cx"> #include "WKString.h"
</span><span class="cx"> #include "WKURL.h"
</span><span class="cx"> #include "WebPageProxy.h"
</span><del>-#include "WebSoupCustomProtocolRequestManager.h"
</del><span class="cx">
</span><span class="cx"> #include "ewk_url_scheme_request_private.h"
</span><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><del>-EwkUrlSchemeRequest::EwkUrlSchemeRequest(WKSoupCustomProtocolRequestManagerRef manager, API::URLRequest* urlRequest, uint64_t requestID)
- : m_wkRequestManager(manager)
</del><ins>+EwkUrlSchemeRequest::EwkUrlSchemeRequest(CustomProtocolManagerProxy& manager, API::URLRequest* urlRequest, uint64_t requestID)
+ : m_wkRequestManager(&manager)
</ins><span class="cx"> , m_requestID(requestID)
</span><span class="cx"> {
</span><span class="cx"> WKURLRef url = toCopiedURLAPI(urlRequest->resourceRequest().url());
</span><span class="lines">@@ -69,6 +68,9 @@
</span><span class="cx">
</span><span class="cx"> void EwkUrlSchemeRequest::finish(const void* contentData, uint64_t contentLength, const char* mimeType)
</span><span class="cx"> {
</span><ins>+ if (!m_wkRequestManager)
+ return;
+
</ins><span class="cx"> WKRetainPtr<WKDataRef> wkData(AdoptWK, WKDataCreate(contentLength ? reinterpret_cast<const unsigned char*>(contentData) : 0, contentLength));
</span><span class="cx"> WKRetainPtr<WKStringRef> wkMimeType = mimeType ? adoptWK(WKStringCreateWithUTF8CString(mimeType)) : 0;
</span><span class="cx">
</span><span class="lines">@@ -76,12 +78,17 @@
</span><span class="cx"> WebCore::ResourceResponse response(WebCore::URL(WebCore::URL(), String::fromUTF8(m_url)),
</span><span class="cx"> String::fromUTF8(mimeType), contentLength, emptyString());
</span><span class="cx">
</span><del>- 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);
</del><ins>+ m_wkRequestManager->didReceiveResponse(m_requestID, response);
+ m_wkRequestManager->didLoadData(m_requestID, toImpl(wkData.get())->dataReference());
+ m_wkRequestManager->didFinishLoading(m_requestID);
+ m_wkRequestManager->stopLoading(m_requestID);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void EwkUrlSchemeRequest::invalidate()
+{
+ m_wkRequestManager = nullptr;
+}
+
</ins><span class="cx"> const char* ewk_url_scheme_request_scheme_get(const Ewk_Url_Scheme_Request* request)
</span><span class="cx"> {
</span><span class="cx"> EWK_OBJ_GET_IMPL_OR_RETURN(const EwkUrlSchemeRequest, request, impl, nullptr);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIeflewk_url_scheme_request_privateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -26,11 +26,11 @@
</span><span class="cx"> #ifndef ewk_url_scheme_request_private_h
</span><span class="cx"> #define ewk_url_scheme_request_private_h
</span><span class="cx">
</span><ins>+#include "CustomProtocolManagerProxy.h"
</ins><span class="cx"> #include "WKAPICast.h"
</span><span class="cx"> #include "WKBase.h"
</span><span class="cx"> #include "WKEinaSharedString.h"
</span><span class="cx"> #include "WKRetainPtr.h"
</span><del>-#include "WKSoupCustomProtocolRequestManager.h"
</del><span class="cx"> #include "ewk_object_private.h"
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -41,9 +41,9 @@
</span><span class="cx"> public:
</span><span class="cx"> EWK_OBJECT_DECLARE(EwkUrlSchemeRequest)
</span><span class="cx">
</span><del>- static RefPtr<EwkUrlSchemeRequest> create(WKSoupCustomProtocolRequestManagerRef manager, API::URLRequest* urlRequest, uint64_t requestID)
</del><ins>+ static RefPtr<EwkUrlSchemeRequest> create(WebKit::CustomProtocolManagerProxy& manager, API::URLRequest* urlRequest, uint64_t requestID)
</ins><span class="cx"> {
</span><del>- if (!manager || !urlRequest)
</del><ins>+ if (!urlRequest)
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> return adoptRef(new EwkUrlSchemeRequest(manager, urlRequest, requestID));
</span><span class="lines">@@ -56,10 +56,13 @@
</span><span class="cx">
</span><span class="cx"> void finish(const void* contentData, uint64_t contentLength, const char* mimeType);
</span><span class="cx">
</span><ins>+ WebKit::CustomProtocolManagerProxy* manager() const { return m_wkRequestManager; }
+ void invalidate();
+
</ins><span class="cx"> private:
</span><del>- EwkUrlSchemeRequest(WKSoupCustomProtocolRequestManagerRef manager, API::URLRequest* urlRequest, uint64_t requestID);
</del><ins>+ EwkUrlSchemeRequest(WebKit::CustomProtocolManagerProxy& manager, API::URLRequest* urlRequest, uint64_t requestID);
</ins><span class="cx">
</span><del>- WKRetainPtr<WKSoupCustomProtocolRequestManagerRef> m_wkRequestManager;
</del><ins>+ WebKit::CustomProtocolManagerProxy* m_wkRequestManager;
</ins><span class="cx"> WKEinaSharedString m_url;
</span><span class="cx"> uint64_t m_requestID;
</span><span class="cx"> WKEinaSharedString m_scheme;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitCustomProtocolManagerClientcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp (0 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+/*
+ * Copyright (C) 2016 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 "WebKitCustomProtocolManagerClient.h"
+
+#include "APICustomProtocolManagerClient.h"
+#include "CustomProtocolManagerProxy.h"
+#include "WebKitWebContextPrivate.h"
+#include "WebProcessPool.h"
+
+using namespace WebCore;
+using namespace WebKit;
+
+class CustomProtocolManagerClient final : public API::CustomProtocolManagerClient {
+public:
+ explicit CustomProtocolManagerClient(WebKitWebContext* webContext)
+ : m_webContext(webContext)
+ {
+ }
+
+private:
+ bool startLoading(CustomProtocolManagerProxy& manager, uint64_t customProtocolID, const ResourceRequest& request) override
+ {
+ webkitWebContextStartLoadingCustomProtocol(m_webContext, customProtocolID, request, manager);
+ return true;
+ }
+
+ void stopLoading(CustomProtocolManagerProxy&, uint64_t customProtocolID) override
+ {
+ webkitWebContextStopLoadingCustomProtocol(m_webContext, customProtocolID);
+ }
+
+ void invalidate(CustomProtocolManagerProxy& manager) override
+ {
+ webkitWebContextInvalidateCustomProtocolRequests(m_webContext, manager);
+ }
+
+ WebKitWebContext* m_webContext;
+};
+
+void attachCustomProtocolManagerClientToContext(WebKitWebContext* webContext)
+{
+ auto* processPool = webkitWebContextGetProcessPool(webContext);
+ processPool->setCustomProtocolManagerClient(std::make_unique<CustomProtocolManagerClient>(webContext));
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitCustomProtocolManagerClienthfromrev208958trunkSourceWebKit2UIProcessAPIgtkWebKitRequestManagerClienth"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h (from rev 208958, trunk/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h) (0 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+#include "WebKitWebContext.h"
+
+void attachCustomProtocolManagerClientToContext(WebKitWebContext*);
+
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -39,7 +39,6 @@
</span><span class="cx"> #include <WebKit/WKInspectorClientGtk.h>
</span><span class="cx"> #include <WebKit/WKRetainPtr.h>
</span><span class="cx"> #include <WebKit/WKSerializedScriptValue.h>
</span><del>-#include <WebKit/WKSoupCustomProtocolRequestManager.h>
</del><span class="cx"> #include <WebKit/WKString.h>
</span><span class="cx"> #include <WebKit/WKUserMediaPermissionRequest.h>
</span><span class="cx"> #include <WebKit/WebKit2_C.h>
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitRequestManagerClientcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -1,49 +0,0 @@
</span><del>-/*
- * 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 "WebKitRequestManagerClient.h"
-
-#include "WebKitWebContextPrivate.h"
-
-using namespace WebKit;
-
-static void startLoading(WKSoupCustomProtocolRequestManagerRef, uint64_t customProtocolID, WKURLRequestRef requestRef, const void* clientInfo)
-{
- webkitWebContextStartLoadingCustomProtocol(WEBKIT_WEB_CONTEXT(clientInfo), customProtocolID, toImpl(requestRef));
-}
-
-static void stopLoading(WKSoupCustomProtocolRequestManagerRef, uint64_t customProtocolID, const void* clientInfo)
-{
- webkitWebContextStopLoadingCustomProtocol(WEBKIT_WEB_CONTEXT(clientInfo), customProtocolID);
-}
-
-void attachRequestManagerClientToContext(WebKitWebContext* webContext)
-{
- WKSoupCustomProtocolRequestManagerClientV0 wkRequestManagerClient = {
- {
- 0, // version
- webContext // clientInfo
- },
- startLoading,
- stopLoading
- };
- WKSoupCustomProtocolRequestManagerSetClient(toAPI(webkitWebContextGetRequestManager(webContext)), &wkRequestManagerClient.base);
-}
-
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitRequestManagerClienth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -1,27 +0,0 @@
</span><del>-/*
- * 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.
- */
-
-#ifndef WebKitRequestManagerClient_h
-#define WebKitRequestManagerClient_h
-
-#include "WebKitWebContext.h"
-
-void attachRequestManagerClientToContext(WebKitWebContext*);
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitURISchemeRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><ins>+using namespace WebCore;
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * SECTION: WebKitURISchemeRequest
</span><span class="lines">@@ -54,7 +55,7 @@
</span><span class="cx">
</span><span class="cx"> struct _WebKitURISchemeRequestPrivate {
</span><span class="cx"> WebKitWebContext* webContext;
</span><del>- RefPtr<WebSoupCustomProtocolRequestManager> webRequestManager;
</del><ins>+ CustomProtocolManagerProxy* manager;
</ins><span class="cx"> RefPtr<WebPageProxy> initiatingPage;
</span><span class="cx"> uint64_t requestID;
</span><span class="cx"> CString uri;
</span><span class="lines">@@ -74,13 +75,13 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-WebKitURISchemeRequest* webkitURISchemeRequestCreate(uint64_t requestID, WebKitWebContext* webContext, API::URLRequest* urlRequest)
</del><ins>+WebKitURISchemeRequest* webkitURISchemeRequestCreate(uint64_t requestID, WebKitWebContext* webContext, const ResourceRequest& resourceRequest, CustomProtocolManagerProxy& manager)
</ins><span class="cx"> {
</span><del>- WebKitURISchemeRequest* request = WEBKIT_URI_SCHEME_REQUEST(g_object_new(WEBKIT_TYPE_URI_SCHEME_REQUEST, NULL));
</del><ins>+ WebKitURISchemeRequest* request = WEBKIT_URI_SCHEME_REQUEST(g_object_new(WEBKIT_TYPE_URI_SCHEME_REQUEST, nullptr));
</ins><span class="cx"> request->priv->webContext = webContext;
</span><del>- request->priv->webRequestManager = webkitWebContextGetRequestManager(webContext);
- request->priv->uri = urlRequest->resourceRequest().url().string().utf8();
- request->priv->initiatingPage = WebProcessProxy::webPage(urlRequest->resourceRequest().initiatingPageID());
</del><ins>+ request->priv->manager = &manager;
+ request->priv->uri = resourceRequest.url().string().utf8();
+ request->priv->initiatingPage = WebProcessProxy::webPage(resourceRequest.initiatingPageID());
</ins><span class="cx"> request->priv->requestID = requestID;
</span><span class="cx"> return request;
</span><span class="cx"> }
</span><span class="lines">@@ -87,10 +88,20 @@
</span><span class="cx">
</span><span class="cx"> void webkitURISchemeRequestCancel(WebKitURISchemeRequest* request)
</span><span class="cx"> {
</span><del>- if (request->priv->cancellable.get())
- g_cancellable_cancel(request->priv->cancellable.get());
</del><ins>+ g_cancellable_cancel(request->priv->cancellable.get());
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+CustomProtocolManagerProxy* webkitURISchemeRequestGetManager(WebKitURISchemeRequest* request)
+{
+ return request->priv->manager;
+}
+
+void webkitURISchemeRequestInvalidate(WebKitURISchemeRequest* request)
+{
+ request->priv->manager = nullptr;
+ webkitURISchemeRequestCancel(request);
+}
+
</ins><span class="cx"> /**
</span><span class="cx"> * webkit_uri_scheme_request_get_scheme:
</span><span class="cx"> * @request: a #WebKitURISchemeRequest
</span><span class="lines">@@ -159,8 +170,14 @@
</span><span class="cx"> static void webkitURISchemeRequestReadCallback(GInputStream* inputStream, GAsyncResult* result, WebKitURISchemeRequest* schemeRequest)
</span><span class="cx"> {
</span><span class="cx"> GRefPtr<WebKitURISchemeRequest> request = adoptGRef(schemeRequest);
</span><ins>+ WebKitURISchemeRequestPrivate* priv = request->priv;
</ins><span class="cx"> GUniqueOutPtr<GError> error;
</span><span class="cx"> gssize bytesRead = g_input_stream_read_finish(inputStream, result, &error.outPtr());
</span><ins>+ if (!priv->manager) {
+ webkitWebContextDidFinishLoadingCustomProtocol(priv->webContext, priv->requestID);
+ return;
+ }
+
</ins><span class="cx"> if (bytesRead == -1) {
</span><span class="cx"> webkit_uri_scheme_request_finish_error(request.get(), error.get());
</span><span class="cx"> return;
</span><span class="lines">@@ -171,22 +188,21 @@
</span><span class="cx"> if (!request->priv->stream)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- WebKitURISchemeRequestPrivate* priv = request->priv;
- Ref<API::Data> webData = API::Data::create(reinterpret_cast<const unsigned char*>(priv->readBuffer), bytesRead);
</del><ins>+ auto webData = IPC::DataReference(reinterpret_cast<const uint8_t*>(priv->readBuffer), bytesRead);
</ins><span class="cx"> if (!priv->bytesRead) {
</span><span class="cx"> // First chunk read. In case of empty reply an empty API::Data is sent to the networking process.
</span><del>- WebCore::ResourceResponse response(WebCore::URL(WebCore::URL(), String::fromUTF8(priv->uri)), String::fromUTF8(priv->mimeType.data()),
</del><ins>+ ResourceResponse response(URL(URL(), String::fromUTF8(priv->uri)), String::fromUTF8(priv->mimeType.data()),
</ins><span class="cx"> priv->streamLength, emptyString());
</span><del>- priv->webRequestManager->didReceiveResponse(priv->requestID, response);
- priv->webRequestManager->didLoadData(priv->requestID, webData.ptr());
</del><ins>+ priv->manager->didReceiveResponse(priv->requestID, response);
+ priv->manager->didLoadData(priv->requestID, webData);
</ins><span class="cx"> } else if (bytesRead || (!bytesRead && !priv->streamLength)) {
</span><span class="cx"> // Subsequent chunk read. We only send an empty API::Data to the networking process when stream length is unknown.
</span><del>- priv->webRequestManager->didLoadData(priv->requestID, webData.ptr());
</del><ins>+ priv->manager->didLoadData(priv->requestID, webData);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!bytesRead) {
</span><del>- priv->webRequestManager->didFinishLoading(request->priv->requestID);
- webkitWebContextDidFinishLoadingCustomProtocol(request->priv->webContext, request->priv->requestID);
</del><ins>+ priv->manager->didFinishLoading(priv->requestID);
+ webkitWebContextDidFinishLoadingCustomProtocol(priv->webContext, priv->requestID);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -239,7 +255,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> priv->stream = nullptr;
</span><del>- WebCore::ResourceError resourceError(g_quark_to_string(error->domain), toWebCoreError(error->code), WebCore::URL(priv->soupURI.get()), String::fromUTF8(error->message));
- priv->webRequestManager->didFailWithError(priv->requestID, resourceError);
</del><ins>+ ResourceError resourceError(g_quark_to_string(error->domain), toWebCoreError(error->code), URL(priv->soupURI.get()), String::fromUTF8(error->message));
+ priv->manager->didFailWithError(priv->requestID, resourceError);
</ins><span class="cx"> webkitWebContextDidFinishLoadingCustomProtocol(priv->webContext, priv->requestID);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitURISchemeRequestPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -20,11 +20,15 @@
</span><span class="cx"> #ifndef WebKitURISchemeRequestPrivate_h
</span><span class="cx"> #define WebKitURISchemeRequestPrivate_h
</span><span class="cx">
</span><ins>+#include "CustomProtocolManagerProxy.h"
</ins><span class="cx"> #include "WebKitPrivate.h"
</span><span class="cx"> #include "WebKitURISchemeRequest.h"
</span><span class="cx"> #include "WebKitWebContext.h"
</span><ins>+#include <WebCore/ResourceRequest.h>
</ins><span class="cx">
</span><del>-WebKitURISchemeRequest* webkitURISchemeRequestCreate(uint64_t requestID, WebKitWebContext*, API::URLRequest*);
</del><ins>+WebKitURISchemeRequest* webkitURISchemeRequestCreate(uint64_t requestID, WebKitWebContext*, const WebCore::ResourceRequest&, WebKit::CustomProtocolManagerProxy&);
</ins><span class="cx"> void webkitURISchemeRequestCancel(WebKitURISchemeRequest*);
</span><ins>+WebKit::CustomProtocolManagerProxy* webkitURISchemeRequestGetManager(WebKitURISchemeRequest*);
+void webkitURISchemeRequestInvalidate(WebKitURISchemeRequest*);
</ins><span class="cx">
</span><span class="cx"> #endif // WebKitURISchemeRequestPrivate_h
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -20,6 +20,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "WebKitWebContext.h"
</span><span class="cx">
</span><ins>+#include "APICustomProtocolManagerClient.h"
</ins><span class="cx"> #include "APIDownloadClient.h"
</span><span class="cx"> #include "APIPageConfiguration.h"
</span><span class="cx"> #include "APIProcessPoolConfiguration.h"
</span><span class="lines">@@ -30,6 +31,7 @@
</span><span class="cx"> #include "WebCookieManagerProxy.h"
</span><span class="cx"> #include "WebGeolocationManagerProxy.h"
</span><span class="cx"> #include "WebKitCookieManagerPrivate.h"
</span><ins>+#include "WebKitCustomProtocolManagerClient.h"
</ins><span class="cx"> #include "WebKitDownloadClient.h"
</span><span class="cx"> #include "WebKitDownloadPrivate.h"
</span><span class="cx"> #include "WebKitFaviconDatabasePrivate.h"
</span><span class="lines">@@ -38,7 +40,6 @@
</span><span class="cx"> #include "WebKitNotificationProvider.h"
</span><span class="cx"> #include "WebKitPluginPrivate.h"
</span><span class="cx"> #include "WebKitPrivate.h"
</span><del>-#include "WebKitRequestManagerClient.h"
</del><span class="cx"> #include "WebKitSecurityManagerPrivate.h"
</span><span class="cx"> #include "WebKitSettingsPrivate.h"
</span><span class="cx"> #include "WebKitURISchemeRequestPrivate.h"
</span><span class="lines">@@ -115,12 +116,6 @@
</span><span class="cx">
</span><span class="cx"> class WebKitURISchemeHandler: public RefCounted<WebKitURISchemeHandler> {
</span><span class="cx"> public:
</span><del>- WebKitURISchemeHandler()
- : m_callback(0)
- , m_userData(0)
- , m_destroyNotify(0)
- {
- }
</del><span class="cx"> WebKitURISchemeHandler(WebKitURISchemeRequestCallback callback, void* userData, GDestroyNotify destroyNotify)
</span><span class="cx"> : m_callback(callback)
</span><span class="cx"> , m_userData(userData)
</span><span class="lines">@@ -147,9 +142,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- WebKitURISchemeRequestCallback m_callback;
- void* m_userData;
- GDestroyNotify m_destroyNotify;
</del><ins>+ WebKitURISchemeRequestCallback m_callback { nullptr };
+ void* m_userData { nullptr };
+ GDestroyNotify m_destroyNotify { nullptr };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> typedef HashMap<String, RefPtr<WebKitURISchemeHandler> > URISchemeHandlerMap;
</span><span class="lines">@@ -162,7 +157,6 @@
</span><span class="cx"> GRefPtr<WebKitCookieManager> cookieManager;
</span><span class="cx"> GRefPtr<WebKitFaviconDatabase> faviconDatabase;
</span><span class="cx"> GRefPtr<WebKitSecurityManager> securityManager;
</span><del>- RefPtr<WebSoupCustomProtocolRequestManager> requestManager;
</del><span class="cx"> URISchemeHandlerMap uriSchemeHandlers;
</span><span class="cx"> URISchemeRequestMap uriSchemeRequests;
</span><span class="cx"> #if ENABLE(GEOLOCATION)
</span><span class="lines">@@ -275,8 +269,6 @@
</span><span class="cx"> if (!priv->websiteDataManager)
</span><span class="cx"> priv->websiteDataManager = adoptGRef(webkitWebsiteDataManagerCreate(websiteDataStoreConfigurationForWebProcessPoolConfiguration(configuration)));
</span><span class="cx">
</span><del>- priv->requestManager = priv->processPool->supplement<WebSoupCustomProtocolRequestManager>();
-
</del><span class="cx"> priv->tlsErrorsPolicy = WEBKIT_TLS_ERRORS_POLICY_FAIL;
</span><span class="cx"> priv->processPool->setIgnoreTLSErrors(false);
</span><span class="cx">
</span><span class="lines">@@ -287,7 +279,7 @@
</span><span class="cx">
</span><span class="cx"> attachInjectedBundleClientToContext(webContext);
</span><span class="cx"> attachDownloadClientToContext(webContext);
</span><del>- attachRequestManagerClientToContext(webContext);
</del><ins>+ attachCustomProtocolManagerClientToContext(webContext);
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(GEOLOCATION)
</span><span class="cx"> priv->geolocationProvider = WebKitGeolocationProvider::create(priv->processPool->supplement<WebGeolocationManagerProxy>());
</span><span class="lines">@@ -304,6 +296,7 @@
</span><span class="cx"> priv->clientsDetached = true;
</span><span class="cx"> priv->processPool->initializeInjectedBundleClient(nullptr);
</span><span class="cx"> priv->processPool->setDownloadClient(nullptr);
</span><ins>+ priv->processPool->setCustomProtocolManagerClient(nullptr);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> G_OBJECT_CLASS(webkit_web_context_parent_class)->dispose(object);
</span><span class="lines">@@ -849,8 +842,9 @@
</span><span class="cx"> g_return_if_fail(callback);
</span><span class="cx">
</span><span class="cx"> RefPtr<WebKitURISchemeHandler> handler = adoptRef(new WebKitURISchemeHandler(callback, userData, destroyNotify));
</span><del>- context->priv->uriSchemeHandlers.set(String::fromUTF8(scheme), handler.get());
- context->priv->requestManager->registerSchemeForCustomProtocol(String::fromUTF8(scheme));
</del><ins>+ auto addResult = context->priv->uriSchemeHandlers.set(String::fromUTF8(scheme), handler.get());
+ if (addResult.isNewEntry)
+ context->priv->processPool->registerSchemeForCustomProtocol(String::fromUTF8(scheme));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -1266,14 +1260,9 @@
</span><span class="cx"> return context->priv->processPool.get();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-WebSoupCustomProtocolRequestManager* webkitWebContextGetRequestManager(WebKitWebContext* context)
</del><ins>+void webkitWebContextStartLoadingCustomProtocol(WebKitWebContext* context, uint64_t customProtocolID, const WebCore::ResourceRequest& resourceRequest, CustomProtocolManagerProxy& manager)
</ins><span class="cx"> {
</span><del>- return context->priv->requestManager.get();
-}
-
-void webkitWebContextStartLoadingCustomProtocol(WebKitWebContext* context, uint64_t customProtocolID, API::URLRequest* urlRequest)
-{
- GRefPtr<WebKitURISchemeRequest> request = adoptGRef(webkitURISchemeRequestCreate(customProtocolID, context, urlRequest));
</del><ins>+ GRefPtr<WebKitURISchemeRequest> request = adoptGRef(webkitURISchemeRequestCreate(customProtocolID, context, resourceRequest, manager));
</ins><span class="cx"> String scheme(String::fromUTF8(webkit_uri_scheme_request_get_scheme(request.get())));
</span><span class="cx"> RefPtr<WebKitURISchemeHandler> handler = context->priv->uriSchemeHandlers.get(scheme);
</span><span class="cx"> ASSERT(handler.get());
</span><span class="lines">@@ -1292,6 +1281,16 @@
</span><span class="cx"> webkitURISchemeRequestCancel(request.get());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void webkitWebContextInvalidateCustomProtocolRequests(WebKitWebContext* context, CustomProtocolManagerProxy& manager)
+{
+ Vector<GRefPtr<WebKitURISchemeRequest>> requests;
+ copyValuesToVector(context->priv->uriSchemeRequests, requests);
+ for (auto& request : requests) {
+ if (webkitURISchemeRequestGetManager(request.get()) == &manager)
+ webkitURISchemeRequestInvalidate(request.get());
+ }
+}
+
</ins><span class="cx"> void webkitWebContextDidFinishLoadingCustomProtocol(WebKitWebContext* context, uint64_t customProtocolID)
</span><span class="cx"> {
</span><span class="cx"> context->priv->uriSchemeRequests.remove(customProtocolID);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -26,12 +26,13 @@
</span><span class="cx"> #ifndef WebKitWebContextPrivate_h
</span><span class="cx"> #define WebKitWebContextPrivate_h
</span><span class="cx">
</span><ins>+#include "CustomProtocolManagerProxy.h"
</ins><span class="cx"> #include "DownloadProxy.h"
</span><span class="cx"> #include "WebKitPrivate.h"
</span><span class="cx"> #include "WebKitUserContentManager.h"
</span><span class="cx"> #include "WebKitWebContext.h"
</span><span class="cx"> #include "WebProcessPool.h"
</span><del>-#include "WebSoupCustomProtocolRequestManager.h"
</del><ins>+#include <WebCore/ResourceRequest.h>
</ins><span class="cx">
</span><span class="cx"> WebKit::WebProcessPool* webkitWebContextGetProcessPool(WebKitWebContext*);
</span><span class="cx"> WebKitDownload* webkitWebContextGetOrCreateDownload(WebKit::DownloadProxy*);
</span><span class="lines">@@ -38,9 +39,9 @@
</span><span class="cx"> WebKitDownload* webkitWebContextStartDownload(WebKitWebContext*, const char* uri, WebKit::WebPageProxy*);
</span><span class="cx"> void webkitWebContextRemoveDownload(WebKit::DownloadProxy*);
</span><span class="cx"> void webkitWebContextDownloadStarted(WebKitWebContext*, WebKitDownload*);
</span><del>-WebKit::WebSoupCustomProtocolRequestManager* webkitWebContextGetRequestManager(WebKitWebContext*);
-void webkitWebContextStartLoadingCustomProtocol(WebKitWebContext*, uint64_t customProtocolID, API::URLRequest*);
</del><ins>+void webkitWebContextStartLoadingCustomProtocol(WebKitWebContext*, uint64_t customProtocolID, const WebCore::ResourceRequest&, WebKit::CustomProtocolManagerProxy&);
</ins><span class="cx"> void webkitWebContextStopLoadingCustomProtocol(WebKitWebContext*, uint64_t customProtocolID);
</span><ins>+void webkitWebContextInvalidateCustomProtocolRequests(WebKitWebContext*, WebKit::CustomProtocolManagerProxy&);
</ins><span class="cx"> void webkitWebContextDidFinishLoadingCustomProtocol(WebKitWebContext*, uint64_t customProtocolID);
</span><span class="cx"> bool webkitWebContextIsLoadingCustomProtocol(WebKitWebContext*, uint64_t customProtocolID);
</span><span class="cx"> void webkitWebContextCreatePageForWebView(WebKitWebContext*, WebKitWebView*, WebKitUserContentManager*, WebKitWebView*);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkCustomProtocolsCustomProtocolManagerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -34,8 +34,14 @@
</span><span class="cx"> OBJC_CLASS WKCustomProtocolLoader;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+namespace IPC {
+class DataReference;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><ins>+class ResourceError;
</ins><span class="cx"> class ResourceRequest;
</span><ins>+class ResourceResponse;
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -51,6 +57,15 @@
</span><span class="cx"> void startLoading(uint64_t customProtocolID, const WebCore::ResourceRequest&);
</span><span class="cx"> void stopLoading(uint64_t customProtocolID);
</span><span class="cx">
</span><ins>+ void processDidClose();
+
+#if USE(SOUP)
+ void didReceiveResponse(uint64_t customProtocolID, const WebCore::ResourceResponse&);
+ void didLoadData(uint64_t customProtocolID, const IPC::DataReference&);
+ void didFailWithError(uint64_t customProtocolID, const WebCore::ResourceError&);
+ void didFinishLoading(uint64_t customProtocolID);
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx"> // IPC::MessageReceiver
</span><span class="cx"> void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkCustomProtocolsmacCustomProtocolManagerProxyMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -160,4 +160,8 @@
</span><span class="cx"> m_loaderMap.remove(customProtocolID);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void CustomProtocolManagerProxy::processDidClose()
+{
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkCustomProtocolssoupCustomProtocolManagerProxySoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -20,13 +20,19 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "CustomProtocolManagerProxy.h"
</span><span class="cx">
</span><ins>+#include "APICustomProtocolManagerClient.h"
</ins><span class="cx"> #include "ChildProcessProxy.h"
</span><span class="cx"> #include "CustomProtocolManagerMessages.h"
</span><span class="cx"> #include "CustomProtocolManagerProxyMessages.h"
</span><span class="cx"> #include "WebProcessPool.h"
</span><del>-#include "WebSoupCustomProtocolRequestManager.h"
</del><span class="cx"> #include <WebCore/ResourceRequest.h>
</span><span class="cx">
</span><ins>+#if PLATFORM(GTK)
+#include <WebCore/ErrorsGtk.h>
+#elif PLATFORM(EFL)
+#include <WebCore/ErrorsEfl.h>
+#endif
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><span class="cx"> CustomProtocolManagerProxy::CustomProtocolManagerProxy(ChildProcessProxy* childProcessProxy, WebProcessPool& processPool)
</span><span class="lines">@@ -42,14 +48,40 @@
</span><span class="cx"> m_childProcessProxy->removeMessageReceiver(Messages::CustomProtocolManagerProxy::messageReceiverName());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void CustomProtocolManagerProxy::processDidClose()
+{
+ m_processPool.customProtocolManagerClient().invalidate(*this);
+}
+
</ins><span class="cx"> void CustomProtocolManagerProxy::startLoading(uint64_t customProtocolID, const WebCore::ResourceRequest& request)
</span><span class="cx"> {
</span><del>- m_processPool.supplement<WebSoupCustomProtocolRequestManager>()->startLoading(customProtocolID, request);
</del><ins>+ if (!m_processPool.customProtocolManagerClient().startLoading(*this, customProtocolID, request))
+ didFailWithError(customProtocolID, WebCore::cannotShowURLError(request));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CustomProtocolManagerProxy::stopLoading(uint64_t customProtocolID)
</span><span class="cx"> {
</span><del>- m_processPool.supplement<WebSoupCustomProtocolRequestManager>()->stopLoading(customProtocolID);
</del><ins>+ m_processPool.customProtocolManagerClient().stopLoading(*this, customProtocolID);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void CustomProtocolManagerProxy::didReceiveResponse(uint64_t customProtocolID, const WebCore::ResourceResponse& response)
+{
+ m_childProcessProxy->send(Messages::CustomProtocolManager::DidReceiveResponse(customProtocolID, response, 0), 0);
+}
+
+void CustomProtocolManagerProxy::didLoadData(uint64_t customProtocolID, const IPC::DataReference& data)
+{
+ m_childProcessProxy->send(Messages::CustomProtocolManager::DidLoadData(customProtocolID, data), 0);
+}
+
+void CustomProtocolManagerProxy::didFailWithError(uint64_t customProtocolID, const WebCore::ResourceError& error)
+{
+ m_childProcessProxy->send(Messages::CustomProtocolManager::DidFailWithError(customProtocolID, error), 0);
+}
+
+void CustomProtocolManagerProxy::didFinishLoading(uint64_t customProtocolID)
+{
+ m_childProcessProxy->send(Messages::CustomProtocolManager::DidFinishLoading(customProtocolID), 0);
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkCustomProtocolssoupWebSoupCustomProtocolRequestManagercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -1,149 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Igalia S.L.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "WebSoupCustomProtocolRequestManager.h"
-
-#include "APIData.h"
-#include "CustomProtocolManagerMessages.h"
-#include "WebProcessPool.h"
-#include <WebCore/ResourceError.h>
-#include <WebCore/ResourceRequest.h>
-#include <WebCore/ResourceResponse.h>
-
-#if PLATFORM(GTK)
-#include <WebCore/ErrorsGtk.h>
-#elif PLATFORM(EFL)
-#include <WebCore/ErrorsEfl.h>
-#endif
-
-namespace WebKit {
-
-const char* WebSoupCustomProtocolRequestManager::supplementName()
-{
- return "WebSoupCustomProtocolRequestManager";
-}
-
-Ref<WebSoupCustomProtocolRequestManager> WebSoupCustomProtocolRequestManager::create(WebProcessPool* processPool)
-{
- return adoptRef(*new WebSoupCustomProtocolRequestManager(processPool));
-}
-
-WebSoupCustomProtocolRequestManager::WebSoupCustomProtocolRequestManager(WebProcessPool* processPool)
- : WebContextSupplement(processPool)
-{
-}
-
-WebSoupCustomProtocolRequestManager::~WebSoupCustomProtocolRequestManager()
-{
-}
-
-void WebSoupCustomProtocolRequestManager::initializeClient(const WKSoupCustomProtocolRequestManagerClientBase* client)
-{
- m_client.initialize(client);
-}
-
-// WebContextSupplement
-void WebSoupCustomProtocolRequestManager::processPoolDestroyed()
-{
-}
-
-void WebSoupCustomProtocolRequestManager::processDidClose(WebProcessProxy*)
-{
-}
-
-void WebSoupCustomProtocolRequestManager::refWebContextSupplement()
-{
- API::Object::ref();
-}
-
-void WebSoupCustomProtocolRequestManager::derefWebContextSupplement()
-{
- API::Object::deref();
-}
-
-void WebSoupCustomProtocolRequestManager::registerSchemeForCustomProtocol(const String& scheme)
-{
- ASSERT(!scheme.isNull());
- if (m_registeredSchemes.contains(scheme))
- return;
-
- if (!processPool())
- return;
-
- processPool()->registerSchemeForCustomProtocol(scheme);
-
- m_registeredSchemes.append(scheme);
-}
-
-void WebSoupCustomProtocolRequestManager::unregisterSchemeForCustomProtocol(const String& scheme)
-{
- if (!processPool())
- return;
-
- processPool()->unregisterSchemeForCustomProtocol(scheme);
-
- bool removed = m_registeredSchemes.removeFirst(scheme);
- ASSERT_UNUSED(removed, removed);
-}
-
-void WebSoupCustomProtocolRequestManager::startLoading(uint64_t customProtocolID, const WebCore::ResourceRequest& request)
-{
- if (!m_client.startLoading(this, customProtocolID, request))
- didFailWithError(customProtocolID, WebCore::cannotShowURLError(request));
-}
-
-void WebSoupCustomProtocolRequestManager::stopLoading(uint64_t customProtocolID)
-{
- m_client.stopLoading(this, customProtocolID);
-}
-
-void WebSoupCustomProtocolRequestManager::didReceiveResponse(uint64_t customProtocolID, const WebCore::ResourceResponse& response)
-{
- if (!processPool())
- return;
-
- processPool()->networkingProcessConnection()->send(Messages::CustomProtocolManager::DidReceiveResponse(customProtocolID, response, 0), 0);
-}
-
-void WebSoupCustomProtocolRequestManager::didLoadData(uint64_t customProtocolID, const API::Data* data)
-{
- if (!processPool())
- return;
-
- processPool()->networkingProcessConnection()->send(Messages::CustomProtocolManager::DidLoadData(customProtocolID, data->dataReference()), 0);
-}
-
-void WebSoupCustomProtocolRequestManager::didFailWithError(uint64_t customProtocolID, const WebCore::ResourceError& error)
-{
- if (!processPool())
- return;
-
- processPool()->networkingProcessConnection()->send(Messages::CustomProtocolManager::DidFailWithError(customProtocolID, error), 0);
-}
-
-void WebSoupCustomProtocolRequestManager::didFinishLoading(uint64_t customProtocolID)
-{
- if (!processPool())
- return;
-
- processPool()->networkingProcessConnection()->send(Messages::CustomProtocolManager::DidFinishLoading(customProtocolID), 0);
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkCustomProtocolssoupWebSoupCustomProtocolRequestManagerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -1,83 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Igalia S.L.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef WebSoupCustomProtocolRequestManager_h
-#define WebSoupCustomProtocolRequestManager_h
-
-#include "APIObject.h"
-#include "WebContextSupplement.h"
-#include "WebSoupCustomProtocolRequestManagerClient.h"
-#include <wtf/RefPtr.h>
-#include <wtf/text/WTFString.h>
-
-namespace API {
-class Data;
-}
-
-namespace WebCore {
-class ResourceError;
-class ResourceRequest;
-class ResourceResponse;
-}
-
-namespace WebKit {
-
-class WebProcessPool;
-
-class WebSoupCustomProtocolRequestManager : public API::ObjectImpl<API::Object::Type::SoupCustomProtocolRequestManager>, public WebContextSupplement {
-public:
- static const char* supplementName();
-
- static Ref<WebSoupCustomProtocolRequestManager> create(WebProcessPool*);
- virtual ~WebSoupCustomProtocolRequestManager();
-
- void initializeClient(const WKSoupCustomProtocolRequestManagerClientBase*);
-
- void registerSchemeForCustomProtocol(const String& scheme);
- void unregisterSchemeForCustomProtocol(const String& scheme);
-
- void startLoading(uint64_t customProtocolID, const WebCore::ResourceRequest&);
- void stopLoading(uint64_t customProtocolID);
-
- void didReceiveResponse(uint64_t customProtocolID, const WebCore::ResourceResponse&);
- void didLoadData(uint64_t customProtocolID, const API::Data*);
- void didFailWithError(uint64_t customProtocolID, const WebCore::ResourceError&);
- void didFinishLoading(uint64_t customProtocolID);
-
- const Vector<String>& registeredSchemesForCustomProtocols() const { return m_registeredSchemes; }
-
- using API::Object::ref;
- using API::Object::deref;
-
-private:
- WebSoupCustomProtocolRequestManager(WebProcessPool*);
-
- // WebContextSupplement
- void processPoolDestroyed() override;
- void processDidClose(WebProcessProxy*) override;
- void refWebContextSupplement() override;
- void derefWebContextSupplement() override;
-
- WebSoupCustomProtocolRequestManagerClient m_client;
- Vector<String> m_registeredSchemes;
-};
-
-} // namespace WebKit
-
-#endif // WebSoupCustomProtocolRequestManager_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkCustomProtocolssoupWebSoupCustomProtocolRequestManagerClientcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -1,43 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Igalia S.L.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "WebSoupCustomProtocolRequestManagerClient.h"
-
-#include "WebSoupCustomProtocolRequestManager.h"
-
-namespace WebKit {
-
-bool WebSoupCustomProtocolRequestManagerClient::startLoading(WebSoupCustomProtocolRequestManager* soupRequestManager, uint64_t customProtocolID, const WebCore::ResourceRequest& request)
-{
- if (!m_client.startLoading)
- return false;
-
- Ref<API::URLRequest> urlRequest = API::URLRequest::create(request);
- m_client.startLoading(toAPI(soupRequestManager), customProtocolID, toAPI(urlRequest.ptr()), m_client.base.clientInfo);
- return true;
-}
-
-void WebSoupCustomProtocolRequestManagerClient::stopLoading(WebSoupCustomProtocolRequestManager* soupRequestManager, uint64_t customProtocolID)
-{
- if (m_client.stopLoading)
- m_client.stopLoading(toAPI(soupRequestManager), customProtocolID, m_client.base.clientInfo);
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkCustomProtocolssoupWebSoupCustomProtocolRequestManagerClienth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -1,50 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Igalia S.L.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef WebSoupCustomProtocolRequestManagerClient_h
-#define WebSoupCustomProtocolRequestManagerClient_h
-
-#include "APIClient.h"
-#include "WKAPICast.h"
-#include "WKSoupCustomProtocolRequestManager.h"
-
-namespace API {
-
-template<> struct ClientTraits<WKSoupCustomProtocolRequestManagerClientBase> {
- typedef std::tuple<WKSoupCustomProtocolRequestManagerClientV0> Versions;
-};
-}
-
-namespace WebCore {
-class ResourceRequest;
-}
-
-namespace WebKit {
-
-class WebSoupCustomProtocolRequestManager;
-
-class WebSoupCustomProtocolRequestManagerClient : public API::Client<WKSoupCustomProtocolRequestManagerClientBase> {
-public:
- bool startLoading(WebSoupCustomProtocolRequestManager*, uint64_t customProtocolID, const WebCore::ResourceRequest&);
- void stopLoading(WebSoupCustomProtocolRequestManager*, uint64_t customProtocolID);
-};
-
-} // namespace WebKit
-
-#endif // WebSoupCustomProtocolRequestManagerClient_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkNetworkProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -219,6 +219,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (m_downloadProxyMap)
</span><span class="cx"> m_downloadProxyMap->processDidClose();
</span><ins>+ m_customProtocolManagerProxy.processDidClose();
</ins><span class="cx">
</span><span class="cx"> m_tokenForHoldingLockedFiles = nullptr;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "APIArray.h"
</span><span class="cx"> #include "APIAutomationClient.h"
</span><ins>+#include "APICustomProtocolManagerClient.h"
</ins><span class="cx"> #include "APIDownloadClient.h"
</span><span class="cx"> #include "APILegacyContextHistoryClient.h"
</span><span class="cx"> #include "APIPageConfiguration.h"
</span><span class="lines">@@ -90,10 +91,6 @@
</span><span class="cx"> #include <JavaScriptCore/RemoteInspector.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if USE(SOUP)
-#include "WebSoupCustomProtocolRequestManager.h"
-#endif
-
</del><span class="cx"> #if OS(LINUX)
</span><span class="cx"> #include "MemoryPressureMonitor.h"
</span><span class="cx"> #endif
</span><span class="lines">@@ -157,6 +154,9 @@
</span><span class="cx"> , m_automationClient(std::make_unique<API::AutomationClient>())
</span><span class="cx"> , m_downloadClient(std::make_unique<API::DownloadClient>())
</span><span class="cx"> , m_historyClient(std::make_unique<API::LegacyContextHistoryClient>())
</span><ins>+#if USE(SOUP)
+ , m_customProtocolManagerClient(std::make_unique<API::CustomProtocolManagerClient>())
+#endif
</ins><span class="cx"> , m_visitedLinkStore(VisitedLinkStore::create())
</span><span class="cx"> , m_visitedLinksPopulated(false)
</span><span class="cx"> , m_plugInAutoStartProvider(this)
</span><span class="lines">@@ -165,9 +165,6 @@
</span><span class="cx"> , m_memorySamplerEnabled(false)
</span><span class="cx"> , m_memorySamplerInterval(1400.0)
</span><span class="cx"> , m_websiteDataStore(m_configuration->shouldHaveLegacyDataStore() ? API::WebsiteDataStore::create(legacyWebsiteDataStoreConfiguration(m_configuration)).ptr() : nullptr)
</span><del>-#if USE(SOUP)
- , m_initialHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain)
-#endif
</del><span class="cx"> , m_shouldUseTestingNetworkSession(false)
</span><span class="cx"> , m_processTerminationEnabled(true)
</span><span class="cx"> , m_canHandleHTTPSServerTrustEvaluation(true)
</span><span class="lines">@@ -197,9 +194,6 @@
</span><span class="cx"> addSupplement<WebCookieManagerProxy>();
</span><span class="cx"> addSupplement<WebGeolocationManagerProxy>();
</span><span class="cx"> addSupplement<WebNotificationManagerProxy>();
</span><del>-#if USE(SOUP)
- addSupplement<WebSoupCustomProtocolRequestManager>();
-#endif
</del><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span><span class="cx"> addSupplement<WebMediaSessionFocusManager>();
</span><span class="cx"> #endif
</span><span class="lines">@@ -1364,11 +1358,17 @@
</span><span class="cx">
</span><span class="cx"> void WebProcessPool::registerSchemeForCustomProtocol(const String& scheme)
</span><span class="cx"> {
</span><ins>+#if USE(SOUP)
+ m_urlSchemesRegisteredForCustomProtocols.add(scheme);
+#endif
</ins><span class="cx"> sendToNetworkingProcess(Messages::CustomProtocolManager::RegisterScheme(scheme));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebProcessPool::unregisterSchemeForCustomProtocol(const String& scheme)
</span><span class="cx"> {
</span><ins>+#if USE(SOUP)
+ m_urlSchemesRegisteredForCustomProtocols.remove(scheme);
+#endif
</ins><span class="cx"> sendToNetworkingProcess(Messages::CustomProtocolManager::UnregisterScheme(scheme));
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx">
</span><span class="cx"> namespace API {
</span><span class="cx"> class AutomationClient;
</span><ins>+class CustomProtocolManagerClient;
</ins><span class="cx"> class DownloadClient;
</span><span class="cx"> class LegacyContextHistoryClient;
</span><span class="cx"> class PageConfiguration;
</span><span class="lines">@@ -135,6 +136,9 @@
</span><span class="cx"> void setHistoryClient(std::unique_ptr<API::LegacyContextHistoryClient>);
</span><span class="cx"> void setDownloadClient(std::unique_ptr<API::DownloadClient>);
</span><span class="cx"> void setAutomationClient(std::unique_ptr<API::AutomationClient>);
</span><ins>+#if USE(SOUP)
+ void setCustomProtocolManagerClient(std::unique_ptr<API::CustomProtocolManagerClient>&&);
+#endif
</ins><span class="cx">
</span><span class="cx"> void setMaximumNumberOfProcesses(unsigned); // Can only be called when there are no processes running.
</span><span class="cx"> unsigned maximumNumberOfProcesses() const { return !m_configuration->maximumProcessCount() ? UINT_MAX : m_configuration->maximumProcessCount(); }
</span><span class="lines">@@ -225,6 +229,10 @@
</span><span class="cx"> API::LegacyContextHistoryClient& historyClient() { return *m_historyClient; }
</span><span class="cx"> WebContextClient& client() { return m_client; }
</span><span class="cx">
</span><ins>+#if USE(SOUP)
+ API::CustomProtocolManagerClient& customProtocolManagerClient() const { return *m_customProtocolManagerClient; }
+#endif
+
</ins><span class="cx"> WebIconDatabase* iconDatabase() const { return m_iconDatabase.get(); }
</span><span class="cx">
</span><span class="cx"> struct Statistics {
</span><span class="lines">@@ -455,6 +463,9 @@
</span><span class="cx"> std::unique_ptr<API::AutomationClient> m_automationClient;
</span><span class="cx"> std::unique_ptr<API::DownloadClient> m_downloadClient;
</span><span class="cx"> std::unique_ptr<API::LegacyContextHistoryClient> m_historyClient;
</span><ins>+#if USE(SOUP)
+ std::unique_ptr<API::CustomProtocolManagerClient> m_customProtocolManagerClient;
+#endif
</ins><span class="cx">
</span><span class="cx"> RefPtr<WebAutomationSession> m_automationSession;
</span><span class="cx">
</span><span class="lines">@@ -499,7 +510,7 @@
</span><span class="cx"> WebContextSupplementMap m_supplements;
</span><span class="cx">
</span><span class="cx"> #if USE(SOUP)
</span><del>- HTTPCookieAcceptPolicy m_initialHTTPCookieAcceptPolicy;
</del><ins>+ HTTPCookieAcceptPolicy m_initialHTTPCookieAcceptPolicy { HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain };
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="lines">@@ -530,6 +541,7 @@
</span><span class="cx">
</span><span class="cx"> #if USE(SOUP)
</span><span class="cx"> bool m_ignoreTLSErrors { true };
</span><ins>+ HashSet<String, ASCIICaseInsensitiveHash> m_urlSchemesRegisteredForCustomProtocols;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> bool m_memoryCacheDisabled;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcesseflRequestManagerClientEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -26,52 +26,60 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "RequestManagerClientEfl.h"
</span><span class="cx">
</span><ins>+#include "APICustomProtocolManagerClient.h"
+#include "CustomProtocolManagerProxy.h"
</ins><span class="cx"> #include "ewk_context_private.h"
</span><span class="cx"> #include "ewk_url_scheme_request_private.h"
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><del>-static inline RequestManagerClientEfl* toRequestManagerClientEfl(const void* clientInfo)
-{
- return static_cast<RequestManagerClientEfl*>(const_cast<void*>(clientInfo));
-}
</del><ins>+class CustomProtocolManagerClient final : public API::CustomProtocolManagerClient {
+public:
+ explicit CustomProtocolManagerClient(RequestManagerClientEfl* client)
+ : m_client(client)
+ {
+ }
</ins><span class="cx">
</span><del>-RequestManagerClientEfl::RequestManagerClientEfl(WKContextRef context)
-{
- m_requestManager = toAPI(toImpl(context)->supplement<WebSoupCustomProtocolRequestManager>());
- ASSERT(m_requestManager);
</del><ins>+private:
+ bool startLoading(CustomProtocolManagerProxy& manager, uint64_t customProtocolID, const WebCore::ResourceRequest& resourceRequest) override
+ {
+ auto urlRequest = API::URLRequest::create(resourceRequest);
+ RefPtr<EwkUrlSchemeRequest> request = EwkUrlSchemeRequest::create(manager, urlRequest.ptr(), customProtocolID);
+ String scheme(String::fromUTF8(request.get()->scheme()));
+ RefPtr<WebKitURISchemeHandler> handler = (m_client->m_uriSchemeHandlers).get(scheme);
+ ASSERT(handler.get());
+ if (!handler->hasCallback())
+ return true;
</ins><span class="cx">
</span><del>- WKSoupCustomProtocolRequestManagerClientV0 wkRequestManagerClient;
- memset(&wkRequestManagerClient, 0, sizeof(WKSoupCustomProtocolRequestManagerClientV0));
</del><ins>+ (m_client->m_uriSchemeRequests).set(customProtocolID, request);
+ handler->performCallback(request.get());
+ return true;
+ }
</ins><span class="cx">
</span><del>- wkRequestManagerClient.base.version = 0;
- wkRequestManagerClient.base.clientInfo = this;
- wkRequestManagerClient.startLoading = startLoading;
- wkRequestManagerClient.stopLoading = stopLoading;
</del><ins>+ void stopLoading(CustomProtocolManagerProxy&, uint64_t customProtocolID) override
+ {
+ (m_client->m_uriSchemeRequests).remove(customProtocolID);
+ }
</ins><span class="cx">
</span><del>- WKSoupCustomProtocolRequestManagerSetClient(m_requestManager.get(), &wkRequestManagerClient.base);
-}
</del><ins>+ void invalidate(CustomProtocolManagerProxy& manager) override
+ {
+ Vector<RefPtr<EwkUrlSchemeRequest>> requests;
+ copyValuesToVector(m_client->m_uriSchemeRequests, requests);
+ for (auto& request : requests) {
+ if (request->manager() == &manager) {
+ request->invalidate();
+ stopLoading(manager, request->id());
+ }
+ }
+ }
</ins><span class="cx">
</span><del>-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;
</del><ins>+ RequestManagerClientEfl* m_client;
+};
</ins><span class="cx">
</span><del>- (client->m_uriSchemeRequests).set(customProtocolID, request);
- handler->performCallback(request.get());
-}
-
-void RequestManagerClientEfl::stopLoading(WKSoupCustomProtocolRequestManagerRef manager, uint64_t customProtocolID, const void* clientInfo)
</del><ins>+RequestManagerClientEfl::RequestManagerClientEfl(WKContextRef context)
</ins><span class="cx"> {
</span><del>- UNUSED_PARAM(manager);
-
- RequestManagerClientEfl* client = toRequestManagerClientEfl(clientInfo);
- (client->m_uriSchemeRequests).remove(customProtocolID);
</del><ins>+ m_processPool = toImpl(context);
+ m_processPool->setCustomProtocolManagerClient(std::make_unique<CustomProtocolManagerClient>(this));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RequestManagerClientEfl::registerURLSchemeHandler(const String& scheme, Ewk_Url_Scheme_Request_Cb callback, void* userData)
</span><span class="lines">@@ -79,8 +87,9 @@
</span><span class="cx"> ASSERT(callback);
</span><span class="cx">
</span><span class="cx"> RefPtr<WebKitURISchemeHandler> handler = adoptRef(new WebKitURISchemeHandler(callback, userData));
</span><del>- m_uriSchemeHandlers.set(scheme, handler);
- toImpl(m_requestManager.get())->registerSchemeForCustomProtocol(scheme);
</del><ins>+ auto addResult = m_uriSchemeHandlers.set(scheme, handler);
+ if (addResult.isNewEntry)
+ m_processPool->registerSchemeForCustomProtocol(scheme);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcesseflRequestManagerClientEflh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #define RequestManagerClientEfl_h
</span><span class="cx">
</span><span class="cx"> #include "WebProcessPool.h"
</span><del>-#include "WebSoupCustomProtocolRequestManager.h"
</del><span class="cx"> #include "ewk_context_private.h"
</span><span class="cx"> #include "ewk_url_scheme_request_private.h"
</span><span class="cx">
</span><span class="lines">@@ -38,6 +37,8 @@
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><ins>+class CustomProtocolManagerClient;
+
</ins><span class="cx"> class WebKitURISchemeHandler: public RefCounted<WebKitURISchemeHandler> {
</span><span class="cx"> public:
</span><span class="cx"> WebKitURISchemeHandler()
</span><span class="lines">@@ -79,10 +80,9 @@
</span><span class="cx"> void registerURLSchemeHandler(const String& scheme, Ewk_Url_Scheme_Request_Cb callback, void* userData);
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- static void startLoading(WKSoupCustomProtocolRequestManagerRef, uint64_t customProtocolID, WKURLRequestRef, const void* clientInfo);
- static void stopLoading(WKSoupCustomProtocolRequestManagerRef, uint64_t customProtocolID, const void* clientInfo);
</del><ins>+ friend class CustomProtocolManagerClient;
</ins><span class="cx">
</span><del>- WKRetainPtr<WKSoupCustomProtocolRequestManagerRef> m_requestManager;
</del><ins>+ WebProcessPool* m_processPool;
</ins><span class="cx"> URISchemeHandlerMap m_uriSchemeHandlers;
</span><span class="cx"> URISchemeRequestMap m_uriSchemeRequests;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcesseflWebProcessPoolEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include "WebInspectorServer.h"
</span><span class="cx"> #include "WebProcessCreationParameters.h"
</span><span class="cx"> #include "WebProcessMessages.h"
</span><del>-#include "WebSoupCustomProtocolRequestManager.h"
</del><span class="cx"> #include <Efreet.h>
</span><span class="cx"> #include <WebCore/ApplicationCacheStorage.h>
</span><span class="cx"> #include <WebCore/IconDatabase.h>
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkWebProcessPoolGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx"> #include "WebInspectorServer.h"
</span><span class="cx"> #include "WebProcessCreationParameters.h"
</span><span class="cx"> #include "WebProcessMessages.h"
</span><del>-#include "WebSoupCustomProtocolRequestManager.h"
</del><span class="cx"> #include <WebCore/FileSystem.h>
</span><span class="cx"> #include <WebCore/NotImplemented.h>
</span><span class="cx"> #include <WebCore/SchemeRegistry.h>
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcesssoupWebProcessPoolSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/soup/WebProcessPoolSoup.cpp (208958 => 208959)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/soup/WebProcessPoolSoup.cpp        2016-11-22 06:30:33 UTC (rev 208958)
+++ trunk/Source/WebKit2/UIProcess/soup/WebProcessPoolSoup.cpp        2016-11-22 07:49:55 UTC (rev 208959)
</span><span class="lines">@@ -26,10 +26,10 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "WebProcessPool.h"
</span><span class="cx">
</span><ins>+#include "APICustomProtocolManagerClient.h"
</ins><span class="cx"> #include "NetworkProcessCreationParameters.h"
</span><span class="cx"> #include "NetworkProcessMessages.h"
</span><span class="cx"> #include "WebCookieManagerProxy.h"
</span><del>-#include "WebSoupCustomProtocolRequestManager.h"
</del><span class="cx"> #include <WebCore/Language.h>
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -40,7 +40,8 @@
</span><span class="cx"> parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
</span><span class="cx"> parameters.ignoreTLSErrors = m_ignoreTLSErrors;
</span><span class="cx"> parameters.languages = WebCore::userPreferredLanguages();
</span><del>- parameters.urlSchemesRegisteredForCustomProtocols = supplement<WebSoupCustomProtocolRequestManager>()->registeredSchemesForCustomProtocols();
</del><ins>+ for (const auto& scheme : m_urlSchemesRegisteredForCustomProtocols)
+ parameters.urlSchemesRegisteredForCustomProtocols.append(scheme);
</ins><span class="cx"> parameters.shouldEnableNetworkCacheEfficacyLogging = false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -51,4 +52,12 @@
</span><span class="cx"> networkProcess()->send(Messages::NetworkProcess::SetIgnoreTLSErrors(m_ignoreTLSErrors), 0);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebProcessPool::setCustomProtocolManagerClient(std::unique_ptr<API::CustomProtocolManagerClient>&& customProtocolManagerClient)
+{
+ if (!customProtocolManagerClient)
+ m_customProtocolManagerClient = std::make_unique<API::CustomProtocolManagerClient>();
+ else
+ m_customProtocolManagerClient = WTFMove(customProtocolManagerClient);
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre>
</div>
</div>
</body>
</html>