Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp |
| diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp |
| index 774c4de1b00618e1224eb4232513eb4c1cf6d042..2727db9dd9661a4d779b3b3abf7202026f3fcf6a 100644 |
| --- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp |
| @@ -46,6 +46,7 @@ |
| #include "core/workers/WorkerThreadStartupData.h" |
| #include "modules/serviceworkers/ServiceWorkerContainerClient.h" |
| #include "modules/serviceworkers/ServiceWorkerThread.h" |
| +#include "platform/Histogram.h" |
| #include "platform/SharedBuffer.h" |
| #include "platform/heap/Handle.h" |
| #include "platform/network/ContentSecurityPolicyParsers.h" |
| @@ -313,9 +314,12 @@ void WebEmbeddedWorkerImpl::onScriptLoaderFinished() |
| } |
| m_workerContextClient->workerScriptLoaded(); |
| - Platform::current()->histogramCustomCounts("ServiceWorker.ScriptSize", m_mainScriptLoader->script().length(), 1000, 5000000, 50); |
| - if (m_mainScriptLoader->cachedMetadata()) |
| - Platform::current()->histogramCustomCounts("ServiceWorker.ScriptCachedMetadataSize", m_mainScriptLoader->cachedMetadata()->size(), 1000, 50000000, 50); |
| + DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scriptSizeHistogram, new CustomCountHistogram("ServiceWorker.ScriptSize", 1000, 5000000, 50)); |
|
nhiroki
2016/02/05 00:55:41
This function is called only on the main thread (a
|
| + scriptSizeHistogram.count(m_mainScriptLoader->script().length()); |
| + if (m_mainScriptLoader->cachedMetadata()) { |
| + DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scriptCachedMetadataSizeHistogram, new CustomCountHistogram("ServiceWorker.ScriptCachedMetadataSize", 1000, 50000000, 50)); |
| + scriptCachedMetadataSizeHistogram.count(m_mainScriptLoader->cachedMetadata()->size()); |
| + } |
| startWorkerThread(); |
| } |