<!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>[174566] releases/WebKitGTK/webkit-2.6/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/174566">174566</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-10-10 01:22:39 -0700 (Fri, 10 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/174499">r174499</a> - [GTK] Use the PageLoadState observer also to monitor title and estimated load progress
https://bugs.webkit.org/show_bug.cgi?id=136997

Reviewed by Gustavo Noronha Silva.

* UIProcess/API/gtk/WebKitLoaderClient.cpp:
(attachLoaderClientToView): Remove implementation of
didReceiveTitleForFrame, didStartProgress, didChangeProgress and
didFinishProgress.
(didReceiveTitleForFrame): Deleted.
(didChangeProgress): Deleted.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_get_estimated_load_progress): Return the value
directly from the PageLoadState object, since we don't need to
cache the value anymore.
(webkitWebViewSetTitle): Deleted.
(webkitWebViewSetEstimatedLoadProgress): Deleted.
* UIProcess/API/gtk/WebKitWebViewPrivate.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit26SourceWebKit2ChangeLog">releases/WebKitGTK/webkit-2.6/Source/WebKit2/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebKit2UIProcessAPIgtkWebKitLoaderClientcpp">releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebKit2UIProcessAPIgtkWebKitWebViewcpp">releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebKit2UIProcessAPIgtkWebKitWebViewPrivateh">releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit26SourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebKit2/ChangeLog (174565 => 174566)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebKit2/ChangeLog        2014-10-10 08:03:29 UTC (rev 174565)
+++ releases/WebKitGTK/webkit-2.6/Source/WebKit2/ChangeLog        2014-10-10 08:22:39 UTC (rev 174566)
</span><span class="lines">@@ -1,5 +1,26 @@
</span><span class="cx"> 2014-10-08  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><ins>+        [GTK] Use the PageLoadState observer also to monitor title and estimated load progress
+        https://bugs.webkit.org/show_bug.cgi?id=136997
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * UIProcess/API/gtk/WebKitLoaderClient.cpp:
+        (attachLoaderClientToView): Remove implementation of
+        didReceiveTitleForFrame, didStartProgress, didChangeProgress and
+        didFinishProgress.
+        (didReceiveTitleForFrame): Deleted.
+        (didChangeProgress): Deleted.
+        * UIProcess/API/gtk/WebKitWebView.cpp:
+        (webkit_web_view_get_estimated_load_progress): Return the value
+        directly from the PageLoadState object, since we don't need to
+        cache the value anymore.
+        (webkitWebViewSetTitle): Deleted.
+        (webkitWebViewSetEstimatedLoadProgress): Deleted.
+        * UIProcess/API/gtk/WebKitWebViewPrivate.h:
+
+2014-10-08  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
</ins><span class="cx">         Race condition with WebKitWebView:is-loading after starting page load
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=136692
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebKit2UIProcessAPIgtkWebKitLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp (174565 => 174566)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp        2014-10-10 08:03:29 UTC (rev 174565)
+++ releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp        2014-10-10 08:22:39 UTC (rev 174566)
</span><span class="lines">@@ -91,14 +91,6 @@
</span><span class="cx">                             resourceError.failingURL().utf8().data(), webError.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void didReceiveTitleForFrame(WKPageRef, WKStringRef titleRef, WKFrameRef frameRef, WKTypeRef, const void* clientInfo)
-{
-    if (!WKFrameIsMainFrame(frameRef))
-        return;
-
-    webkitWebViewSetTitle(WEBKIT_WEB_VIEW(clientInfo), toImpl(titleRef)-&gt;string().utf8());
-}
-
</del><span class="cx"> static void didDisplayInsecureContentForFrame(WKPageRef, WKFrameRef, WKTypeRef /* userData */, const void *clientInfo)
</span><span class="cx"> {
</span><span class="cx">     webkitWebViewInsecureContentDetected(WEBKIT_WEB_VIEW(clientInfo), WEBKIT_INSECURE_CONTENT_DISPLAYED);
</span><span class="lines">@@ -109,11 +101,6 @@
</span><span class="cx">     webkitWebViewInsecureContentDetected(WEBKIT_WEB_VIEW(clientInfo), WEBKIT_INSECURE_CONTENT_RUN);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void didChangeProgress(WKPageRef page, const void* clientInfo)
-{
-    webkitWebViewSetEstimatedLoadProgress(WEBKIT_WEB_VIEW(clientInfo), WKPageGetEstimatedProgress(page));
-}
-
</del><span class="cx"> static void didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void* clientInfo)
</span><span class="cx"> {
</span><span class="cx">     webkitBackForwardListChanged(webkit_web_view_get_back_forward_list(WEBKIT_WEB_VIEW(clientInfo)), toImpl(addedItem), toImpl(removedItems));
</span><span class="lines">@@ -144,7 +131,7 @@
</span><span class="cx">         didFinishLoadForFrame,
</span><span class="cx">         didFailLoadWithErrorForFrame,
</span><span class="cx">         0, // didSameDocumentNavigationForFrame
</span><del>-        didReceiveTitleForFrame,
</del><ins>+        0, // didReceiveTitleForFrame,
</ins><span class="cx">         0, // didFirstLayoutForFrame
</span><span class="cx">         0, // didFirstVisuallyNonEmptyLayoutForFrame
</span><span class="cx">         0, // didRemoveFrameFromHierarchy
</span><span class="lines">@@ -152,9 +139,9 @@
</span><span class="cx">         didRunInsecureContentForFrame,
</span><span class="cx">         0, // canAuthenticateAgainstProtectionSpaceInFrame
</span><span class="cx">         didReceiveAuthenticationChallengeInFrame,
</span><del>-        didChangeProgress, // didStartProgress
-        didChangeProgress,
-        didChangeProgress, // didFinishProgress
</del><ins>+        0, // didStartProgress
+        0, // didChangeProgress,
+        0, // didFinishProgress
</ins><span class="cx">         0, // didBecomeUnresponsive
</span><span class="cx">         0, // didBecomeResponsive
</span><span class="cx">         processDidCrash,
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebKit2UIProcessAPIgtkWebKitWebViewcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (174565 => 174566)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp        2014-10-10 08:03:29 UTC (rev 174565)
+++ releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp        2014-10-10 08:22:39 UTC (rev 174566)
</span><span class="lines">@@ -160,7 +160,6 @@
</span><span class="cx">     WebKitWebView* relatedView;
</span><span class="cx">     CString title;
</span><span class="cx">     CString customTextEncoding;
</span><del>-    double estimatedLoadProgress;
</del><span class="cx">     CString activeURI;
</span><span class="cx">     bool isLoading;
</span><span class="cx"> 
</span><span class="lines">@@ -237,8 +236,16 @@
</span><span class="cx">         g_object_thaw_notify(G_OBJECT(m_webView));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual void willChangeTitle() override { }
-    virtual void didChangeTitle() override { }
</del><ins>+    virtual void willChangeTitle() override
+    {
+        g_object_freeze_notify(G_OBJECT(m_webView));
+    }
+    virtual void didChangeTitle() override
+    {
+        m_webView-&gt;priv-&gt;title = getPage(m_webView)-&gt;pageLoadState().title().utf8();
+        g_object_notify(G_OBJECT(m_webView), &quot;title&quot;);
+        g_object_thaw_notify(G_OBJECT(m_webView));
+    }
</ins><span class="cx"> 
</span><span class="cx">     virtual void willChangeActiveURL() override
</span><span class="cx">     {
</span><span class="lines">@@ -253,8 +260,17 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void willChangeHasOnlySecureContent() override { }
</span><span class="cx">     virtual void didChangeHasOnlySecureContent() override { }
</span><del>-    virtual void willChangeEstimatedProgress() override { }
-    virtual void didChangeEstimatedProgress() override { }
</del><ins>+
+    virtual void willChangeEstimatedProgress() override
+    {
+        g_object_freeze_notify(G_OBJECT(m_webView));
+    }
+    virtual void didChangeEstimatedProgress() override
+    {
+        g_object_notify(G_OBJECT(m_webView), &quot;estimated-load-progress&quot;);
+        g_object_thaw_notify(G_OBJECT(m_webView));
+    }
+
</ins><span class="cx">     virtual void willChangeCanGoBack() override { }
</span><span class="cx">     virtual void didChangeCanGoBack() override { }
</span><span class="cx">     virtual void willChangeCanGoForward() override { }
</span><span class="lines">@@ -1657,25 +1673,6 @@
</span><span class="cx">     g_signal_emit(webView, signals[LOAD_CHANGED], 0, WEBKIT_LOAD_FINISHED);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void webkitWebViewSetTitle(WebKitWebView* webView, const CString&amp; title)
-{
-    WebKitWebViewPrivate* priv = webView-&gt;priv;
-    if (priv-&gt;title == title)
-        return;
-
-    priv-&gt;title = title;
-    g_object_notify(G_OBJECT(webView), &quot;title&quot;);
-}
-
-void webkitWebViewSetEstimatedLoadProgress(WebKitWebView* webView, double estimatedLoadProgress)
-{
-    if (webView-&gt;priv-&gt;estimatedLoadProgress == estimatedLoadProgress)
-        return;
-
-    webView-&gt;priv-&gt;estimatedLoadProgress = estimatedLoadProgress;
-    g_object_notify(G_OBJECT(webView), &quot;estimated-load-progress&quot;);
-}
-
</del><span class="cx"> WebPageProxy* webkitWebViewCreateNewPage(WebKitWebView* webView, const WindowFeatures&amp; windowFeatures, WebKitNavigationAction* navigationAction)
</span><span class="cx"> {
</span><span class="cx">     WebKitWebView* newWebView;
</span><span class="lines">@@ -2520,7 +2517,7 @@
</span><span class="cx"> gdouble webkit_web_view_get_estimated_load_progress(WebKitWebView* webView)
</span><span class="cx"> {
</span><span class="cx">     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
</span><del>-    return webView-&gt;priv-&gt;estimatedLoadProgress;
</del><ins>+    return getPage(webView)-&gt;pageLoadState().estimatedProgress();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebKit2UIProcessAPIgtkWebKitWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h (174565 => 174566)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h        2014-10-10 08:03:29 UTC (rev 174565)
+++ releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h        2014-10-10 08:22:39 UTC (rev 174566)
</span><span class="lines">@@ -35,8 +35,6 @@
</span><span class="cx"> void webkitWebViewLoadChanged(WebKitWebView*, WebKitLoadEvent);
</span><span class="cx"> void webkitWebViewLoadFailed(WebKitWebView*, WebKitLoadEvent, const char* failingURI, GError*);
</span><span class="cx"> void webkitWebViewLoadFailedWithTLSErrors(WebKitWebView*, const char* failingURI, GError*, GTlsCertificateFlags, GTlsCertificate*);
</span><del>-void webkitWebViewSetEstimatedLoadProgress(WebKitWebView*, double estimatedLoadProgress);
-void webkitWebViewSetTitle(WebKitWebView*, const CString&amp;);
</del><span class="cx"> WebKit::WebPageProxy* webkitWebViewCreateNewPage(WebKitWebView*, const WebCore::WindowFeatures&amp;, WebKitNavigationAction*);
</span><span class="cx"> void webkitWebViewReadyToShowPage(WebKitWebView*);
</span><span class="cx"> void webkitWebViewRunAsModal(WebKitWebView*);
</span></span></pre>
</div>
</div>

</body>
</html>