| 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 "bindings/core/v8/ScriptPromiseResolver.h" | 36 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 37 #include "bindings/core/v8/ScriptState.h" | 37 #include "bindings/core/v8/ScriptState.h" |
| 38 #include "bindings/core/v8/V8ThrowException.h" | 38 #include "bindings/core/v8/V8ThrowException.h" |
| 39 #include "core/dom/ExceptionCode.h" | 39 #include "core/dom/ExceptionCode.h" |
| 40 #include "core/events/Event.h" | 40 #include "core/events/Event.h" |
| 41 #include "core/fetch/MemoryCache.h" | 41 #include "core/fetch/MemoryCache.h" |
| 42 #include "core/fetch/ResourceLoaderOptions.h" | 42 #include "core/fetch/ResourceLoaderOptions.h" |
| 43 #include "core/inspector/ConsoleMessage.h" | 43 #include "core/inspector/ConsoleMessage.h" |
| 44 #include "core/inspector/WorkerInspectorController.h" | 44 #include "core/inspector/WorkerInspectorController.h" |
| 45 #include "core/loader/ThreadableLoader.h" | 45 #include "core/loader/ThreadableLoader.h" |
| 46 #include "core/origin_trials/OriginTrialContext.h" |
| 46 #include "core/workers/WorkerClients.h" | 47 #include "core/workers/WorkerClients.h" |
| 47 #include "core/workers/WorkerThreadStartupData.h" | 48 #include "core/workers/WorkerThreadStartupData.h" |
| 48 #include "modules/EventTargetModules.h" | 49 #include "modules/EventTargetModules.h" |
| 49 #include "modules/cachestorage/CacheStorage.h" | 50 #include "modules/cachestorage/CacheStorage.h" |
| 50 #include "modules/cachestorage/InspectorCacheStorageAgent.h" | 51 #include "modules/cachestorage/InspectorCacheStorageAgent.h" |
| 51 #include "modules/fetch/GlobalFetch.h" | 52 #include "modules/fetch/GlobalFetch.h" |
| 52 #include "modules/serviceworkers/ServiceWorkerClients.h" | 53 #include "modules/serviceworkers/ServiceWorkerClients.h" |
| 53 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" | 54 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" |
| 54 #include "modules/serviceworkers/ServiceWorkerRegistration.h" | 55 #include "modules/serviceworkers/ServiceWorkerRegistration.h" |
| 55 #include "modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h" | 56 #include "modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 66 | 67 |
| 67 ServiceWorkerGlobalScope* ServiceWorkerGlobalScope::create(ServiceWorkerThread*
thread, PassOwnPtr<WorkerThreadStartupData> startupData) | 68 ServiceWorkerGlobalScope* ServiceWorkerGlobalScope::create(ServiceWorkerThread*
thread, PassOwnPtr<WorkerThreadStartupData> startupData) |
| 68 { | 69 { |
| 69 // Note: startupData is finalized on return. After the relevant parts has be
en | 70 // Note: startupData is finalized on return. After the relevant parts has be
en |
| 70 // passed along to the created 'context'. | 71 // passed along to the created 'context'. |
| 71 ServiceWorkerGlobalScope* context = new ServiceWorkerGlobalScope(startupData
->m_scriptURL, startupData->m_userAgent, thread, monotonicallyIncreasingTime(),
startupData->m_starterOriginPrivilegeData.release(), startupData->m_workerClient
s.release()); | 72 ServiceWorkerGlobalScope* context = new ServiceWorkerGlobalScope(startupData
->m_scriptURL, startupData->m_userAgent, thread, monotonicallyIncreasingTime(),
startupData->m_starterOriginPrivilegeData.release(), startupData->m_workerClient
s.release()); |
| 72 | 73 |
| 73 context->setV8CacheOptions(startupData->m_v8CacheOptions); | 74 context->setV8CacheOptions(startupData->m_v8CacheOptions); |
| 74 context->applyContentSecurityPolicyFromVector(*startupData->m_contentSecurit
yPolicyHeaders); | 75 context->applyContentSecurityPolicyFromVector(*startupData->m_contentSecurit
yPolicyHeaders); |
| 75 context->setAddressSpace(startupData->m_addressSpace); | 76 context->setAddressSpace(startupData->m_addressSpace); |
| 77 OriginTrialContext::addTokens(context, startupData->m_originTrialTokens.get(
)); |
| 76 | 78 |
| 77 return context; | 79 return context; |
| 78 } | 80 } |
| 79 | 81 |
| 80 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String
& userAgent, ServiceWorkerThread* thread, double timeOrigin, PassOwnPtr<Security
Origin::PrivilegeData> starterOriginPrivilegeData, WorkerClients* workerClients) | 82 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String
& userAgent, ServiceWorkerThread* thread, double timeOrigin, PassOwnPtr<Security
Origin::PrivilegeData> starterOriginPrivilegeData, WorkerClients* workerClients) |
| 81 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, std::move(starterOri
ginPrivilegeData), workerClients) | 83 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, std::move(starterOri
ginPrivilegeData), workerClients) |
| 82 , m_didEvaluateScript(false) | 84 , m_didEvaluateScript(false) |
| 83 , m_hadErrorInTopLevelEventHandler(false) | 85 , m_hadErrorInTopLevelEventHandler(false) |
| 84 , m_eventNestingLevel(0) | 86 , m_eventNestingLevel(0) |
| 85 , m_scriptCount(0) | 87 , m_scriptCount(0) |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 223 } |
| 222 | 224 |
| 223 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta
dataSize) | 225 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta
dataSize) |
| 224 { | 226 { |
| 225 ++m_scriptCount; | 227 ++m_scriptCount; |
| 226 m_scriptTotalSize += scriptSize; | 228 m_scriptTotalSize += scriptSize; |
| 227 m_scriptCachedMetadataTotalSize += cachedMetadataSize; | 229 m_scriptCachedMetadataTotalSize += cachedMetadataSize; |
| 228 } | 230 } |
| 229 | 231 |
| 230 } // namespace blink | 232 } // namespace blink |
| OLD | NEW |