Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/UseCounter.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/UseCounter.cpp b/third_party/WebKit/Source/core/frame/UseCounter.cpp |
| index 3f8b28145a80dd664e03efecd65de04f7d4df42d..0ef9fecf85e28afdd44d67bb42419b14e3d07cce 100644 |
| --- a/third_party/WebKit/Source/core/frame/UseCounter.cpp |
| +++ b/third_party/WebKit/Source/core/frame/UseCounter.cpp |
| @@ -36,6 +36,7 @@ |
| #include "core/inspector/ConsoleMessage.h" |
| #include "core/workers/WorkerGlobalScope.h" |
| #include "platform/Histogram.h" |
| +#include "platform/TraceEvent.h" |
| namespace blink { |
| @@ -662,8 +663,7 @@ void UseCounter::count(const Frame* frame, Feature feature) |
| if (!host) |
| return; |
| - ASSERT(Deprecation::deprecationMessage(feature).isEmpty()); |
|
foolip
2016/08/08 19:59:11
This ASSERT should still hold, right, or why was i
Pat Meenan
2016/08/09 19:06:32
UseCounter::count() is exactly this assert + the r
foolip
2016/08/11 08:03:44
Acknowledged.
|
| - host->useCounter().recordMeasurement(feature); |
| + host->useCounter().count(feature); |
| } |
| void UseCounter::count(const Document& document, Feature feature) |
| @@ -751,6 +751,7 @@ void UseCounter::count(CSSParserMode cssParserMode, CSSPropertyID feature) |
| if (!isUseCounterEnabledForMode(cssParserMode) || m_muteCount) |
| return; |
| + TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.feature_usage"), "CSSFeatureUsed", "feature", feature); |
| m_CSSFeatureBits.quickSet(feature); |
| } |
| @@ -783,4 +784,12 @@ UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) |
| return 0; |
| } |
| +void UseCounter::recordMeasurement(Feature feature) |
| +{ |
| + if (!m_muteCount) { |
|
foolip
2016/08/08 19:59:11
Can you do an early return instead, and put this s
Pat Meenan
2016/08/09 19:06:32
Done.
|
| + m_countBits.recordMeasurement(feature); |
| + TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.feature_usage"), "FeatureUsed", "feature", feature); |
| + } |
| +} |
| + |
| } // namespace blink |