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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "modules/worklet/WorkletMessagingProxy.h"
7
8 #include "core/dom/ExecutionContext.h"
9 #include "modules/worklet/CompositorWorkletThread.h"
10 #include "modules/worklet/Worklet.h"
11
12 namespace blink {
13
14 WorkletMessagingProxy* WorkletMessagingProxy::create(Worklet* worklet)
15 {
16 return new WorkletMessagingProxy(worklet);
17 }
18
19 WorkletMessagingProxy::WorkletMessagingProxy(Worklet* worklet)
20 : m_executionContext(worklet->executionContext())
21 , m_worklet(worklet)
22 {
23 ASSERT(m_worklet);
24 ASSERT(m_executionContext->isDocument() && isMainThread());
25 // TODO set proxy here.
26 }
27
28 WorkletMessagingProxy::~WorkletMessagingProxy()
29 {
30 ASSERT(!m_worklet);
31 ASSERT(m_executionContext->isDocument() && isMainThread());
32 }
33
34 void WorkletMessagingProxy::loadScript(const String& sourceCode)
35 {
36 ASSERT(isMainThread());
37
38 if (!m_thread) {
39 m_thread = CompositorWorkletThread::create();
40 m_thread->initialize();
41 }
42
43 m_thread->loadScript(sourceCode);
44 }
45
46 // TODO terminate this.
47
48 } // namespace blink
OLDNEW
« 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