Chromium Code Reviews| Index: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp |
| diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp |
| index 98493bb439e8897c2818f7994d76917fcff5d7b4..055f9ff7b3496f5b81bf65404504a3dcf4f6df28 100644 |
| --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp |
| +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp |
| @@ -55,6 +55,7 @@ |
| #include "modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h" |
| #include "modules/serviceworkers/ServiceWorkerThread.h" |
| #include "modules/serviceworkers/WaitUntilObserver.h" |
| +#include "platform/Histogram.h" |
| #include "platform/network/ResourceRequest.h" |
| #include "platform/weborigin/DatabaseIdentifier.h" |
| #include "platform/weborigin/KURL.h" |
| @@ -93,11 +94,13 @@ ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope() |
| void ServiceWorkerGlobalScope::didEvaluateWorkerScript() |
| { |
| - if (Platform* platform = Platform::current()) { |
| - platform->histogramCustomCounts("ServiceWorker.ScriptCount", m_scriptCount, 1, 1000, 50); |
| - platform->histogramCustomCounts("ServiceWorker.ScriptTotalSize", m_scriptTotalSize, 1000, 5000000, 50); |
| - if (m_scriptCachedMetadataTotalSize) |
| - platform->histogramCustomCounts("ServiceWorker.ScriptCachedMetadataTotalSize", m_scriptCachedMetadataTotalSize, 1000, 50000000, 50); |
| + DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scriptCountHistogram, new CustomCountHistogram("ServiceWorker.ScriptCount", 1, 1000, 50)); |
|
nhiroki
2016/02/05 00:55:41
_THREAD_SAFE_ should be correct. This function can
|
| + scriptCountHistogram.count(m_scriptCount); |
| + DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scriptTotalSizeHistogram, new CustomCountHistogram("ServiceWorker.ScriptTotalSize", 1000, 5000000, 50)); |
| + scriptTotalSizeHistogram.count(m_scriptTotalSize); |
| + if (m_scriptCachedMetadataTotalSize) { |
| + DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, cachedMetadataHistogram, new CustomCountHistogram("ServiceWorker.ScriptCachedMetadataTotalSize", 1000, 50000000, 50)); |
| + cachedMetadataHistogram.count(m_scriptCachedMetadataTotalSize); |
| } |
| m_didEvaluateScript = true; |
| } |