Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1571)

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 819673002: Reset the loading frame count (etc) when starting a new main frame navigation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 766426f8f7e8bed660f627d710f26ab9ee00c8fa..81394153a5b2057a2739a838ffa287907264deab 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2736,6 +2736,13 @@ void WebContentsImpl::OnDidStartLoading(bool to_different_document) {
static_cast<RenderFrameHostImpl*>(render_frame_message_source_);
int64 render_frame_id = rfh->frame_tree_node()->frame_tree_node_id();
+ // Any main frame load to a new document should reset the load progress, since
+ // it will replace the current page and any frames.
+ if (to_different_document && !rfh->GetParent()) {
+ ResetLoadProgressState();
+ loading_frames_in_progress_ = 0;
Charlie Reis 2014/12/19 19:47:48 Note: I didn't put this line inside ResetLoadProgr
Avi (use Gerrit) 2014/12/19 19:54:54 Acknowledged.
+ }
+
// It is possible to get multiple calls to OnDidStartLoading that don't have
// corresponding calls to OnDidStopLoading:
// - With "swappedout://" URLs, this happens when a RenderView gets swapped

Powered by Google App Engine
This is Rietveld 408576698