Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(652)

Unified Diff: third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThread.cpp

Issue 2254593002: [worklets] Introduce AnimationWorkletGlobalScope and ThreadedWorkletGlobalScope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add super call to WorkletGlobalScope::dispose() Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698