| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 void NavigationRequest::OnRequestFailed(bool has_stale_copy_in_cache, | 274 void NavigationRequest::OnRequestFailed(bool has_stale_copy_in_cache, |
| 275 int net_error) { | 275 int net_error) { |
| 276 DCHECK(state_ == STARTED); | 276 DCHECK(state_ == STARTED); |
| 277 state_ = FAILED; | 277 state_ = FAILED; |
| 278 navigation_handle_->set_net_error_code(static_cast<net::Error>(net_error)); | 278 navigation_handle_->set_net_error_code(static_cast<net::Error>(net_error)); |
| 279 frame_tree_node_->navigator()->FailedNavigation( | 279 frame_tree_node_->navigator()->FailedNavigation( |
| 280 frame_tree_node_, has_stale_copy_in_cache, net_error); | 280 frame_tree_node_, has_stale_copy_in_cache, net_error); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) { | 283 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) { |
| 284 if (frame_tree_node_->IsMainFrame()) { |
| 285 TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP0( |
| 286 "navigation", "Navigation timeToNetworkStack", navigation_handle_.get(), |
| 287 timestamp.ToInternalValue()); |
| 288 } |
| 289 |
| 284 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp, | 290 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp, |
| 285 common_params_.url); | 291 common_params_.url); |
| 286 } | 292 } |
| 287 | 293 |
| 288 void NavigationRequest::OnStartChecksComplete( | 294 void NavigationRequest::OnStartChecksComplete( |
| 289 NavigationThrottle::ThrottleCheckResult result) { | 295 NavigationThrottle::ThrottleCheckResult result) { |
| 290 CHECK(result != NavigationThrottle::DEFER); | 296 CHECK(result != NavigationThrottle::DEFER); |
| 291 | 297 |
| 292 // Abort the request if needed. This will destroy the NavigationRequest. | 298 // Abort the request if needed. This will destroy the NavigationRequest. |
| 293 if (result == NavigationThrottle::CANCEL_AND_IGNORE || | 299 if (result == NavigationThrottle::CANCEL_AND_IGNORE || |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 browser_context, navigating_frame_host->GetSiteInstance()); | 349 browser_context, navigating_frame_host->GetSiteInstance()); |
| 344 DCHECK(partition); | 350 DCHECK(partition); |
| 345 | 351 |
| 346 ServiceWorkerContextWrapper* service_worker_context = | 352 ServiceWorkerContextWrapper* service_worker_context = |
| 347 static_cast<ServiceWorkerContextWrapper*>( | 353 static_cast<ServiceWorkerContextWrapper*>( |
| 348 partition->GetServiceWorkerContext()); | 354 partition->GetServiceWorkerContext()); |
| 349 navigation_handle_->InitServiceWorkerHandle(service_worker_context); | 355 navigation_handle_->InitServiceWorkerHandle(service_worker_context); |
| 350 } | 356 } |
| 351 | 357 |
| 352 } // namespace content | 358 } // namespace content |
| OLD | NEW |