<!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>[170776] 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/170776">170776</a></dd>
<dt>Author</dt> <dd>mitz@apple.com</dd>
<dt>Date</dt> <dd>2014-07-03 16:31:15 -0700 (Thu, 03 Jul 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre><rdar://problem/16337741> The UI process needs to track the number of HTTP subresource loads in progress (or at least whether there are any)
https://bugs.webkit.org/show_bug.cgi?id=134615
Reviewed by Anders Carlsson.
Added a _networkRequestsInProgress boolean property to WKWebView.
* UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
PageLoadStateObserver member functions.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _networkRequestsInProgress]): New getter that gets this state from the
PageLoadState.
* UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property.
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::willChangeNetworkRequestsInProgress):: Override this new
PageLoadState::Observer member function by sending the appropriate KVO change message to the
WKWebView.
(WebKit::NavigationState::didChangeNetworkRequestsInProgress): Ditto.
* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::commitChanges): Check for changes to networkRequestsInProgress
and call the observers if needed.
(WebKit::PageLoadState::reset): Reset networkRequestsInProgress in the uncommitted state.
(WebKit::PageLoadState::setNetworkRequestsInProgress): Set networkRequestsInProgress in the
uncommitted state.
* UIProcess/PageLoadState.h:
(WebKit::PageLoadState::networkRequestsInProgress): Added this getter.
(WebKit::PageLoadState::Data::Data): Initialize new networkRequestsInProgress member.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setNetworkRequestsInProgress): Added. Updates the PageLoadState.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in: Added SetNetworkRequestsInProgress message.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Call
WebPage::addResourceRequest.
(WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): Call
WebPage::removeResourceRequest.
(WebKit::WebFrameLoaderClient::dispatchDidFailLoading): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::addResourceRequest): Added. If the new request is for an HTTP-family URL,
add its identifier to the set of network resourece request identifiers. If the set was
previously empty, send the WebPageProxy a message.
(WebKit::WebPage::removeResourceRequest): Added. Remove the identifier from the set. If it
becomes empty, send the WebPageProxy a message.
* WebProcess/WebPage/WebPage.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKBrowsingContextControllermm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaNavigationStateh">trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaNavigationStatemm">trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageLoadStatecpp">trunk/Source/WebKit2/UIProcess/PageLoadState.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageLoadStateh">trunk/Source/WebKit2/UIProcess/PageLoadState.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/ChangeLog        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2014-07-03 Dan Bernstein <mitz@apple.com>
+
+ <rdar://problem/16337741> The UI process needs to track the number of HTTP subresource loads in progress (or at least whether there are any)
+ https://bugs.webkit.org/show_bug.cgi?id=134615
+
+ Reviewed by Anders Carlsson.
+
+ Added a _networkRequestsInProgress boolean property to WKWebView.
+
+ * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
+ PageLoadStateObserver member functions.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _networkRequestsInProgress]): New getter that gets this state from the
+ PageLoadState.
+ * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property.
+
+ * UIProcess/Cocoa/NavigationState.h:
+ * UIProcess/Cocoa/NavigationState.mm:
+ (WebKit::NavigationState::willChangeNetworkRequestsInProgress):: Override this new
+ PageLoadState::Observer member function by sending the appropriate KVO change message to the
+ WKWebView.
+ (WebKit::NavigationState::didChangeNetworkRequestsInProgress): Ditto.
+
+ * UIProcess/PageLoadState.cpp:
+ (WebKit::PageLoadState::commitChanges): Check for changes to networkRequestsInProgress
+ and call the observers if needed.
+ (WebKit::PageLoadState::reset): Reset networkRequestsInProgress in the uncommitted state.
+ (WebKit::PageLoadState::setNetworkRequestsInProgress): Set networkRequestsInProgress in the
+ uncommitted state.
+ * UIProcess/PageLoadState.h:
+ (WebKit::PageLoadState::networkRequestsInProgress): Added this getter.
+ (WebKit::PageLoadState::Data::Data): Initialize new networkRequestsInProgress member.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::setNetworkRequestsInProgress): Added. Updates the PageLoadState.
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in: Added SetNetworkRequestsInProgress message.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Call
+ WebPage::addResourceRequest.
+ (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): Call
+ WebPage::removeResourceRequest.
+ (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): Ditto.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::addResourceRequest): Added. If the new request is for an HTTP-family URL,
+ add its identifier to the set of network resourece request identifiers. If the set was
+ previously empty, send the WebPageProxy a message.
+ (WebKit::WebPage::removeResourceRequest): Added. Remove the identifier from the set. If it
+ becomes empty, send the WebPageProxy a message.
+ * WebProcess/WebPage/WebPage.h:
+
</ins><span class="cx"> 2014-07-03 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove two unused functions
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKBrowsingContextControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -124,6 +124,8 @@
</span><span class="cx"> virtual void didChangeCanGoBack() override { }
</span><span class="cx"> virtual void willChangeCanGoForward() override { }
</span><span class="cx"> virtual void didChangeCanGoForward() override { }
</span><ins>+ virtual void willChangeNetworkRequestsInProgress() override { }
+ virtual void didChangeNetworkRequestsInProgress() override { }
</ins><span class="cx">
</span><span class="cx"> WKBrowsingContextController *m_controller;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -1651,6 +1651,11 @@
</span><span class="cx"> _page->setAddsVisitedLinks(addsVisitedLinks);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (BOOL)_networkRequestsInProgress
+{
+ return _page->pageLoadState().networkRequestsInProgress();
+}
+
</ins><span class="cx"> static inline WebCore::LayoutMilestones layoutMilestones(_WKRenderingProgressEvents events)
</span><span class="cx"> {
</span><span class="cx"> WebCore::LayoutMilestones milestones = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -96,6 +96,8 @@
</span><span class="cx">
</span><span class="cx"> @property (nonatomic, setter=_setAddsVisitedLinks:) BOOL _addsVisitedLinks;
</span><span class="cx">
</span><ins>+@property (nonatomic, readonly) BOOL _networkRequestsInProgress;
+
</ins><span class="cx"> - (void)_close;
</span><span class="cx">
</span><span class="cx"> #if TARGET_OS_IPHONE
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaNavigationStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -131,6 +131,8 @@
</span><span class="cx"> virtual void didChangeCanGoBack() override;
</span><span class="cx"> virtual void willChangeCanGoForward() override;
</span><span class="cx"> virtual void didChangeCanGoForward() override;
</span><ins>+ virtual void willChangeNetworkRequestsInProgress() override;
+ virtual void didChangeNetworkRequestsInProgress() override;
</ins><span class="cx">
</span><span class="cx"> WKWebView *m_webView;
</span><span class="cx"> WeakObjCPtr<id <WKNavigationDelegate> > m_navigationDelegate;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaNavigationStatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -797,6 +797,16 @@
</span><span class="cx"> [m_webView didChangeValueForKey:@"canGoForward"];
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void NavigationState::willChangeNetworkRequestsInProgress()
+{
+ [m_webView willChangeValueForKey:@"_networkRequestsInProgress"];
+}
+
+void NavigationState::didChangeNetworkRequestsInProgress()
+{
+ [m_webView didChangeValueForKey:@"_networkRequestsInProgress"];
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageLoadStatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageLoadState.cpp (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageLoadState.cpp        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/UIProcess/PageLoadState.cpp        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -102,6 +102,7 @@
</span><span class="cx"> bool activeURLChanged = activeURL(m_committedState) != activeURL(m_uncommittedState);
</span><span class="cx"> bool hasOnlySecureContentChanged = hasOnlySecureContent(m_committedState) != hasOnlySecureContent(m_uncommittedState);
</span><span class="cx"> bool estimatedProgressChanged = estimatedProgress(m_committedState) != estimatedProgress(m_uncommittedState);
</span><ins>+ bool networkRequestsInProgressChanged = m_committedState.networkRequestsInProgress != m_uncommittedState.networkRequestsInProgress;
</ins><span class="cx">
</span><span class="cx"> if (canGoBackChanged)
</span><span class="cx"> callObserverCallback(&Observer::willChangeCanGoBack);
</span><span class="lines">@@ -117,10 +118,14 @@
</span><span class="cx"> callObserverCallback(&Observer::willChangeHasOnlySecureContent);
</span><span class="cx"> if (estimatedProgressChanged)
</span><span class="cx"> callObserverCallback(&Observer::willChangeEstimatedProgress);
</span><ins>+ if (networkRequestsInProgressChanged)
+ callObserverCallback(&Observer::willChangeNetworkRequestsInProgress);
</ins><span class="cx">
</span><span class="cx"> m_committedState = m_uncommittedState;
</span><span class="cx">
</span><span class="cx"> // The "did" ordering is the reverse of the "will". This is a requirement of Cocoa Key-Value Observing.
</span><ins>+ if (networkRequestsInProgressChanged)
+ callObserverCallback(&Observer::didChangeNetworkRequestsInProgress);
</ins><span class="cx"> if (estimatedProgressChanged)
</span><span class="cx"> callObserverCallback(&Observer::didChangeEstimatedProgress);
</span><span class="cx"> if (hasOnlySecureContentChanged)
</span><span class="lines">@@ -154,6 +159,7 @@
</span><span class="cx"> m_uncommittedState.title = String();
</span><span class="cx">
</span><span class="cx"> m_uncommittedState.estimatedProgress = 0;
</span><ins>+ m_uncommittedState.networkRequestsInProgress = false;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool PageLoadState::isLoading() const
</span><span class="lines">@@ -368,6 +374,12 @@
</span><span class="cx"> m_uncommittedState.estimatedProgress = 1;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void PageLoadState::setNetworkRequestsInProgress(const Transaction::Token& token, bool networkRequestsInProgress)
+{
+ ASSERT_UNUSED(token, &token.m_pageLoadState == this);
+ m_uncommittedState.networkRequestsInProgress = networkRequestsInProgress;
+}
+
</ins><span class="cx"> bool PageLoadState::isLoading(const Data& data)
</span><span class="cx"> {
</span><span class="cx"> if (!data.pendingAPIRequestURL.isNull())
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageLoadStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageLoadState.h (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageLoadState.h        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/UIProcess/PageLoadState.h        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -67,6 +67,9 @@
</span><span class="cx">
</span><span class="cx"> virtual void willChangeCanGoForward() = 0;
</span><span class="cx"> virtual void didChangeCanGoForward() = 0;
</span><ins>+
+ virtual void willChangeNetworkRequestsInProgress() = 0;
+ virtual void didChangeNetworkRequestsInProgress() = 0;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class Transaction {
</span><span class="lines">@@ -118,6 +121,7 @@
</span><span class="cx"> bool hasOnlySecureContent() const;
</span><span class="cx">
</span><span class="cx"> double estimatedProgress() const;
</span><ins>+ bool networkRequestsInProgress() const { return m_committedState.networkRequestsInProgress; }
</ins><span class="cx">
</span><span class="cx"> const String& pendingAPIRequestURL() const;
</span><span class="cx"> void setPendingAPIRequestURL(const Transaction::Token&, const String&);
</span><span class="lines">@@ -149,6 +153,7 @@
</span><span class="cx"> void didStartProgress(const Transaction::Token&);
</span><span class="cx"> void didChangeProgress(const Transaction::Token&, double);
</span><span class="cx"> void didFinishProgress(const Transaction::Token&);
</span><ins>+ void setNetworkRequestsInProgress(const Transaction::Token&, bool);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> void beginTransaction() { ++m_outstandingTransactionCount; }
</span><span class="lines">@@ -165,6 +170,7 @@
</span><span class="cx"> , canGoBack(false)
</span><span class="cx"> , canGoForward(false)
</span><span class="cx"> , estimatedProgress(0)
</span><ins>+ , networkRequestsInProgress(false)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -184,6 +190,7 @@
</span><span class="cx"> bool canGoForward;
</span><span class="cx">
</span><span class="cx"> double estimatedProgress;
</span><ins>+ bool networkRequestsInProgress;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> static bool isLoading(const Data&);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -2442,6 +2442,12 @@
</span><span class="cx"> m_loaderClient->didFinishProgress(this);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebPageProxy::setNetworkRequestsInProgress(bool networkRequestsInProgress)
+{
+ auto transaction = m_pageLoadState.transaction();
+ m_pageLoadState.setNetworkRequestsInProgress(transaction, networkRequestsInProgress);
+}
+
</ins><span class="cx"> void WebPageProxy::didDestroyNavigation(uint64_t navigationID)
</span><span class="cx"> {
</span><span class="cx"> m_loaderClient->didDestroyNavigation(this, navigationID);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -956,6 +956,8 @@
</span><span class="cx"> void didStartProgress();
</span><span class="cx"> void didChangeProgress(double);
</span><span class="cx"> void didFinishProgress();
</span><ins>+ void setNetworkRequestsInProgress(bool);
+
</ins><span class="cx"> void didDestroyNavigation(uint64_t navigationID);
</span><span class="cx">
</span><span class="cx"> void decidePolicyForNavigationAction(uint64_t frameID, uint64_t navigationID, const NavigationActionData&, uint64_t originatingFrameID, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest&, uint64_t listenerID, IPC::MessageDecoder&, bool& receivedPolicyAction, uint64_t& newNavigationID, uint64_t& policyAction, uint64_t& downloadID);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -119,6 +119,8 @@
</span><span class="cx"> DidFinishProgress()
</span><span class="cx"> DidStartProgress()
</span><span class="cx">
</span><ins>+ SetNetworkRequestsInProgress(bool networkRequestsInProgress)
+
</ins><span class="cx"> # Frame lifetime messages
</span><span class="cx"> DidCreateMainFrame(uint64_t frameID)
</span><span class="cx"> DidCreateSubframe(uint64_t frameID)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -169,6 +169,7 @@
</span><span class="cx"> pageIsProvisionallyLoading = frameLoader->provisionalDocumentLoader() == loader;
</span><span class="cx">
</span><span class="cx"> webPage->injectedBundleResourceLoadClient().didInitiateLoadForResource(webPage, m_frame, identifier, request, pageIsProvisionallyLoading);
</span><ins>+ webPage->addResourceRequest(identifier, request);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebFrameLoaderClient::dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
</span><span class="lines">@@ -249,6 +250,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> webPage->injectedBundleResourceLoadClient().didFinishLoadForResource(webPage, m_frame, identifier);
</span><ins>+ webPage->removeResourceRequest(identifier);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError& error)
</span><span class="lines">@@ -258,6 +260,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> webPage->injectedBundleResourceLoadClient().didFailLoadForResource(webPage, m_frame, identifier, error);
</span><ins>+ webPage->removeResourceRequest(identifier);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int /*length*/)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -3806,6 +3806,27 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+void WebPage::addResourceRequest(unsigned long identifier, const WebCore::ResourceRequest& request)
+{
+ if (!request.url().protocolIsInHTTPFamily())
+ return;
+
+ ASSERT(!m_networkResourceRequestIdentifiers.contains(identifier));
+ bool wasEmpty = m_networkResourceRequestIdentifiers.isEmpty();
+ m_networkResourceRequestIdentifiers.add(identifier);
+ if (wasEmpty)
+ send(Messages::WebPageProxy::SetNetworkRequestsInProgress(true));
+}
+
+void WebPage::removeResourceRequest(unsigned long identifier)
+{
+ if (!m_networkResourceRequestIdentifiers.remove(identifier))
+ return;
+
+ if (m_networkResourceRequestIdentifiers.isEmpty())
+ send(Messages::WebPageProxy::SetNetworkRequestsInProgress(false));
+}
+
</ins><span class="cx"> void WebPage::setMediaVolume(float volume)
</span><span class="cx"> {
</span><span class="cx"> m_page->setMediaVolume(volume);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (170775 => 170776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-07-03 22:31:26 UTC (rev 170775)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-07-03 23:31:15 UTC (rev 170776)
</span><span class="lines">@@ -690,6 +690,9 @@
</span><span class="cx"> void didFinishPrintOperation(const WebCore::ResourceError&, uint64_t callbackID);
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ void addResourceRequest(unsigned long, const WebCore::ResourceRequest&);
+ void removeResourceRequest(unsigned long);
+
</ins><span class="cx"> void setMediaVolume(float);
</span><span class="cx"> void setMayStartMediaWhenInWindow(bool);
</span><span class="cx">
</span><span class="lines">@@ -1200,6 +1203,8 @@
</span><span class="cx">
</span><span class="cx"> unsigned m_cachedPageCount;
</span><span class="cx">
</span><ins>+ HashSet<unsigned long> m_networkResourceRequestIdentifiers;
+
</ins><span class="cx"> WebCore::IntSize m_minimumLayoutSize;
</span><span class="cx"> bool m_autoSizingShouldExpandToViewHeight;
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>