Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/frame_tree_node.h" | 5 #include "content/browser/frame_host/frame_tree_node.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 effective_sandbox_flags_ != replication_state_.sandbox_flags; | 178 effective_sandbox_flags_ != replication_state_.sandbox_flags; |
| 179 effective_sandbox_flags_ = replication_state_.sandbox_flags; | 179 effective_sandbox_flags_ = replication_state_.sandbox_flags; |
| 180 return did_change_flags; | 180 return did_change_flags; |
| 181 } | 181 } |
| 182 | 182 |
| 183 void FrameTreeNode::SetNavigationRequest( | 183 void FrameTreeNode::SetNavigationRequest( |
| 184 scoped_ptr<NavigationRequest> navigation_request) { | 184 scoped_ptr<NavigationRequest> navigation_request) { |
| 185 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 185 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 186 switches::kEnableBrowserSideNavigation)); | 186 switches::kEnableBrowserSideNavigation)); |
| 187 ResetNavigationRequest(false); | 187 ResetNavigationRequest(false); |
| 188 // TODO(clamy): perform the StartLoading logic here. | 188 |
| 189 // Force the throbber to start to keep it in sync with what is happening in | |
| 190 // the UI. Blink doesn't send throb notifications for JavaScript URLs, so it | |
| 191 // is not done here either. | |
| 192 if (!navigation_request->common_params().url.SchemeIs( | |
| 193 url::kJavaScriptScheme)) { | |
|
clamy
2015/04/28 11:42:56
Could you add a TODO to set the boolean properly o
Fabrice (no longer in Chrome)
2015/04/28 14:40:29
Done.
| |
| 194 DidStartLoading(true); | |
| 195 } | |
| 196 | |
| 189 navigation_request_ = navigation_request.Pass(); | 197 navigation_request_ = navigation_request.Pass(); |
| 190 } | 198 } |
| 191 | 199 |
| 192 void FrameTreeNode::ResetNavigationRequest(bool is_commit) { | 200 void FrameTreeNode::ResetNavigationRequest(bool is_commit) { |
| 193 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 201 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 194 switches::kEnableBrowserSideNavigation)); | 202 switches::kEnableBrowserSideNavigation)); |
| 195 // Upon commit the current NavigationRequest will be reset. There should be no | 203 // Upon commit the current NavigationRequest will be reset. There should be no |
| 196 // cleanup performed since the navigation is still ongoing. If the reset | 204 // cleanup performed since the navigation is still ongoing. If the reset |
| 197 // corresponds to a cancelation, the RenderFrameHostManager should clean up | 205 // corresponds to a cancelation, the RenderFrameHostManager should clean up |
| 198 // any speculative RenderFrameHost it created for the navigation. | 206 // any speculative RenderFrameHost it created for the navigation. |
| 199 if (navigation_request_ && !is_commit) { | 207 if (navigation_request_ && !is_commit) { |
| 200 // TODO(clamy): perform the StopLoading logic. | 208 DidStopLoading(); |
| 201 render_manager_.CleanUpNavigation(); | 209 render_manager_.CleanUpNavigation(); |
| 202 } | 210 } |
| 203 navigation_request_.reset(); | 211 navigation_request_.reset(); |
| 204 } | 212 } |
| 205 | 213 |
| 206 bool FrameTreeNode::has_started_loading() const { | 214 bool FrameTreeNode::has_started_loading() const { |
| 207 return loading_progress_ != kLoadingProgressNotStarted; | 215 return loading_progress_ != kLoadingProgressNotStarted; |
| 208 } | 216 } |
| 209 | 217 |
| 210 void FrameTreeNode::reset_loading_progress() { | 218 void FrameTreeNode::reset_loading_progress() { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 262 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 270 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 263 "465796 FrameTreeNode::DidStopLoading::End")); | 271 "465796 FrameTreeNode::DidStopLoading::End")); |
| 264 } | 272 } |
| 265 | 273 |
| 266 void FrameTreeNode::DidChangeLoadProgress(double load_progress) { | 274 void FrameTreeNode::DidChangeLoadProgress(double load_progress) { |
| 267 loading_progress_ = load_progress; | 275 loading_progress_ = load_progress; |
| 268 frame_tree_->UpdateLoadProgress(); | 276 frame_tree_->UpdateLoadProgress(); |
| 269 } | 277 } |
| 270 | 278 |
| 271 } // namespace content | 279 } // namespace content |
| OLD | NEW |