| 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 25 matching lines...) Expand all Loading... |
| 36 #include "core/events/Event.h" | 36 #include "core/events/Event.h" |
| 37 #include "core/fetch/MemoryCache.h" | 37 #include "core/fetch/MemoryCache.h" |
| 38 #include "core/fetch/ResourceLoaderOptions.h" | 38 #include "core/fetch/ResourceLoaderOptions.h" |
| 39 #include "core/inspector/ConsoleMessage.h" | 39 #include "core/inspector/ConsoleMessage.h" |
| 40 #include "core/inspector/ScriptCallStack.h" | 40 #include "core/inspector/ScriptCallStack.h" |
| 41 #include "core/inspector/WorkerInspectorController.h" | 41 #include "core/inspector/WorkerInspectorController.h" |
| 42 #include "core/loader/ThreadableLoader.h" | 42 #include "core/loader/ThreadableLoader.h" |
| 43 #include "core/workers/WorkerClients.h" | 43 #include "core/workers/WorkerClients.h" |
| 44 #include "core/workers/WorkerThreadStartupData.h" | 44 #include "core/workers/WorkerThreadStartupData.h" |
| 45 #include "modules/EventTargetModules.h" | 45 #include "modules/EventTargetModules.h" |
| 46 #include "modules/cachestorage/CacheStorage.h" |
| 47 #include "modules/cachestorage/InspectorCacheStorageAgent.h" |
| 46 #include "modules/fetch/GlobalFetch.h" | 48 #include "modules/fetch/GlobalFetch.h" |
| 47 #include "modules/serviceworkers/InspectorServiceWorkerCacheAgent.h" | |
| 48 #include "modules/serviceworkers/ServiceWorkerClients.h" | 49 #include "modules/serviceworkers/ServiceWorkerClients.h" |
| 49 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" | 50 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" |
| 50 #include "modules/serviceworkers/ServiceWorkerRegistration.h" | 51 #include "modules/serviceworkers/ServiceWorkerRegistration.h" |
| 51 #include "modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h" | 52 #include "modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h" |
| 52 #include "modules/serviceworkers/ServiceWorkerThread.h" | 53 #include "modules/serviceworkers/ServiceWorkerThread.h" |
| 53 #include "modules/serviceworkers/WaitUntilObserver.h" | 54 #include "modules/serviceworkers/WaitUntilObserver.h" |
| 54 #include "platform/network/ResourceRequest.h" | 55 #include "platform/network/ResourceRequest.h" |
| 55 #include "platform/weborigin/DatabaseIdentifier.h" | 56 #include "platform/weborigin/DatabaseIdentifier.h" |
| 56 #include "platform/weborigin/KURL.h" | 57 #include "platform/weborigin/KURL.h" |
| 57 #include "public/platform/Platform.h" | 58 #include "public/platform/Platform.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 92 |
| 92 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String
& userAgent, ServiceWorkerThread* thread, double timeOrigin, const SecurityOrigi
n* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) | 93 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String
& userAgent, ServiceWorkerThread* thread, double timeOrigin, const SecurityOrigi
n* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) |
| 93 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, starterOrigin, worke
rClients) | 94 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, starterOrigin, worke
rClients) |
| 94 , m_didEvaluateScript(false) | 95 , m_didEvaluateScript(false) |
| 95 , m_hadErrorInTopLevelEventHandler(false) | 96 , m_hadErrorInTopLevelEventHandler(false) |
| 96 , m_eventNestingLevel(0) | 97 , m_eventNestingLevel(0) |
| 97 , m_scriptCount(0) | 98 , m_scriptCount(0) |
| 98 , m_scriptTotalSize(0) | 99 , m_scriptTotalSize(0) |
| 99 , m_scriptCachedMetadataTotalSize(0) | 100 , m_scriptCachedMetadataTotalSize(0) |
| 100 { | 101 { |
| 101 workerInspectorController()->registerModuleAgent(InspectorServiceWorkerCache
Agent::create(this)); | 102 workerInspectorController()->registerModuleAgent(InspectorCacheStorageAgent:
:create(this)); |
| 102 } | 103 } |
| 103 | 104 |
| 104 ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope() | 105 ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope() |
| 105 { | 106 { |
| 106 } | 107 } |
| 107 | 108 |
| 108 void ServiceWorkerGlobalScope::didEvaluateWorkerScript() | 109 void ServiceWorkerGlobalScope::didEvaluateWorkerScript() |
| 109 { | 110 { |
| 110 if (Platform* platform = Platform::current()) { | 111 if (Platform* platform = Platform::current()) { |
| 111 platform->histogramCustomCounts("ServiceWorker.ScriptCount", m_scriptCou
nt, 1, 1000, 50); | 112 platform->histogramCustomCounts("ServiceWorker.ScriptCount", m_scriptCou
nt, 1, 1000, 50); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 } | 235 } |
| 235 | 236 |
| 236 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta
dataSize) | 237 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta
dataSize) |
| 237 { | 238 { |
| 238 ++m_scriptCount; | 239 ++m_scriptCount; |
| 239 m_scriptTotalSize += scriptSize; | 240 m_scriptTotalSize += scriptSize; |
| 240 m_scriptCachedMetadataTotalSize += cachedMetadataSize; | 241 m_scriptCachedMetadataTotalSize += cachedMetadataSize; |
| 241 } | 242 } |
| 242 | 243 |
| 243 } // namespace blink | 244 } // namespace blink |
| OLD | NEW |