OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/navigation_request.h" | 5 #include "content/browser/frame_host/navigation_request.h" |
6 | 6 |
7 #include "content/browser/frame_host/frame_tree.h" | 7 #include "content/browser/frame_host/frame_tree.h" |
8 #include "content/browser/frame_host/frame_tree_node.h" | 8 #include "content/browser/frame_host/frame_tree_node.h" |
9 #include "content/browser/frame_host/navigation_controller_impl.h" | 9 #include "content/browser/frame_host/navigation_controller_impl.h" |
10 #include "content/browser/frame_host/navigation_handle_impl.h" | 10 #include "content/browser/frame_host/navigation_handle_impl.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 } | 197 } |
198 | 198 |
199 void NavigationRequest::CreateNavigationHandle(NavigatorDelegate* delegate) { | 199 void NavigationRequest::CreateNavigationHandle(NavigatorDelegate* delegate) { |
200 navigation_handle_ = NavigationHandleImpl::Create( | 200 navigation_handle_ = NavigationHandleImpl::Create( |
201 common_params_.url, frame_tree_node_->IsMainFrame(), delegate); | 201 common_params_.url, frame_tree_node_->IsMainFrame(), delegate); |
202 } | 202 } |
203 | 203 |
204 void NavigationRequest::TransferNavigationHandleOwnership( | 204 void NavigationRequest::TransferNavigationHandleOwnership( |
205 RenderFrameHostImpl* render_frame_host) { | 205 RenderFrameHostImpl* render_frame_host) { |
206 render_frame_host->SetNavigationHandle(navigation_handle_.Pass()); | 206 render_frame_host->SetNavigationHandle(navigation_handle_.Pass()); |
207 render_frame_host->navigation_handle()->ReadyToCommitNavigation( | |
nasko
2015/09/18 16:42:16
Why here instead of right before CommitNavigation
clamy
2015/09/18 20:37:33
Because we don't have a renderer prior to the call
| |
208 render_frame_host); | |
207 } | 209 } |
208 | 210 |
209 void NavigationRequest::OnRequestRedirected( | 211 void NavigationRequest::OnRequestRedirected( |
210 const net::RedirectInfo& redirect_info, | 212 const net::RedirectInfo& redirect_info, |
211 const scoped_refptr<ResourceResponse>& response) { | 213 const scoped_refptr<ResourceResponse>& response) { |
212 // TODO(davidben): Track other changes from redirects. These are important | 214 // TODO(davidben): Track other changes from redirects. These are important |
213 // for, e.g., reloads. | 215 // for, e.g., reloads. |
214 common_params_.url = redirect_info.new_url; | 216 common_params_.url = redirect_info.new_url; |
215 | 217 |
216 // TODO(davidben): This where prerender and navigation_interceptor should be | 218 // TODO(davidben): This where prerender and navigation_interceptor should be |
(...skipping 20 matching lines...) Expand all Loading... | |
237 frame_tree_node_->navigator()->FailedNavigation( | 239 frame_tree_node_->navigator()->FailedNavigation( |
238 frame_tree_node_, has_stale_copy_in_cache, net_error); | 240 frame_tree_node_, has_stale_copy_in_cache, net_error); |
239 } | 241 } |
240 | 242 |
241 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) { | 243 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) { |
242 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp, | 244 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp, |
243 common_params_.url); | 245 common_params_.url); |
244 } | 246 } |
245 | 247 |
246 } // namespace content | 248 } // namespace content |
OLD | NEW |