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

Unified Diff: third_party/WebKit/Source/core/css/CSSTiming.h

Issue 2468913002: Add CSSTiming to collect aggregate PLT-level stats about CSS. (Closed)
Patch Set: minor comment/naming changes 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/CSSTiming.h
diff --git a/third_party/WebKit/Source/core/css/CSSTiming.h b/third_party/WebKit/Source/core/css/CSSTiming.h
new file mode 100644
index 0000000000000000000000000000000000000000..73cce247e24a23410c1a06669b52164e20e8adbc
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/CSSTiming.h
@@ -0,0 +1,48 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CSSTiming_h
+#define CSSTiming_h
+
+#include "core/dom/Document.h"
+#include "platform/Supplementable.h"
+#include "platform/heap/Handle.h"
+#include "wtf/Noncopyable.h"
+
+namespace blink {
+
+class PaintTiming;
+
+class CSSTiming : public GarbageCollectedFinalized<CSSTiming>,
+ public Supplement<Document> {
+ WTF_MAKE_NONCOPYABLE(CSSTiming);
+ USING_GARBAGE_COLLECTED_MIXIN(CSSTiming);
+
+ public:
+ virtual ~CSSTiming() {}
+
+ // TODO(csharrison): Also record update style time before first paint.
+ void recordAuthorStyleSheetParseTime(double us);
+
+ // In microseconds.
Bryan McQuade 2016/11/04 14:11:30 iirc most of our other fields operate in seconds,
Charlie Harrison 2016/11/04 16:05:19 Done.
+ double authorStyleSheetParseDurationBeforeFCP() const {
+ return m_parseTimeBeforeFCP;
+ }
+
+ static CSSTiming& from(Document&);
+ DECLARE_VIRTUAL_TRACE();
+
+ private:
+ explicit CSSTiming(Document&);
+
+ // In microseconds.
+ double m_parseTimeBeforeFCP = 0;
+
+ Member<Document> m_document;
+ Member<PaintTiming> m_paintTiming;
+};
+
+} // namespace blink
+
+#endif // CSSTiming_h

Powered by Google App Engine
This is Rietveld 408576698