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 "modules/compositorworker/AnimationWorkletThread.h" | 5 #include "modules/compositorworker/AnimationWorkletThread.h" |
6 | 6 |
7 #include "core/workers/WorkerThreadStartupData.h" | 7 #include "core/workers/WorkerThreadStartupData.h" |
| 8 #include "modules/compositorworker/AnimationWorkletGlobalScope.h" |
8 #include "platform/TraceEvent.h" | 9 #include "platform/TraceEvent.h" |
| 10 #include "platform/weborigin/SecurityOrigin.h" |
9 #include "wtf/PtrUtil.h" | 11 #include "wtf/PtrUtil.h" |
10 | 12 |
11 namespace blink { | 13 namespace blink { |
12 | 14 |
13 std::unique_ptr<AnimationWorkletThread> AnimationWorkletThread::create(PassRefPt
r<WorkerLoaderProxy> workerLoaderProxy, WorkerReportingProxy& workerReportingPro
xy) | 15 std::unique_ptr<AnimationWorkletThread> AnimationWorkletThread::create(PassRefPt
r<WorkerLoaderProxy> workerLoaderProxy, WorkerReportingProxy& workerReportingPro
xy) |
14 { | 16 { |
15 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("animation-worklet"), "AnimationWorkl
etThread::create"); | 17 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("animation-worklet"), "AnimationWorkl
etThread::create"); |
16 DCHECK(isMainThread()); | 18 DCHECK(isMainThread()); |
17 return wrapUnique(new AnimationWorkletThread(workerLoaderProxy, workerReport
ingProxy)); | 19 return wrapUnique(new AnimationWorkletThread(workerLoaderProxy, workerReport
ingProxy)); |
18 } | 20 } |
19 | 21 |
20 AnimationWorkletThread::AnimationWorkletThread(PassRefPtr<WorkerLoaderProxy> wor
kerLoaderProxy, WorkerReportingProxy& workerReportingProxy) | 22 AnimationWorkletThread::AnimationWorkletThread(PassRefPtr<WorkerLoaderProxy> wor
kerLoaderProxy, WorkerReportingProxy& workerReportingProxy) |
21 : AbstractAnimationWorkletThread(workerLoaderProxy, workerReportingProxy) | 23 : AbstractAnimationWorkletThread(workerLoaderProxy, workerReportingProxy) |
22 { | 24 { |
23 } | 25 } |
24 | 26 |
25 AnimationWorkletThread::~AnimationWorkletThread() | 27 AnimationWorkletThread::~AnimationWorkletThread() |
26 { | 28 { |
27 } | 29 } |
28 | 30 |
29 WorkerOrWorkletGlobalScope* AnimationWorkletThread::createWorkerGlobalScope(std:
:unique_ptr<WorkerThreadStartupData> startupData) | 31 WorkerOrWorkletGlobalScope* AnimationWorkletThread::createWorkerGlobalScope(std:
:unique_ptr<WorkerThreadStartupData> startupData) |
30 { | 32 { |
31 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("animation-worklet"), "AnimationWorkl
etThread::createWorkerGlobalScope"); | 33 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("animation-worklet"), "AnimationWorkl
etThread::createWorkerGlobalScope"); |
32 // TODO(ikilpatrick): implement. | 34 |
33 return nullptr; | 35 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(startupData->
m_scriptURL); |
| 36 if (startupData->m_starterOriginPrivilegeData) |
| 37 securityOrigin->transferPrivilegesFrom(std::move(startupData->m_starterO
riginPrivilegeData)); |
| 38 |
| 39 // TODO(ikilpatrick): The AnimationWorkletGlobalScope will need to store a |
| 40 // WorkerClients object for using a CompositorProxyClient object. |
| 41 return AnimationWorkletGlobalScope::create(startupData->m_scriptURL, startup
Data->m_userAgent, securityOrigin.release(), this->isolate(), this); |
34 } | 42 } |
35 | 43 |
36 } // namespace blink | 44 } // namespace blink |
OLD | NEW |