OLD | NEW |
(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 #ifndef CompositorWorkletThread_h |
| 6 #define CompositorWorkletThread_h |
| 7 |
| 8 #include "platform/WebThreadSupportingGC.h" |
| 9 #include "platform/heap/Handle.h" |
| 10 #include "wtf/text/WTFString.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class WorkletGlobalScope; |
| 15 |
| 16 class CompositorWorkletThread : public RefCounted<CompositorWorkletThread> { |
| 17 public: |
| 18 static PassRefPtr<CompositorWorkletThread> create(); |
| 19 virtual ~CompositorWorkletThread(); |
| 20 |
| 21 void initialize(); |
| 22 void loadScript(const String& sourceCode); |
| 23 |
| 24 v8::Isolate* isolate() const { return m_isolate; } |
| 25 |
| 26 private: |
| 27 CompositorWorkletThread(); |
| 28 |
| 29 WebThreadSupportingGC& backingThread(); |
| 30 void initializeInternal(); |
| 31 void loadScriptInternal(const String& sourceCode); |
| 32 |
| 33 OwnPtr<WebThread::TaskObserver> m_microtaskRunner; |
| 34 |
| 35 bool m_initialized = false; |
| 36 Mutex m_threadStateMutex; |
| 37 |
| 38 RefPtrWillBePersistent<WorkletGlobalScope> m_workletGlobalScope; |
| 39 v8::Isolate* m_isolate; |
| 40 }; |
| 41 |
| 42 } // namespace blink |
| 43 |
| 44 #endif // CompositorWorkletThread_h |
OLD | NEW |