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

Unified Diff: components/page_load_metrics/browser/metrics_web_contents_observer.cc

Issue 1817263003: Allow TimeTicks for serialized page load operations to be equal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add param Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: components/page_load_metrics/browser/metrics_web_contents_observer.cc
diff --git a/components/page_load_metrics/browser/metrics_web_contents_observer.cc b/components/page_load_metrics/browser/metrics_web_contents_observer.cc
index 94528773f8549445bc1188541819f3a6ebf81317..2f94664ee8cf1e170251eefd6aa178047b671499 100644
--- a/components/page_load_metrics/browser/metrics_web_contents_observer.cc
+++ b/components/page_load_metrics/browser/metrics_web_contents_observer.cc
@@ -192,8 +192,7 @@ PageLoadTracker::PageLoadTracker(
PageLoadTracker::~PageLoadTracker() {
const PageLoadExtraInfo info = GetPageLoadMetricsInfo();
- if (!info.time_to_commit.is_zero() && renderer_tracked() &&
- timing_.IsEmpty()) {
+ if (info.committed && renderer_tracked() && timing_.IsEmpty()) {
RecordInternalError(ERR_NO_IPCS_RECEIVED);
}
// Recall that trackers that are given ABORT_UNKNOWN_NAVIGATION have their
@@ -331,27 +330,30 @@ PageLoadExtraInfo PageLoadTracker::GetPageLoadMetricsInfo() {
base::TimeDelta first_foreground_time;
base::TimeDelta time_to_abort;
base::TimeDelta time_to_commit;
+ bool committed = false;
if (!background_time_.is_null())
first_background_time = background_time_ - navigation_start_;
if (!foreground_time_.is_null())
first_foreground_time = foreground_time_ - navigation_start_;
if (abort_type_ != ABORT_NONE) {
- DCHECK_GT(abort_time_, navigation_start_);
+ DCHECK_GE(abort_time_, navigation_start_);
time_to_abort = abort_time_ - navigation_start_;
} else {
DCHECK(abort_time_.is_null());
}
if (!commit_time_.is_null()) {
- DCHECK_GT(commit_time_, navigation_start_);
+ DCHECK_GE(commit_time_, navigation_start_);
time_to_commit = commit_time_ - navigation_start_;
+ committed = true;
} else {
DCHECK(commit_time_.is_null());
}
+
return PageLoadExtraInfo(first_background_time, first_foreground_time,
- started_in_foreground_,
- commit_time_.is_null() ? GURL() : url_,
- time_to_commit, abort_type_, time_to_abort);
+ started_in_foreground_, committed ? url_ : GURL(),
+ committed, time_to_commit, abort_type_,
+ time_to_abort);
}
void PageLoadTracker::NotifyAbort(UserAbortType abort_type,
@@ -402,7 +404,7 @@ void PageLoadTracker::UpdateAbortInternal(UserAbortType abort_type,
// infer the cause of aborts. It would be better if the navigation code could
// instead report the actual cause of an aborted navigation. See crbug/571647
// for details.
- if (timestamp <= navigation_start_) {
+ if (timestamp < navigation_start_) {
RecordInternalError(ERR_ABORT_BEFORE_NAVIGATION_START);
abort_type_ = ABORT_NONE;
abort_time_ = base::TimeTicks();

Powered by Google App Engine
This is Rietveld 408576698