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

Side by Side Diff: content/browser/frame_host/navigation_request.cc

Issue 1532873003: PlzNavigate: add initial traces for new TBM benchmarks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed crash issue for synchronous navigations. Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698