<!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>[218691] 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/218691">218691</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2017-06-22 04:55:07 -0700 (Thu, 22 Jun 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WPE] Downloads never have a web view associated in WPE
https://bugs.webkit.org/show_bug.cgi?id=173709

Reviewed by Žan Doberšek.

Convert the WPE view client into an API client and add handleDownloadRequest(). WebKitWebView now uses it to
associate itself to the download like the GTK+ port does.

* PlatformWPE.cmake:
* UIProcess/API/C/wpe/WKView.cpp:
(WKViewSetViewClient): Add C API client implementation here.
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewConstructed): Set the view client in WPE.
* UIProcess/API/wpe/APIViewClient.h: Renamed from Source/WebKit2/UIProcess/API/wpe/WPEViewClient.h.
(API::ViewClient::frameDisplayed):
(API::ViewClient::handleDownloadRequest):
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::handleDownloadRequest): Call WKWPE::View::handleDownloadRequest().
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::View::View): Initialize the view client.
(WKWPE::View::setClient): Set or reset the client.
(WKWPE::View::handleDownloadRequest): Notify the client.
* UIProcess/API/wpe/WPEView.h:
* UIProcess/API/wpe/WPEViewClient.cpp: Removed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformWPEcmake">trunk/Source/WebKit2/PlatformWPE.cmake</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICwpeWKViewcpp">trunk/Source/WebKit2/UIProcess/API/C/wpe/WKView.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIglibWebKitWebViewcpp">trunk/Source/WebKit2/UIProcess/API/glib/WebKitWebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIwpePageClientImplcpp">trunk/Source/WebKit2/UIProcess/API/wpe/PageClientImpl.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIwpeWPEViewcpp">trunk/Source/WebKit2/UIProcess/API/wpe/WPEView.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIwpeWPEViewh">trunk/Source/WebKit2/UIProcess/API/wpe/WPEView.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPIwpeAPIViewClienth">trunk/Source/WebKit2/UIProcess/API/wpe/APIViewClient.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPIwpeWPEViewClientcpp">trunk/Source/WebKit2/UIProcess/API/wpe/WPEViewClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIwpeWPEViewClienth">trunk/Source/WebKit2/UIProcess/API/wpe/WPEViewClient.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (218690 => 218691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog   2017-06-22 11:53:33 UTC (rev 218690)
+++ trunk/Source/WebKit2/ChangeLog      2017-06-22 11:55:07 UTC (rev 218691)
</span><span class="lines">@@ -1,5 +1,32 @@
</span><span class="cx"> 2017-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
</span><span class="cx"> 
</span><ins>+        [WPE] Downloads never have a web view associated in WPE
+        https://bugs.webkit.org/show_bug.cgi?id=173709
+
+        Reviewed by Žan Doberšek.
+
+        Convert the WPE view client into an API client and add handleDownloadRequest(). WebKitWebView now uses it to
+        associate itself to the download like the GTK+ port does.
+
+        * PlatformWPE.cmake:
+        * UIProcess/API/C/wpe/WKView.cpp:
+        (WKViewSetViewClient): Add C API client implementation here.
+        * UIProcess/API/glib/WebKitWebView.cpp:
+        (webkitWebViewConstructed): Set the view client in WPE.
+        * UIProcess/API/wpe/APIViewClient.h: Renamed from Source/WebKit2/UIProcess/API/wpe/WPEViewClient.h.
+        (API::ViewClient::frameDisplayed):
+        (API::ViewClient::handleDownloadRequest):
+        * UIProcess/API/wpe/PageClientImpl.cpp:
+        (WebKit::PageClientImpl::handleDownloadRequest): Call WKWPE::View::handleDownloadRequest().
+        * UIProcess/API/wpe/WPEView.cpp:
+        (WKWPE::View::View): Initialize the view client.
+        (WKWPE::View::setClient): Set or reset the client.
+        (WKWPE::View::handleDownloadRequest): Notify the client.
+        * UIProcess/API/wpe/WPEView.h:
+        * UIProcess/API/wpe/WPEViewClient.cpp: Removed.
+
+2017-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
+
</ins><span class="cx">         [WPE] Page should be closed on WebKitWebView dispose
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=173707
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformWPEcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformWPE.cmake (218690 => 218691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformWPE.cmake   2017-06-22 11:53:33 UTC (rev 218690)
+++ trunk/Source/WebKit2/PlatformWPE.cmake      2017-06-22 11:55:07 UTC (rev 218691)
</span><span class="lines">@@ -193,7 +193,6 @@
</span><span class="cx">     UIProcess/API/wpe/ScrollGestureController.cpp
</span><span class="cx">     UIProcess/API/wpe/WebKitWebViewWPE.cpp
</span><span class="cx">     UIProcess/API/wpe/WPEView.cpp
</span><del>-    UIProcess/API/wpe/WPEViewClient.cpp
</del><span class="cx"> 
</span><span class="cx">     UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICwpeWKViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/wpe/WKView.cpp (218690 => 218691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/wpe/WKView.cpp      2017-06-22 11:53:33 UTC (rev 218690)
+++ trunk/Source/WebKit2/UIProcess/API/C/wpe/WKView.cpp 2017-06-22 11:55:07 UTC (rev 218691)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "WKView.h"
</span><span class="cx"> 
</span><span class="cx"> #include "APIPageConfiguration.h"
</span><ins>+#include "APIViewClient.h"
</ins><span class="cx"> #include "PageClientImpl.h"
</span><span class="cx"> #include "WKAPICast.h"
</span><span class="cx"> #include "WPEView.h"
</span><span class="lines">@@ -33,6 +34,12 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace WebKit;
</span><span class="cx"> 
</span><ins>+namespace API {
+template<> struct ClientTraits<WKViewClientBase> {
+    typedef std::tuple<WKViewClientV0> Versions;
+};
+}
+
</ins><span class="cx"> WKViewRef WKViewCreate(WKPageConfigurationRef configuration)
</span><span class="cx"> {
</span><span class="cx">     return toAPI(WKWPE::View::create(nullptr, *toImpl(configuration)));
</span><span class="lines">@@ -55,5 +62,21 @@
</span><span class="cx"> 
</span><span class="cx"> void WKViewSetViewClient(WKViewRef view, const WKViewClientBase* client)
</span><span class="cx"> {
</span><del>-    toImpl(view)->initializeClient(client);
</del><ins>+    class ViewClient final : public API::Client<WKViewClientBase>, public API::ViewClient {
+    public:
+        explicit ViewClient(const WKViewClientBase* client)
+        {
+            initialize(client);
+        }
+
+    private:
+        void frameDisplayed(WKWPE::View& view) override
+        {
+            if (!m_client.frameDisplayed)
+                return;
+            m_client.frameDisplayed(toAPI(&view), m_client.base.clientInfo);
+        }
+    };
+
+    toImpl(view)->setClient(std::make_unique<ViewClient>(client));
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIglibWebKitWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/glib/WebKitWebView.cpp (218690 => 218691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/glib/WebKitWebView.cpp        2017-06-22 11:53:33 UTC (rev 218690)
+++ trunk/Source/WebKit2/UIProcess/API/glib/WebKitWebView.cpp   2017-06-22 11:55:07 UTC (rev 218691)
</span><span class="lines">@@ -77,6 +77,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WPE)
</span><ins>+#include "APIViewClient.h"
</ins><span class="cx"> #include "WPEView.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -335,6 +336,24 @@
</span><span class="cx">     WebKitWebView* m_webView;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+#if PLATFORM(WPE)
+class WebViewClient final : public API::ViewClient {
+public:
+    explicit WebViewClient(WebKitWebView* webView)
+        : m_webView(webView)
+    {
+    }
+
+private:
+    void handleDownloadRequest(WKWPE::View&, DownloadProxy& downloadProxy) override
+    {
+        webkitWebViewHandleDownloadRequest(m_webView, &downloadProxy);
+    }
+
+    WebKitWebView* m_webView;
+};
+#endif
+
</ins><span class="cx"> static gboolean webkitWebViewLoadFail(WebKitWebView* webView, WebKitLoadEvent, const char* failingURI, GError* error)
</span><span class="cx"> {
</span><span class="cx">     if (g_error_matches(error, WEBKIT_NETWORK_ERROR, WEBKIT_NETWORK_ERROR_CANCELLED)
</span><span class="lines">@@ -615,6 +634,10 @@
</span><span class="cx">     attachContextMenuClientToView(webView);
</span><span class="cx">     attachFormClientToView(webView);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(WPE)
+    priv->view->setClient(std::make_unique<WebViewClient>(webView));
+#endif
+
</ins><span class="cx">     // This needs to be after attachUIClientToView() because WebPageProxy::setUIClient() calls setCanRunModal() with true.
</span><span class="cx">     // See https://bugs.webkit.org/show_bug.cgi?id=135412.
</span><span class="cx">     webkitWebViewUpdateSettings(webView);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIwpeAPIViewClienthfromrev218690trunkSourceWebKit2UIProcessAPIwpeWPEViewClienth"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/API/wpe/APIViewClient.h (from rev 218690, trunk/Source/WebKit2/UIProcess/API/wpe/WPEViewClient.h) (0 => 218691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/wpe/APIViewClient.h                           (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/APIViewClient.h      2017-06-22 11:55:07 UTC (rev 218691)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+ * Copyright (C) 2017 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
+
+namespace WebKit {
+class DownloadProxy;
+}
+
+namespace WKWPE {
+class View;
+}
+
+namespace API {
+
+class ViewClient {
+public:
+    virtual ~ViewClient() = default;
+
+    virtual void frameDisplayed(WKWPE::View&) { }
+    virtual void handleDownloadRequest(WKWPE::View&, WebKit::DownloadProxy&) { }
+};
+
+} // namespace API
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIwpePageClientImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/wpe/PageClientImpl.cpp (218690 => 218691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/wpe/PageClientImpl.cpp        2017-06-22 11:53:33 UTC (rev 218690)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/PageClientImpl.cpp   2017-06-22 11:55:07 UTC (rev 218691)
</span><span class="lines">@@ -112,8 +112,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageClientImpl::handleDownloadRequest(DownloadProxy*)
</del><ins>+void PageClientImpl::handleDownloadRequest(DownloadProxy* download)
</ins><span class="cx"> {
</span><ins>+    ASSERT(download);
+    m_view.handleDownloadRequest(*download);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::didChangeContentSize(const WebCore::IntSize&)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIwpeWPEViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/wpe/WPEView.cpp (218690 => 218691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/wpe/WPEView.cpp       2017-06-22 11:53:33 UTC (rev 218690)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/WPEView.cpp  2017-06-22 11:55:07 UTC (rev 218691)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "WPEView.h"
</span><span class="cx"> 
</span><span class="cx"> #include "APIPageConfiguration.h"
</span><ins>+#include "APIViewClient.h"
</ins><span class="cx"> #include "DrawingAreaProxy.h"
</span><span class="cx"> #include "NativeWebKeyboardEvent.h"
</span><span class="cx"> #include "NativeWebMouseEvent.h"
</span><span class="lines">@@ -41,7 +42,8 @@
</span><span class="cx"> namespace WKWPE {
</span><span class="cx"> 
</span><span class="cx"> View::View(struct wpe_view_backend* backend, const API::PageConfiguration& baseConfiguration)
</span><del>-    : m_pageClient(std::make_unique<PageClientImpl>(*this))
</del><ins>+    : m_client(std::make_unique<API::ViewClient>())
+    , m_pageClient(std::make_unique<PageClientImpl>(*this))
</ins><span class="cx">     , m_size { 800, 600 }
</span><span class="cx">     , m_viewStateFlags(WebCore::ActivityState::WindowIsActive | WebCore::ActivityState::IsFocused | WebCore::ActivityState::IsVisible | WebCore::ActivityState::IsInWindow)
</span><span class="cx">     , m_compositingManagerProxy(*this)
</span><span class="lines">@@ -130,16 +132,24 @@
</span><span class="cx">     wpe_view_backend_destroy(m_backend);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void View::initializeClient(const WKViewClientBase* client)
</del><ins>+void View::setClient(std::unique_ptr<API::ViewClient>&& client)
</ins><span class="cx"> {
</span><del>-    m_client.initialize(client);
</del><ins>+    if (!client)
+        m_client = std::make_unique<API::ViewClient>();
+    else
+        m_client = WTFMove(client);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void View::frameDisplayed()
</span><span class="cx"> {
</span><del>-    m_client.frameDisplayed(*this);
</del><ins>+    m_client->frameDisplayed(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void View::handleDownloadRequest(DownloadProxy& download)
+{
+    m_client->handleDownloadRequest(*this, download);
+}
+
</ins><span class="cx"> void View::setSize(const WebCore::IntSize& size)
</span><span class="cx"> {
</span><span class="cx">     m_size = size;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIwpeWPEViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/wpe/WPEView.h (218690 => 218691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/wpe/WPEView.h 2017-06-22 11:53:33 UTC (rev 218690)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/WPEView.h    2017-06-22 11:55:07 UTC (rev 218691)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> #include "APIObject.h"
</span><span class="cx"> #include "CompositingManagerProxy.h"
</span><span class="cx"> #include "PageClientImpl.h"
</span><del>-#include "WPEViewClient.h"
</del><span class="cx"> #include "WebPageProxy.h"
</span><span class="cx"> #include <WebCore/ActivityState.h>
</span><span class="cx"> #include <memory>
</span><span class="lines">@@ -36,7 +35,12 @@
</span><span class="cx"> 
</span><span class="cx"> struct wpe_view_backend;
</span><span class="cx"> 
</span><ins>+namespace API {
+class ViewClient;
+}
+
</ins><span class="cx"> namespace WebKit {
</span><ins>+class DownloadProxy;
</ins><span class="cx"> class WebPageGroup;
</span><span class="cx"> class WebProcessPool;
</span><span class="cx"> }
</span><span class="lines">@@ -52,8 +56,9 @@
</span><span class="cx">     virtual ~View();
</span><span class="cx"> 
</span><span class="cx">     // Client methods
</span><del>-    void initializeClient(const WKViewClientBase*);
</del><ins>+    void setClient(std::unique_ptr<API::ViewClient>&&);
</ins><span class="cx">     void frameDisplayed();
</span><ins>+    void handleDownloadRequest(WebKit::DownloadProxy&);
</ins><span class="cx"> 
</span><span class="cx">     WebKit::WebPageProxy& page() { return *m_pageProxy; }
</span><span class="cx"> 
</span><span class="lines">@@ -71,7 +76,7 @@
</span><span class="cx"> 
</span><span class="cx">     void setSize(const WebCore::IntSize&);
</span><span class="cx"> 
</span><del>-    ViewClient m_client;
</del><ins>+    std::unique_ptr<API::ViewClient> m_client;
</ins><span class="cx"> 
</span><span class="cx">     std::unique_ptr<WebKit::PageClientImpl> m_pageClient;
</span><span class="cx">     RefPtr<WebKit::WebPageProxy> m_pageProxy;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIwpeWPEViewClientcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/wpe/WPEViewClient.cpp (218690 => 218691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/wpe/WPEViewClient.cpp 2017-06-22 11:53:33 UTC (rev 218690)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/WPEViewClient.cpp    2017-06-22 11:55:07 UTC (rev 218691)
</span><span class="lines">@@ -1,43 +0,0 @@
</span><del>-/*
- * 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.
- */
-
-#include "config.h"
-#include "WPEViewClient.h"
-
-#include "WKAPICast.h"
-#include "WKBase.h"
-#include "WPEView.h"
-
-using namespace WebKit;
-
-namespace WKWPE {
-
-void ViewClient::frameDisplayed(View& view)
-{
-    if (m_client.frameDisplayed)
-        m_client.frameDisplayed(toAPI(&view), m_client.base.clientInfo);
-}
-
-} // namespace WKWPE
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIwpeWPEViewClienth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/wpe/WPEViewClient.h (218690 => 218691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/wpe/WPEViewClient.h   2017-06-22 11:53:33 UTC (rev 218690)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/WPEViewClient.h      2017-06-22 11:55:07 UTC (rev 218691)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-/*
- * 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 "APIClient.h"
-#include <WebKit/WKView.h>
-
-namespace API {
-template<> struct ClientTraits<WKViewClientBase> {
-    typedef std::tuple<WKViewClientV0> Versions;
-};
-}
-
-namespace WKWPE {
-
-class View;
-
-class ViewClient : public API::Client<WKViewClientBase> {
-public:
-    void frameDisplayed(View&);
-};
-
-} // namespace WebKit
</del></span></pre>
</div>
</div>

</body>
</html>