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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSTiming.cpp

Issue 2468913002: Add CSSTiming to collect aggregate PLT-level stats about CSS. (Closed)
Patch Set: fix browser test Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/css/CSSTiming.h"
6
7 #include "core/paint/PaintTiming.h"
8
9 namespace blink {
10
11 static const char kSupplementName[] = "CSSTiming";
12
13 CSSTiming& CSSTiming::from(Document& document) {
14 CSSTiming* timing = static_cast<CSSTiming*>(
15 Supplement<Document>::from(document, kSupplementName));
16 if (!timing) {
17 timing = new CSSTiming(document);
18 Supplement<Document>::provideTo(document, kSupplementName, timing);
19 }
20 return *timing;
21 }
22
23 void CSSTiming::recordAuthorStyleSheetParseTime(double seconds) {
24 if (!m_paintTiming->firstContentfulPaint())
25 m_parseTimeBeforeFCP += seconds;
26 }
27
28 DEFINE_TRACE(CSSTiming) {
29 visitor->trace(m_document);
30 visitor->trace(m_paintTiming);
31 Supplement<Document>::trace(visitor);
32 }
33
34 CSSTiming::CSSTiming(Document& document)
35 : m_document(document), m_paintTiming(PaintTiming::from(document)) {}
36
37 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSTiming.h ('k') | third_party/WebKit/Source/core/css/StyleSheetContents.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698