Index: third_party/WebKit/Source/modules/worklet/CompositorWorkletThread.h |
diff --git a/third_party/WebKit/Source/modules/worklet/CompositorWorkletThread.h b/third_party/WebKit/Source/modules/worklet/CompositorWorkletThread.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0d3403d4b3c0d4d2fdf7a2a30b1f016a331af874 |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/worklet/CompositorWorkletThread.h |
@@ -0,0 +1,44 @@ |
+// 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. |
+ |
+#ifndef CompositorWorkletThread_h |
+#define CompositorWorkletThread_h |
+ |
+#include "platform/WebThreadSupportingGC.h" |
+#include "platform/heap/Handle.h" |
+#include "wtf/text/WTFString.h" |
+ |
+namespace blink { |
+ |
+class WorkletGlobalScope; |
+ |
+class CompositorWorkletThread : public RefCounted<CompositorWorkletThread> { |
+public: |
+ static PassRefPtr<CompositorWorkletThread> create(); |
+ virtual ~CompositorWorkletThread(); |
+ |
+ void initialize(); |
+ void loadScript(const String& sourceCode); |
+ |
+ v8::Isolate* isolate() const { return m_isolate; } |
+ |
+private: |
+ CompositorWorkletThread(); |
+ |
+ WebThreadSupportingGC& backingThread(); |
+ void initializeInternal(); |
+ void loadScriptInternal(const String& sourceCode); |
+ |
+ OwnPtr<WebThread::TaskObserver> m_microtaskRunner; |
+ |
+ bool m_initialized = false; |
+ Mutex m_threadStateMutex; |
+ |
+ RefPtrWillBePersistent<WorkletGlobalScope> m_workletGlobalScope; |
+ v8::Isolate* m_isolate; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // CompositorWorkletThread_h |