| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/compositorworker/CompositorWorkerGlobalScope.h" | 6 #include "modules/compositorworker/CompositorWorkerGlobalScope.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/SerializedScriptValue.h" | 8 #include "bindings/core/v8/SerializedScriptValue.h" |
| 9 #include "core/workers/WorkerObjectProxy.h" | 9 #include "core/workers/WorkerObjectProxy.h" |
| 10 #include "core/workers/WorkerThreadStartupData.h" | 10 #include "core/workers/WorkerThreadStartupData.h" |
| 11 #include "modules/EventTargetModules.h" | 11 #include "modules/EventTargetModules.h" |
| 12 #include "modules/compositorworker/CompositorWorkerThread.h" | 12 #include "modules/compositorworker/CompositorWorkerThread.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 PassRefPtrWillBeRawPtr<CompositorWorkerGlobalScope> CompositorWorkerGlobalScope:
:create(CompositorWorkerThread* thread, PassOwnPtrWillBeRawPtr<WorkerThreadStart
upData> startupData, double timeOrigin) | 16 PassRefPtrWillBeRawPtr<CompositorWorkerGlobalScope> CompositorWorkerGlobalScope:
:create(CompositorWorkerThread* thread, PassOwnPtr<WorkerThreadStartupData> star
tupData, double timeOrigin) |
| 17 { | 17 { |
| 18 // Note: startupData is finalized on return. After the relevant parts has be
en |
| 19 // passed along to the created 'context'. |
| 18 RefPtrWillBeRawPtr<CompositorWorkerGlobalScope> context = adoptRefWillBeNoop
(new CompositorWorkerGlobalScope(startupData->m_scriptURL, startupData->m_userAg
ent, thread, timeOrigin, startupData->m_starterOrigin, startupData->m_workerClie
nts.release())); | 20 RefPtrWillBeRawPtr<CompositorWorkerGlobalScope> context = adoptRefWillBeNoop
(new CompositorWorkerGlobalScope(startupData->m_scriptURL, startupData->m_userAg
ent, thread, timeOrigin, startupData->m_starterOrigin, startupData->m_workerClie
nts.release())); |
| 19 context->applyContentSecurityPolicyFromString(startupData->m_contentSecurity
Policy, startupData->m_contentSecurityPolicyType); | 21 context->applyContentSecurityPolicyFromString(startupData->m_contentSecurity
Policy, startupData->m_contentSecurityPolicyType); |
| 20 return context.release(); | 22 return context.release(); |
| 21 } | 23 } |
| 22 | 24 |
| 23 CompositorWorkerGlobalScope::CompositorWorkerGlobalScope(const KURL& url, const
String& userAgent, CompositorWorkerThread* thread, double timeOrigin, const Secu
rityOrigin* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) | 25 CompositorWorkerGlobalScope::CompositorWorkerGlobalScope(const KURL& url, const
String& userAgent, CompositorWorkerThread* thread, double timeOrigin, const Secu
rityOrigin* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) |
| 24 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, starterOrigin, worke
rClients) | 26 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, starterOrigin, worke
rClients) |
| 25 { | 27 { |
| 26 } | 28 } |
| 27 | 29 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 42 return; | 44 return; |
| 43 thread()->workerObjectProxy().postMessageToWorkerObject(message, channels.re
lease()); | 45 thread()->workerObjectProxy().postMessageToWorkerObject(message, channels.re
lease()); |
| 44 } | 46 } |
| 45 | 47 |
| 46 CompositorWorkerThread* CompositorWorkerGlobalScope::thread() const | 48 CompositorWorkerThread* CompositorWorkerGlobalScope::thread() const |
| 47 { | 49 { |
| 48 return static_cast<CompositorWorkerThread*>(WorkerGlobalScope::thread()); | 50 return static_cast<CompositorWorkerThread*>(WorkerGlobalScope::thread()); |
| 49 } | 51 } |
| 50 | 52 |
| 51 } // namespace blink | 53 } // namespace blink |
| OLD | NEW |