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

Unified Diff: third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp

Issue 2883273003: Move the user interaction policy for FirstMeaningfulPaint UMA into renderer (Closed)
Patch Set: rebase Created 3 years, 6 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: third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp
diff --git a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp
index 8bf96318733a7ccf53790c9d623db2685af6c678..790a859f382639fd18c695626ebfd071d687a09f 100644
--- a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp
+++ b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp
@@ -93,6 +93,7 @@ void FirstMeaningfulPaintDetector::NotifyPaint() {
return;
provisional_first_meaningful_paint_ = MonotonicallyIncreasingTime();
+ had_user_input_before_provisional_first_meaningful_paint_ = had_user_input_;
next_paint_is_meaningful_ = false;
if (network2_quiet_reached_)
@@ -112,6 +113,14 @@ void FirstMeaningfulPaintDetector::NotifyPaint() {
provisional_first_meaningful_paint_);
}
+// This is called only on FirstMeaningfulPaintDetector for main frame.
+void FirstMeaningfulPaintDetector::NotifyInputEvent() {
+ // Ignore user inputs before first paint.
+ if (paint_timing_->FirstPaint() == 0.0)
+ return;
+ had_user_input_ = kHadUserInput;
+}
+
int FirstMeaningfulPaintDetector::ActiveConnections() {
DCHECK(GetDocument());
ResourceFetcher* fetcher = GetDocument()->Fetcher();
@@ -176,7 +185,9 @@ void FirstMeaningfulPaintDetector::Network2QuietTimerFired(TimerBase*) {
std::max(provisional_first_meaningful_paint_,
paint_timing_->FirstContentfulPaint());
// Report FirstMeaningfulPaint when the page reached network 2-quiet.
- paint_timing_->SetFirstMeaningfulPaint(first_meaningful_paint2_quiet_);
+ paint_timing_->SetFirstMeaningfulPaint(
+ first_meaningful_paint2_quiet_,
+ had_user_input_before_provisional_first_meaningful_paint_);
}
ReportHistograms();
}

Powered by Google App Engine
This is Rietveld 408576698