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

Side by Side Diff: components/page_load_metrics/browser/metrics_web_contents_observer.cc

Issue 2139243003: customtabs: Send time to first contentful paint to the caller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/page_load_metrics/browser/metrics_web_contents_observer.h" 5 #include "components/page_load_metrics/browser/metrics_web_contents_observer.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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 int aborted_chain_size_same_url) 258 int aborted_chain_size_same_url)
259 : renderer_tracked_(false), 259 : renderer_tracked_(false),
260 navigation_start_(navigation_handle->NavigationStart()), 260 navigation_start_(navigation_handle->NavigationStart()),
261 url_(navigation_handle->GetURL()), 261 url_(navigation_handle->GetURL()),
262 abort_type_(ABORT_NONE), 262 abort_type_(ABORT_NONE),
263 started_in_foreground_(in_foreground), 263 started_in_foreground_(in_foreground),
264 aborted_chain_size_(aborted_chain_size), 264 aborted_chain_size_(aborted_chain_size),
265 aborted_chain_size_same_url_(aborted_chain_size_same_url), 265 aborted_chain_size_same_url_(aborted_chain_size_same_url),
266 embedder_interface_(embedder_interface) { 266 embedder_interface_(embedder_interface) {
267 DCHECK(!navigation_handle->HasCommitted()); 267 DCHECK(!navigation_handle->HasCommitted());
268 embedder_interface_->RegisterObservers(this); 268 embedder_interface_->RegisterObservers(this,
269 navigation_handle->GetWebContents());
269 for (const auto& observer : observers_) { 270 for (const auto& observer : observers_) {
270 observer->OnStart(navigation_handle, currently_committed_url, 271 observer->OnStart(navigation_handle, currently_committed_url,
271 started_in_foreground_); 272 started_in_foreground_);
272 } 273 }
273 } 274 }
274 275
275 PageLoadTracker::~PageLoadTracker() { 276 PageLoadTracker::~PageLoadTracker() {
276 const PageLoadExtraInfo info = ComputePageLoadExtraInfo(); 277 const PageLoadExtraInfo info = ComputePageLoadExtraInfo();
277 278
278 if (info.time_to_commit && renderer_tracked() && timing_.IsEmpty()) { 279 if (info.time_to_commit && renderer_tracked() && timing_.IsEmpty()) {
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 924
924 if (!committed_load_->UpdateTiming(timing, metadata)) { 925 if (!committed_load_->UpdateTiming(timing, metadata)) {
925 // If the page load tracker cannot update its timing, something is wrong 926 // If the page load tracker cannot update its timing, something is wrong
926 // with the IPC (it's from another load, or it's invalid in some other way). 927 // with the IPC (it's from another load, or it's invalid in some other way).
927 // We expect this to be a rare occurrence. 928 // We expect this to be a rare occurrence.
928 RecordInternalError(ERR_BAD_TIMING_IPC); 929 RecordInternalError(ERR_BAD_TIMING_IPC);
929 } 930 }
930 } 931 }
931 932
932 } // namespace page_load_metrics 933 } // namespace page_load_metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698