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