<!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>[162069] trunk/Source/WebKit/gtk</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/162069">162069</a></dd>
<dt>Author</dt> <dd>zandobersek@gmail.com</dd>
<dt>Date</dt> <dd>2014-01-15 09:03:52 -0800 (Wed, 15 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[GTK][WK1] Add ProgressTrackerClient implementation
https://bugs.webkit.org/show_bug.cgi?id=127048
Reviewed by Anders Carlsson.
In <a href="http://trac.webkit.org/projects/webkit/changeset/162034">r162034</a>, the progress tracker client was separated from FrameLoaderClient into the
ProgressTrackerClient class. This patch adds the WebKit layer implementation of that
class for GTK-WK1 that's practically identical to the client implementation that was
in use under WebKit::FrameLoaderClient.
* GNUmakefile.am:
* WebCoreSupport/FrameLoaderClientGtk.cpp:
* WebCoreSupport/FrameLoaderClientGtk.h:
* WebCoreSupport/ProgressTrackerClientGtk.cpp: Added.
(WebKit::ProgressTrackerClient::ProgressTrackerClient):
(WebKit::ProgressTrackerClient::progressTrackerDestroyed):
(WebKit::ProgressTrackerClient::progressStarted):
(WebKit::ProgressTrackerClient::progressEstimateChanged):
(WebKit::ProgressTrackerClient::progressFinished):
* WebCoreSupport/ProgressTrackerClientGtk.h: Added.
* webkit/webkitwebview.cpp:
(webkit_web_view_init):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitgtkChangeLog">trunk/Source/WebKit/gtk/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitgtkGNUmakefileam">trunk/Source/WebKit/gtk/GNUmakefile.am</a></li>
<li><a href="#trunkSourceWebKitgtkWebCoreSupportFrameLoaderClientGtkcpp">trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp</a></li>
<li><a href="#trunkSourceWebKitgtkWebCoreSupportFrameLoaderClientGtkh">trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h</a></li>
<li><a href="#trunkSourceWebKitgtkwebkitwebkitwebviewcpp">trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitgtkWebCoreSupportProgressTrackerClientGtkcpp">trunk/Source/WebKit/gtk/WebCoreSupport/ProgressTrackerClientGtk.cpp</a></li>
<li><a href="#trunkSourceWebKitgtkWebCoreSupportProgressTrackerClientGtkh">trunk/Source/WebKit/gtk/WebCoreSupport/ProgressTrackerClientGtk.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitgtkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/ChangeLog (162068 => 162069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/ChangeLog        2014-01-15 17:01:07 UTC (rev 162068)
+++ trunk/Source/WebKit/gtk/ChangeLog        2014-01-15 17:03:52 UTC (rev 162069)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2014-01-15 Zan Dobersek <zdobersek@igalia.com>
+
+ [GTK][WK1] Add ProgressTrackerClient implementation
+ https://bugs.webkit.org/show_bug.cgi?id=127048
+
+ Reviewed by Anders Carlsson.
+
+ In r162034, the progress tracker client was separated from FrameLoaderClient into the
+ ProgressTrackerClient class. This patch adds the WebKit layer implementation of that
+ class for GTK-WK1 that's practically identical to the client implementation that was
+ in use under WebKit::FrameLoaderClient.
+
+ * GNUmakefile.am:
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ * WebCoreSupport/FrameLoaderClientGtk.h:
+ * WebCoreSupport/ProgressTrackerClientGtk.cpp: Added.
+ (WebKit::ProgressTrackerClient::ProgressTrackerClient):
+ (WebKit::ProgressTrackerClient::progressTrackerDestroyed):
+ (WebKit::ProgressTrackerClient::progressStarted):
+ (WebKit::ProgressTrackerClient::progressEstimateChanged):
+ (WebKit::ProgressTrackerClient::progressFinished):
+ * WebCoreSupport/ProgressTrackerClientGtk.h: Added.
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_init):
+
</ins><span class="cx"> 2014-01-13 Carlos Garcia Campos <cgarcia@igalia.com>
</span><span class="cx">
</span><span class="cx"> [SOUP] Add SoupNetworkSession class to wrap a SoupSession
</span></span></pre></div>
<a id="trunkSourceWebKitgtkGNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/GNUmakefile.am (162068 => 162069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/GNUmakefile.am        2014-01-15 17:01:07 UTC (rev 162068)
+++ trunk/Source/WebKit/gtk/GNUmakefile.am        2014-01-15 17:03:52 UTC (rev 162069)
</span><span class="lines">@@ -226,6 +226,8 @@
</span><span class="cx">         Source/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
</span><span class="cx">         Source/WebKit/gtk/WebCoreSupport/PlatformStrategiesGtk.h \
</span><span class="cx">         Source/WebKit/gtk/WebCoreSupport/PlatformStrategiesGtk.cpp \
</span><ins>+        Source/WebKit/gtk/WebCoreSupport/ProgressTrackerClientGtk.cpp \
+        Source/WebKit/gtk/WebCoreSupport/ProgressTrackerClientGtk.h \
</ins><span class="cx">         Source/WebKit/gtk/WebCoreSupport/UserMediaClientGtk.cpp \
</span><span class="cx">         Source/WebKit/gtk/WebCoreSupport/UserMediaClientGtk.h \
</span><span class="cx">         Source/WebKit/gtk/WebCoreSupport/WebViewInputMethodFilter.cpp \
</span></span></pre></div>
<a id="trunkSourceWebKitgtkWebCoreSupportFrameLoaderClientGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp (162068 => 162069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp        2014-01-15 17:01:07 UTC (rev 162068)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp        2014-01-15 17:03:52 UTC (rev 162069)
</span><span class="lines">@@ -58,7 +58,6 @@
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "PluginDatabase.h"
</span><span class="cx"> #include "PluginView.h"
</span><del>-#include "ProgressTracker.h"
</del><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "RenderWidget.h"
</span><span class="cx"> #include "ResourceHandle.h"
</span><span class="lines">@@ -284,35 +283,6 @@
</span><span class="cx"> webkit_web_view_add_resource(getViewFromFrame(m_frame), identifierString.get(), webResource);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void FrameLoaderClient::progressStarted(WebCore::Frame&)
-{
- WebKitWebView* webView = getViewFromFrame(m_frame);
- g_signal_emit_by_name(webView, "load-started", m_frame);
-
- g_object_notify(G_OBJECT(webView), "progress");
-}
-
-void FrameLoaderClient::progressEstimateChanged(WebCore::Frame&)
-{
- WebKitWebView* webView = getViewFromFrame(m_frame);
- Page* corePage = core(webView);
-
- g_signal_emit_by_name(webView, "load-progress-changed", lround(corePage->progress().estimatedProgress()*100));
-
- g_object_notify(G_OBJECT(webView), "progress");
-}
-
-void FrameLoaderClient::progressFinished(WebCore::Frame&)
-{
- WebKitWebView* webView = getViewFromFrame(m_frame);
- WebKitWebViewPrivate* privateData = webView->priv;
-
- // We can get a stopLoad() from dispose when the object is being
- // destroyed, don't emit the signal in that case.
- if (!privateData->disposing)
- g_signal_emit_by_name(webView, "load-finished", m_frame);
-}
-
</del><span class="cx"> void FrameLoaderClient::frameLoaderDestroyed()
</span><span class="cx"> {
</span><span class="cx"> webkit_web_frame_core_frame_gone(m_frame);
</span></span></pre></div>
<a id="trunkSourceWebKitgtkWebCoreSupportFrameLoaderClientGtkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h (162068 => 162069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h        2014-01-15 17:01:07 UTC (rev 162068)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h        2014-01-15 17:03:52 UTC (rev 162069)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #define FrameLoaderClientGtk_h
</span><span class="cx">
</span><span class="cx"> #include "FrameLoaderClient.h"
</span><del>-#include "ProgressTrackerClient.h"
</del><span class="cx"> #include "ResourceResponse.h"
</span><span class="cx"> #include "webkitwebpolicydecision.h"
</span><span class="cx">
</span><span class="lines">@@ -43,7 +42,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><del>- class FrameLoaderClient : public WebCore::FrameLoaderClient, public WebCore::ProgressTrackerClient {
</del><ins>+ class FrameLoaderClient : public WebCore::FrameLoaderClient {
</ins><span class="cx"> public:
</span><span class="cx"> FrameLoaderClient(WebKitWebFrame* = 0);
</span><span class="cx"> virtual ~FrameLoaderClient();
</span><span class="lines">@@ -112,10 +111,6 @@
</span><span class="cx"> virtual void revertToProvisionalState(WebCore::DocumentLoader*) { }
</span><span class="cx"> virtual void setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&);
</span><span class="cx">
</span><del>- virtual void progressStarted(WebCore::Frame&);
- virtual void progressEstimateChanged(WebCore::Frame&);
- virtual void progressFinished(WebCore::Frame&);
-
</del><span class="cx"> virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::URL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement,
</span><span class="cx"> const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
</span><span class="cx"> virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::URL&, const WTF::Vector<WTF::String>&, const WTF::Vector<WTF::String>&, const WTF::String&, bool);
</span></span></pre></div>
<a id="trunkSourceWebKitgtkWebCoreSupportProgressTrackerClientGtkcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/gtk/WebCoreSupport/ProgressTrackerClientGtk.cpp (0 => 162069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/WebCoreSupport/ProgressTrackerClientGtk.cpp         (rev 0)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/ProgressTrackerClientGtk.cpp        2014-01-15 17:03:52 UTC (rev 162069)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+/*
+ * Copyright (C) 2014 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "ProgressTrackerClientGtk.h"
+
+#include "Page.h"
+#include "ProgressTracker.h"
+#include "webkitwebframeprivate.h"
+#include "webkitwebviewprivate.h"
+
+namespace WebKit {
+
+ProgressTrackerClient::ProgressTrackerClient(WebKitWebView* webView)
+ : m_webView(webView)
+{
+ ASSERT(m_webView);
+}
+
+void ProgressTrackerClient::progressTrackerDestroyed()
+{
+ delete this;
+}
+
+void ProgressTrackerClient::progressStarted(WebCore::Frame& originatingProgressFrame)
+{
+ WebKitWebFrame* frame = kit(&originatingProgressFrame);
+ ASSERT(m_webView == getViewFromFrame(frame));
+
+ g_signal_emit_by_name(m_webView, "load-started", frame);
+
+ g_object_notify(G_OBJECT(m_webView), "progress");
+}
+
+void ProgressTrackerClient::progressEstimateChanged(WebCore::Frame& originatingProgressFrame)
+{
+ ASSERT(m_webView == getViewFromFrame(kit(&originatingProgressFrame)));
+
+ WebCore::Page* corePage = core(m_webView);
+ g_signal_emit_by_name(m_webView, "load-progress-changed", lround(corePage->progress().estimatedProgress()*100));
+
+ g_object_notify(G_OBJECT(m_webView), "progress");
+}
+
+void ProgressTrackerClient::progressFinished(WebCore::Frame& originatingProgressFrame)
+{
+ WebKitWebFrame* frame = kit(&originatingProgressFrame);
+ ASSERT(m_webView == getViewFromFrame(frame));
+
+ // We can get a stopLoad() from dispose when the object is being
+ // destroyed, don't emit the signal in that case.
+ if (!m_webView->priv->disposing)
+ g_signal_emit_by_name(m_webView, "load-finished", frame);
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKitgtkWebCoreSupportProgressTrackerClientGtkh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/gtk/WebCoreSupport/ProgressTrackerClientGtk.h (0 => 162069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/WebCoreSupport/ProgressTrackerClientGtk.h         (rev 0)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/ProgressTrackerClientGtk.h        2014-01-15 17:03:52 UTC (rev 162069)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2014 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef ProgressTrackerClientGtk_h
+#define ProgressTrackerClientGtk_h
+
+#include "ProgressTrackerClient.h"
+
+typedef struct _WebKitWebView WebKitWebView;
+
+namespace WebKit {
+
+class ProgressTrackerClient FINAL : public WebCore::ProgressTrackerClient {
+public:
+ explicit ProgressTrackerClient(WebKitWebView*);
+
+private:
+ virtual void progressTrackerDestroyed() OVERRIDE;
+
+ virtual void progressStarted(WebCore::Frame&) OVERRIDE;
+ virtual void progressEstimateChanged(WebCore::Frame&) OVERRIDE;
+ virtual void progressFinished(WebCore::Frame&) OVERRIDE;
+
+ WebKitWebView* m_webView;
+};
+
+} // namespace WebKit
+
+#endif // ProgressTrackerClientGtk_h
</ins></span></pre></div>
<a id="trunkSourceWebKitgtkwebkitwebkitwebviewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp (162068 => 162069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp        2014-01-15 17:01:07 UTC (rev 162068)
+++ trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp        2014-01-15 17:03:52 UTC (rev 162069)
</span><span class="lines">@@ -82,6 +82,7 @@
</span><span class="cx"> #include "PlatformKeyboardEvent.h"
</span><span class="cx"> #include "PlatformWheelEvent.h"
</span><span class="cx"> #include "ProgressTracker.h"
</span><ins>+#include "ProgressTrackerClientGtk.h"
</ins><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "ResourceHandle.h"
</span><span class="cx"> #include "RuntimeEnabledFeatures.h"
</span><span class="lines">@@ -3810,7 +3811,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> pageClients.inspectorClient = new WebKit::InspectorClient(webView);
</span><span class="cx"> pageClients.loaderClientForMainFrame = new WebKit::FrameLoaderClient;
</span><del>- pageClients.progressTrackerClient = static_cast<WebKit::FrameLoaderClient*>(pageClients.loaderClientForMainFrame);
</del><ins>+ pageClients.progressTrackerClient = new WebKit::ProgressTrackerClient(webView);
</ins><span class="cx">
</span><span class="cx"> priv->corePage = new Page(pageClients);
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>