Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/StyleSheetContents.cpp |
| diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp |
| index 0e6397fa873fbed6093505d54431650d9a884b2d..2846ab8102df2ed76caa55847fe8d0aa51fb1c4f 100644 |
| --- a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp |
| +++ b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp |
| @@ -21,6 +21,7 @@ |
| #include "core/css/StyleSheetContents.h" |
| #include "core/css/CSSStyleSheet.h" |
| +#include "core/css/CSSTiming.h" |
| #include "core/css/StylePropertySet.h" |
| #include "core/css/StyleRule.h" |
| #include "core/css/StyleRuleImport.h" |
| @@ -327,7 +328,7 @@ void StyleSheetContents::parseAuthorStyleSheet( |
| const SecurityOrigin* securityOrigin) { |
| TRACE_EVENT1("blink,devtools.timeline", "ParseAuthorStyleSheet", "data", |
| InspectorParseAuthorStyleSheetEvent::data(cachedStyleSheet)); |
| - SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Style.AuthorStyleSheet.ParseTime"); |
| + double startTime = monotonicallyIncreasingTimeMS(); |
|
Bryan McQuade
2016/11/04 14:11:30
can we call this startTimeMs? any time we're deali
Charlie Harrison
2016/11/04 16:05:19
Changed the name. Note that our local histogram he
|
| bool isSameOriginRequest = |
| securityOrigin && securityOrigin->canRequest(baseURL()); |
| @@ -360,6 +361,14 @@ void StyleSheetContents::parseAuthorStyleSheet( |
| CSSParserContext context(parserContext(), UseCounter::getFrom(this)); |
| CSSParser::parseSheet(context, this, sheetText, |
| RuntimeEnabledFeatures::lazyParseCSSEnabled()); |
| + |
| + DEFINE_STATIC_LOCAL(CustomCountHistogram, parseHistogram, |
| + ("Style.AuthorStyleSheet.ParseTime", 0, 10000000, 50)); |
| + double parseDuration = 1000 * (monotonicallyIncreasingTimeMS() - startTime); |
| + parseHistogram.count(parseDuration); |
| + if (Document* document = singleOwnerDocument()) { |
| + CSSTiming::from(*document).recordAuthorStyleSheetParseTime(parseDuration); |
| + } |
| } |
| void StyleSheetContents::parseString(const String& sheetText) { |