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

Side by Side Diff: chrome/browser/page_load_metrics/page_load_tracker.cc

Issue 2423383002: [Prerender] first contentful paint histograms. (Closed)
Patch Set: Generalize internal histogram function name Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/page_load_metrics/page_load_tracker.h" 5 #include "chrome/browser/page_load_metrics/page_load_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <ostream> 8 #include <ostream>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 abort_user_initiated_(false), 297 abort_user_initiated_(false),
298 started_in_foreground_(in_foreground), 298 started_in_foreground_(in_foreground),
299 page_transition_(navigation_handle->GetPageTransition()), 299 page_transition_(navigation_handle->GetPageTransition()),
300 num_cache_requests_(0), 300 num_cache_requests_(0),
301 num_network_requests_(0), 301 num_network_requests_(0),
302 user_initiated_(IsNavigationUserInitiated(navigation_handle)), 302 user_initiated_(IsNavigationUserInitiated(navigation_handle)),
303 aborted_chain_size_(aborted_chain_size), 303 aborted_chain_size_(aborted_chain_size),
304 aborted_chain_size_same_url_(aborted_chain_size_same_url), 304 aborted_chain_size_same_url_(aborted_chain_size_same_url),
305 embedder_interface_(embedder_interface) { 305 embedder_interface_(embedder_interface) {
306 DCHECK(!navigation_handle->HasCommitted()); 306 DCHECK(!navigation_handle->HasCommitted());
307 if (embedder_interface_->IsPrerendering(
308 navigation_handle->GetWebContents())) {
309 DCHECK(!started_in_foreground_);
310 // For the time being, we do not track prerenders. See crbug.com/648338 for
311 // details.
312 StopTracking();
313 return;
314 }
315
316 embedder_interface_->RegisterObservers(this); 307 embedder_interface_->RegisterObservers(this);
317 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnStart, navigation_handle, 308 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnStart, navigation_handle,
318 currently_committed_url, started_in_foreground_); 309 currently_committed_url, started_in_foreground_);
319 } 310 }
320 311
321 PageLoadTracker::~PageLoadTracker() { 312 PageLoadTracker::~PageLoadTracker() {
322 if (app_entered_background_) { 313 if (app_entered_background_) {
323 RecordAppBackgroundPageLoadCompleted(true); 314 RecordAppBackgroundPageLoadCompleted(true);
324 } 315 }
325 316
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 // explicitly filter these types of aborts out when deciding if the abort was 669 // explicitly filter these types of aborts out when deciding if the abort was
679 // user initiated. 670 // user initiated.
680 abort_user_initiated_ = user_initiated && abort_type != ABORT_CLIENT_REDIRECT; 671 abort_user_initiated_ = user_initiated && abort_type != ABORT_CLIENT_REDIRECT;
681 672
682 if (is_certainly_browser_timestamp) { 673 if (is_certainly_browser_timestamp) {
683 ClampBrowserTimestampIfInterProcessTimeTickSkew(&abort_time_); 674 ClampBrowserTimestampIfInterProcessTimeTickSkew(&abort_time_);
684 } 675 }
685 } 676 }
686 677
687 } // namespace page_load_metrics 678 } // namespace page_load_metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698