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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/crash_logging.h" 10 #include "base/debug/crash_logging.h"
(...skipping 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after
2729 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); 2729 static_cast<RenderFrameHostImpl*>(render_frame_message_source_);
2730 FOR_EACH_OBSERVER( 2730 FOR_EACH_OBSERVER(
2731 WebContentsObserver, observers_, DidFinishLoad(rfh, validated_url)); 2731 WebContentsObserver, observers_, DidFinishLoad(rfh, validated_url));
2732 } 2732 }
2733 2733
2734 void WebContentsImpl::OnDidStartLoading(bool to_different_document) { 2734 void WebContentsImpl::OnDidStartLoading(bool to_different_document) {
2735 RenderFrameHostImpl* rfh = 2735 RenderFrameHostImpl* rfh =
2736 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); 2736 static_cast<RenderFrameHostImpl*>(render_frame_message_source_);
2737 int64 render_frame_id = rfh->frame_tree_node()->frame_tree_node_id(); 2737 int64 render_frame_id = rfh->frame_tree_node()->frame_tree_node_id();
2738 2738
2739 // Any main frame load to a new document should reset the load progress, since
2740 // it will replace the current page and any frames.
2741 if (to_different_document && !rfh->GetParent()) {
2742 ResetLoadProgressState();
2743 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.
2744 }
2745
2739 // It is possible to get multiple calls to OnDidStartLoading that don't have 2746 // It is possible to get multiple calls to OnDidStartLoading that don't have
2740 // corresponding calls to OnDidStopLoading: 2747 // corresponding calls to OnDidStopLoading:
2741 // - With "swappedout://" URLs, this happens when a RenderView gets swapped 2748 // - With "swappedout://" URLs, this happens when a RenderView gets swapped
2742 // out for a cross-process navigation, and it turns into a placeholder for 2749 // out for a cross-process navigation, and it turns into a placeholder for
2743 // one being rendered in a different process. 2750 // one being rendered in a different process.
2744 // - Also, there might be more than one RenderFrameHost sharing the same 2751 // - Also, there might be more than one RenderFrameHost sharing the same
2745 // FrameTreeNode (and thus sharing its ID) each sending a start. 2752 // FrameTreeNode (and thus sharing its ID) each sending a start.
2746 // - But in the future, once clamy@ moves navigation network requests to the 2753 // - But in the future, once clamy@ moves navigation network requests to the
2747 // browser process, there's a good chance that callbacks about starting and 2754 // browser process, there's a good chance that callbacks about starting and
2748 // stopping will all be handled by the browser. When that happens, there 2755 // stopping will all be handled by the browser. When that happens, there
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
4387 node->render_manager()->ResumeResponseDeferredAtStart(); 4394 node->render_manager()->ResumeResponseDeferredAtStart();
4388 } 4395 }
4389 4396
4390 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4397 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4391 force_disable_overscroll_content_ = force_disable; 4398 force_disable_overscroll_content_ = force_disable;
4392 if (view_) 4399 if (view_)
4393 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4400 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4394 } 4401 }
4395 4402
4396 } // namespace content 4403 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698