| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 , m_scriptCount(0) | 92 , m_scriptCount(0) |
| 93 , m_scriptTotalSize(0) | 93 , m_scriptTotalSize(0) |
| 94 , m_scriptCachedMetadataTotalSize(0) | 94 , m_scriptCachedMetadataTotalSize(0) |
| 95 { | 95 { |
| 96 } | 96 } |
| 97 | 97 |
| 98 ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope() | 98 ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope() |
| 99 { | 99 { |
| 100 } | 100 } |
| 101 | 101 |
| 102 void ServiceWorkerGlobalScope::didInitializeContext() { |
| 103 ServiceWorkerGlobalScopeClient::from(WorkerGlobalScope::clients())->didIniti
alizeContext(this); |
| 104 } |
| 105 |
| 102 void ServiceWorkerGlobalScope::didEvaluateWorkerScript() | 106 void ServiceWorkerGlobalScope::didEvaluateWorkerScript() |
| 103 { | 107 { |
| 104 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scriptCountHistogram,
new CustomCountHistogram("ServiceWorker.ScriptCount", 1, 1000, 50)); | 108 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scriptCountHistogram,
new CustomCountHistogram("ServiceWorker.ScriptCount", 1, 1000, 50)); |
| 105 scriptCountHistogram.count(m_scriptCount); | 109 scriptCountHistogram.count(m_scriptCount); |
| 106 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scriptTotalSizeHistogr
am, new CustomCountHistogram("ServiceWorker.ScriptTotalSize", 1000, 5000000, 50)
); | 110 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scriptTotalSizeHistogr
am, new CustomCountHistogram("ServiceWorker.ScriptTotalSize", 1000, 5000000, 50)
); |
| 107 scriptTotalSizeHistogram.count(m_scriptTotalSize); | 111 scriptTotalSizeHistogram.count(m_scriptTotalSize); |
| 108 if (m_scriptCachedMetadataTotalSize) { | 112 if (m_scriptCachedMetadataTotalSize) { |
| 109 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, cachedMetadataHist
ogram, new CustomCountHistogram("ServiceWorker.ScriptCachedMetadataTotalSize", 1
000, 50000000, 50)); | 113 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, cachedMetadataHist
ogram, new CustomCountHistogram("ServiceWorker.ScriptCachedMetadataTotalSize", 1
000, 50000000, 50)); |
| 110 cachedMetadataHistogram.count(m_scriptCachedMetadataTotalSize); | 114 cachedMetadataHistogram.count(m_scriptCachedMetadataTotalSize); |
| 111 } | 115 } |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 225 } |
| 222 | 226 |
| 223 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta
dataSize) | 227 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta
dataSize) |
| 224 { | 228 { |
| 225 ++m_scriptCount; | 229 ++m_scriptCount; |
| 226 m_scriptTotalSize += scriptSize; | 230 m_scriptTotalSize += scriptSize; |
| 227 m_scriptCachedMetadataTotalSize += cachedMetadataSize; | 231 m_scriptCachedMetadataTotalSize += cachedMetadataSize; |
| 228 } | 232 } |
| 229 | 233 |
| 230 } // namespace blink | 234 } // namespace blink |
| OLD | NEW |