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::didLoadWorkerScript(size_t scriptSize, size_t cac
hedMetadataSize) | 102 void ServiceWorkerGlobalScope::countScript(size_t scriptSize, size_t cachedMetad
ataSize) |
103 { | 103 { |
104 ++m_scriptCount; | 104 ++m_scriptCount; |
105 m_scriptTotalSize += scriptSize; | 105 m_scriptTotalSize += scriptSize; |
106 m_scriptCachedMetadataTotalSize += cachedMetadataSize; | 106 m_scriptCachedMetadataTotalSize += cachedMetadataSize; |
107 } | 107 } |
108 | 108 |
109 void ServiceWorkerGlobalScope::didEvaluateWorkerScript() | 109 void ServiceWorkerGlobalScope::didEvaluateWorkerScript() |
110 { | 110 { |
111 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scriptCountHistogram,
new CustomCountHistogram("ServiceWorker.ScriptCount", 1, 1000, 50)); | 111 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scriptCountHistogram,
new CustomCountHistogram("ServiceWorker.ScriptCount", 1, 1000, 50)); |
112 scriptCountHistogram.count(m_scriptCount); | 112 scriptCountHistogram.count(m_scriptCount); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 } | 220 } |
221 | 221 |
222 void ServiceWorkerGlobalScope::exceptionThrown(ErrorEvent* event) | 222 void ServiceWorkerGlobalScope::exceptionThrown(ErrorEvent* event) |
223 { | 223 { |
224 WorkerGlobalScope::exceptionThrown(event); | 224 WorkerGlobalScope::exceptionThrown(event); |
225 if (WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(thread()->is
olate())) | 225 if (WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(thread()->is
olate())) |
226 debugger->exceptionThrown(event); | 226 debugger->exceptionThrown(event); |
227 } | 227 } |
228 | 228 |
229 } // namespace blink | 229 } // namespace blink |
OLD | NEW |