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

Unified Diff: content/browser/frame_host/frame_tree_node.cc

Issue 1108283002: PlzNavigate: Call DidStartLoading and DidStopLoading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rephrase comment Created 5 years, 8 months 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
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_controller_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/frame_tree_node.cc
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc
index cabc819f4322201f2a42b9a5881e457628fcf2f2..cf7d6181d7d117059874b38628cffb5114098bcb 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -166,10 +166,15 @@ bool FrameTreeNode::IsLoading() const {
render_manager_.pending_frame_host();
DCHECK(current_frame_host);
- // TODO(fdegans): Change the implementation logic for PlzNavigate once
- // DidStartLoading and DidStopLoading are properly called.
- if (pending_frame_host && pending_frame_host->is_loading())
- return true;
+
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation)) {
+ if (navigation_request_)
+ return true;
+ } else {
+ if (pending_frame_host && pending_frame_host->is_loading())
+ return true;
+ }
return current_frame_host->is_loading();
}
@@ -185,7 +190,17 @@ void FrameTreeNode::SetNavigationRequest(
CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableBrowserSideNavigation));
ResetNavigationRequest(false);
- // TODO(clamy): perform the StartLoading logic here.
+
+ // Force the throbber to start to keep it in sync with what is happening in
+ // the UI. Blink doesn't send throb notifications for JavaScript URLs, so it
+ // is not done here either.
+ if (!navigation_request->common_params().url.SchemeIs(
+ url::kJavaScriptScheme)) {
+ // TODO(fdegans): Check if this is a same-document navigation and set the
+ // proper argument.
+ DidStartLoading(true);
+ }
+
navigation_request_ = navigation_request.Pass();
}
@@ -193,14 +208,16 @@ void FrameTreeNode::ResetNavigationRequest(bool is_commit) {
CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableBrowserSideNavigation));
// Upon commit the current NavigationRequest will be reset. There should be no
- // cleanup performed since the navigation is still ongoing. If the reset
+ // cleanup performed since the load is still being tracked. If the reset
clamy 2015/04/29 10:01:20 Note that the reason render_manager_.CleanUpNaviga
Fabrice (no longer in Chrome) 2015/04/29 14:32:24 I changed the order a bit and provided clarificati
nasko 2015/04/29 16:27:39 Thanks! That looks much better!
Charlie Reis 2015/04/29 16:52:54 Agreed, thanks.
// corresponds to a cancelation, the RenderFrameHostManager should clean up
// any speculative RenderFrameHost it created for the navigation.
- if (navigation_request_ && !is_commit) {
- // TODO(clamy): perform the StopLoading logic.
+ if (navigation_request_) {
+ navigation_request_.reset();
+ if (is_commit)
+ return;
+ DidStopLoading();
render_manager_.CleanUpNavigation();
}
- navigation_request_.reset();
}
bool FrameTreeNode::has_started_loading() const {
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_controller_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698