Chromium Code Reviews| 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 |