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