Index: third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThread.cpp |
diff --git a/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThread.cpp b/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThread.cpp |
index 45c73b5158bd389075756fa5c3c9743116f35990..5f67f152da4ee02523b4a6bf53f09b47cc628cbe 100644 |
--- a/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThread.cpp |
+++ b/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThread.cpp |
@@ -5,7 +5,9 @@ |
#include "modules/compositorworker/AnimationWorkletThread.h" |
#include "core/workers/WorkerThreadStartupData.h" |
+#include "modules/compositorworker/AnimationWorkletGlobalScope.h" |
#include "platform/TraceEvent.h" |
+#include "platform/weborigin/SecurityOrigin.h" |
#include "wtf/PtrUtil.h" |
namespace blink { |
@@ -29,8 +31,14 @@ AnimationWorkletThread::~AnimationWorkletThread() |
WorkerOrWorkletGlobalScope* AnimationWorkletThread::createWorkerGlobalScope(std::unique_ptr<WorkerThreadStartupData> startupData) |
{ |
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("animation-worklet"), "AnimationWorkletThread::createWorkerGlobalScope"); |
- // TODO(ikilpatrick): implement. |
- return nullptr; |
+ |
+ RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(startupData->m_scriptURL); |
+ if (startupData->m_starterOriginPrivilegeData) |
+ securityOrigin->transferPrivilegesFrom(std::move(startupData->m_starterOriginPrivilegeData)); |
+ |
+ // TODO(ikilpatrick): The AnimationWorkletGlobalScope will need to store a |
+ // WorkerClients object for using a CompositorProxyClient object. |
+ return AnimationWorkletGlobalScope::create(startupData->m_scriptURL, startupData->m_userAgent, securityOrigin.release(), this->isolate(), this); |
} |
} // namespace blink |