OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/workers/ThreadedWorkletMessagingProxy.h" | 5 #include "core/workers/ThreadedWorkletMessagingProxy.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptSourceCode.h" | 7 #include "bindings/core/v8/ScriptSourceCode.h" |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/dom/SecurityContext.h" | 9 #include "core/dom/SecurityContext.h" |
10 #include "core/frame/csp/ContentSecurityPolicy.h" | 10 #include "core/frame/csp/ContentSecurityPolicy.h" |
11 #include "core/origin_trials/OriginTrialContext.h" | 11 #include "core/origin_trials/OriginTrialContext.h" |
12 #include "core/workers/ThreadedWorkletObjectProxy.h" | 12 #include "core/workers/ThreadedWorkletObjectProxy.h" |
13 #include "core/workers/WorkerInspectorProxy.h" | 13 #include "core/workers/WorkerInspectorProxy.h" |
14 #include "core/workers/WorkerThreadStartupData.h" | 14 #include "core/workers/WorkerThreadStartupData.h" |
15 #include "core/workers/WorkletGlobalScope.h" | 15 #include "core/workers/WorkletGlobalScope.h" |
16 #include "platform/CrossThreadFunctional.h" | 16 #include "platform/CrossThreadFunctional.h" |
17 #include "platform/WebTaskRunner.h" | 17 #include "platform/WebTaskRunner.h" |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 ThreadedWorkletMessagingProxy::ThreadedWorkletMessagingProxy( | 21 ThreadedWorkletMessagingProxy::ThreadedWorkletMessagingProxy( |
22 ExecutionContext* executionContext) | 22 ExecutionContext* executionContext) |
23 : ThreadedMessagingProxyBase(executionContext), m_weakPtrFactory(this) { | 23 : ThreadedMessagingProxyBase(executionContext), m_weakPtrFactory(this) { |
24 m_workletObjectProxy = ThreadedWorkletObjectProxy::create( | 24 m_workletObjectProxy = |
25 m_weakPtrFactory.createWeakPtr(), getParentFrameTaskRunners()); | 25 ThreadedWorkletObjectProxy::create(m_weakPtrFactory.createWeakPtr()); |
26 } | 26 } |
27 | 27 |
28 void ThreadedWorkletMessagingProxy::initialize() { | 28 void ThreadedWorkletMessagingProxy::initialize() { |
29 DCHECK(isParentContextThread()); | 29 DCHECK(isParentContextThread()); |
30 if (askedToTerminate()) | 30 if (askedToTerminate()) |
31 return; | 31 return; |
32 | 32 |
33 Document* document = toDocument(getExecutionContext()); | 33 Document* document = toDocument(getExecutionContext()); |
34 SecurityOrigin* starterOrigin = document->getSecurityOrigin(); | 34 SecurityOrigin* starterOrigin = document->getSecurityOrigin(); |
35 KURL scriptURL = document->url(); | 35 KURL scriptURL = document->url(); |
(...skipping 28 matching lines...) Expand all Loading... |
64 crossThreadUnretained(m_workletObjectProxy.get()), | 64 crossThreadUnretained(m_workletObjectProxy.get()), |
65 scriptSourceCode.source(), scriptSourceCode.url(), | 65 scriptSourceCode.source(), scriptSourceCode.url(), |
66 crossThreadUnretained(workerThread()))); | 66 crossThreadUnretained(workerThread()))); |
67 } | 67 } |
68 | 68 |
69 void ThreadedWorkletMessagingProxy::terminateWorkletGlobalScope() { | 69 void ThreadedWorkletMessagingProxy::terminateWorkletGlobalScope() { |
70 terminateGlobalScope(); | 70 terminateGlobalScope(); |
71 } | 71 } |
72 | 72 |
73 } // namespace blink | 73 } // namespace blink |
OLD | NEW |