Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintTiming.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintTiming.cpp b/third_party/WebKit/Source/core/paint/PaintTiming.cpp |
| index f87085b838c3eeaf5de00e7bed4e77de66bd05c9..f7e7ddd5dececb71047ce14398e71c2ec7e81e3a 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintTiming.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintTiming.cpp |
| @@ -5,8 +5,11 @@ |
| #include "core/paint/PaintTiming.h" |
| #include "core/dom/Document.h" |
| +#include "core/frame/FrameView.h" |
| +#include "core/frame/LocalFrame.h" |
| #include "core/loader/DocumentLoader.h" |
| #include "platform/tracing/TraceEvent.h" |
| +#include "public/platform/WebFrameScheduler.h" |
| namespace blink { |
| @@ -65,6 +68,19 @@ void PaintTiming::markFirstImagePaint() { |
| notifyPaintTimingChanged(); |
| } |
| +void PaintTiming::markFirstMeaningfulPaintCandidate() { |
| + // The first meaningful paint candidate can be reported very early, even |
| + // before the first contentful paint. To cut down on false positives, we only |
| + // report the first meaningful paint candidate after the first contentful |
| + // paint. |
| + if (!m_firstContentfulPaint) |
|
Kunihiko Sakamoto
2016/10/13 08:01:34
Within a single paint phase, this runs after Paint
Sami
2016/10/13 08:23:59
Good point. Perhaps the thing to do is to ignore t
Kunihiko Sakamoto
2016/10/13 08:38:46
Yeah, I think patch set 9 would work.
|
| + return; |
| + if (m_document->frame() && m_document->frame()->view() && |
| + !m_document->frame()->view()->parent()) { |
| + m_document->frame()->frameScheduler()->onFirstMeaningfulPaint(); |
| + } |
| +} |
| + |
| void PaintTiming::setFirstMeaningfulPaint(double stamp) { |
| DCHECK_EQ(m_firstMeaningfulPaint, 0.0); |
| m_firstMeaningfulPaint = stamp; |