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

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

Issue 2617103002: Use a new Supplement constructor for Supplement<Document> (Part 1) (Closed)
Patch Set: temp Created 3 years, 11 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/PaintTiming.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintTiming.cpp b/third_party/WebKit/Source/core/paint/PaintTiming.cpp
index 2a62dcb266e04b9824d5483188bfe4861dfe0220..09a950dc37945de3f9bca63eb5b7ab3198a46648 100644
--- a/third_party/WebKit/Source/core/paint/PaintTiming.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintTiming.cpp
@@ -72,9 +72,8 @@ void PaintTiming::markFirstMeaningfulPaintCandidate() {
if (m_firstMeaningfulPaintCandidate)
return;
m_firstMeaningfulPaintCandidate = monotonicallyIncreasingTime();
- if (m_document->frame() && m_document->frame()->view() &&
- !m_document->frame()->view()->parent()) {
- m_document->frame()->frameScheduler()->onFirstMeaningfulPaint();
+ if (frame() && frame()->view() && !frame()->view()->parent()) {
+ frame()->frameScheduler()->onFirstMeaningfulPaint();
}
}
@@ -100,22 +99,21 @@ void PaintTiming::notifyPaint(bool isFirstPaint,
}
DEFINE_TRACE(PaintTiming) {
- visitor->trace(m_document);
visitor->trace(m_fmpDetector);
Supplement<Document>::trace(visitor);
}
PaintTiming::PaintTiming(Document& document)
- : m_document(document),
+ : Supplement<Document>(document),
m_fmpDetector(new FirstMeaningfulPaintDetector(this)) {}
LocalFrame* PaintTiming::frame() const {
- return m_document ? m_document->frame() : nullptr;
+ return host()->frame();
}
void PaintTiming::notifyPaintTimingChanged() {
- if (m_document && m_document->loader())
- m_document->loader()->didChangePerformanceTiming();
+ if (host()->loader())
+ host()->loader()->didChangePerformanceTiming();
}
void PaintTiming::setFirstPaint(double stamp) {
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintTiming.h ('k') | third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698