Commit 7c7ee626 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

Export FirstMeaningfulPaintCandidate() through WebPerformance

FMP signal has sometimes been used for dismissing a splash screen in some
downstream Web Application platforms. But, FMP signal couldn't occasionally
be generated or happened a little bit late, then it could cause that the
splash screen dismissed a little bit late in the Web Application platforms.
This CL is to export FirstMeaningfulPaintCandidate() in order to be used when
FirstMeaningfulPaint() doesn't work or generates a signal a little bit late.

Bug: 848639
Test: Covered by FirstMeaningfulPaintDetectorTest.FirstMeaningfulPaintCandidate
Change-Id: I492d98ef4998e772d293f81b9991a066cb346233
Reviewed-on: https://chromium-review.googlesource.com/1080499Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung.kim@lge.com>
Cr-Commit-Position: refs/heads/master@{#564841}
parent 5fdbbb3e
......@@ -90,6 +90,7 @@ class WebPerformance {
BLINK_EXPORT double FirstImagePaint() const;
BLINK_EXPORT double FirstContentfulPaint() const;
BLINK_EXPORT double FirstMeaningfulPaint() const;
BLINK_EXPORT double FirstMeaningfulPaintCandidate() const;
BLINK_EXPORT double PageInteractive() const;
BLINK_EXPORT double PageInteractiveDetection() const;
BLINK_EXPORT double FirstInputInvalidatingInteractive() const;
......
......@@ -166,6 +166,11 @@ double WebPerformance::FirstMeaningfulPaint() const {
return MillisecondsToSeconds(private_->timing()->FirstMeaningfulPaint());
}
double WebPerformance::FirstMeaningfulPaintCandidate() const {
return MillisecondsToSeconds(
private_->timing()->FirstMeaningfulPaintCandidate());
}
double WebPerformance::PageInteractive() const {
return MillisecondsToSeconds(private_->timing()->PageInteractive());
}
......
......@@ -349,6 +349,15 @@ unsigned long long PerformanceTiming::FirstMeaningfulPaint() const {
return MonotonicTimeToIntegerMilliseconds(timing->FirstMeaningfulPaint());
}
unsigned long long PerformanceTiming::FirstMeaningfulPaintCandidate() const {
const PaintTiming* timing = GetPaintTiming();
if (!timing)
return 0;
return MonotonicTimeToIntegerMilliseconds(
timing->FirstMeaningfulPaintCandidate());
}
unsigned long long PerformanceTiming::PageInteractive() const {
InteractiveDetector* interactive_detector = GetInteractiveDetector();
if (!interactive_detector)
......
......@@ -100,6 +100,13 @@ class CORE_EXPORT PerformanceTiming final : public ScriptWrappable,
// The time of the first 'meaningful' paint, A meaningful paint is a paint
// where the page's primary content is visible.
unsigned long long FirstMeaningfulPaint() const;
// The time of the candidate of first 'meaningful' paint, A meaningful paint
// candidate indicates the first time we considered a paint to qualify as the
// potential first meaningful paint. But, be careful that it may be an
// optimistic (i.e., too early) estimate.
// TODO(crbug.com/848639): This function is exposed as an experiment, and if
// not useful, this function can be removed.
unsigned long long FirstMeaningfulPaintCandidate() const;
// The first time the page is considered 'interactive'. This is determined
// using heuristics based on main thread and network activity.
unsigned long long PageInteractive() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment