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

Unified Diff: third_party/WebKit/Source/modules/worklet/WorkletMessagingProxy.cpp

Issue 1510603005: [Do not submit] Worklet implementation. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A basic CompositorWorklet implementation. Created 5 years 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/worklet/WorkletMessagingProxy.cpp
diff --git a/third_party/WebKit/Source/modules/worklet/WorkletMessagingProxy.cpp b/third_party/WebKit/Source/modules/worklet/WorkletMessagingProxy.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f1d5c5cedf50ae0610776afa3cd3b3355a3b81e1
--- /dev/null
+++ b/third_party/WebKit/Source/modules/worklet/WorkletMessagingProxy.cpp
@@ -0,0 +1,48 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "modules/worklet/WorkletMessagingProxy.h"
+
+#include "core/dom/ExecutionContext.h"
+#include "modules/worklet/CompositorWorkletThread.h"
+#include "modules/worklet/Worklet.h"
+
+namespace blink {
+
+WorkletMessagingProxy* WorkletMessagingProxy::create(Worklet* worklet)
+{
+ return new WorkletMessagingProxy(worklet);
+}
+
+WorkletMessagingProxy::WorkletMessagingProxy(Worklet* worklet)
+ : m_executionContext(worklet->executionContext())
+ , m_worklet(worklet)
+{
+ ASSERT(m_worklet);
+ ASSERT(m_executionContext->isDocument() && isMainThread());
+ // TODO set proxy here.
+}
+
+WorkletMessagingProxy::~WorkletMessagingProxy()
+{
+ ASSERT(!m_worklet);
+ ASSERT(m_executionContext->isDocument() && isMainThread());
+}
+
+void WorkletMessagingProxy::loadScript(const String& sourceCode)
+{
+ ASSERT(isMainThread());
+
+ if (!m_thread) {
+ m_thread = CompositorWorkletThread::create();
+ m_thread->initialize();
+ }
+
+ m_thread->loadScript(sourceCode);
+}
+
+// TODO terminate this.
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/worklet/WorkletMessagingProxy.h ('k') | third_party/WebKit/Source/platform/Logging.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698