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

Side by Side Diff: third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.h

Issue 2254593002: [worklets] Introduce AnimationWorkletGlobalScope and ThreadedWorkletGlobalScope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove global listing as no console output. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MainThreadWorkletGlobalScope_h 5 #ifndef ThreadedWorkletGlobalScope_h
6 #define MainThreadWorkletGlobalScope_h 6 #define ThreadedWorkletGlobalScope_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/dom/ExecutionContext.h"
10 #include "core/frame/LocalFrameLifecycleObserver.h"
11 #include "core/workers/WorkletGlobalScope.h" 9 #include "core/workers/WorkletGlobalScope.h"
12 #include "core/workers/WorkletGlobalScopeProxy.h"
13 10
14 namespace blink { 11 namespace blink {
15 12
16 class ConsoleMessage; 13 class ConsoleMessageStorage;
17 class LocalFrame; 14 class WorkerInspectorController;
18 class ScriptSourceCode; 15 class WorkerThread;
19 16
20 class CORE_EXPORT MainThreadWorkletGlobalScope : public WorkletGlobalScope, publ ic WorkletGlobalScopeProxy, public LocalFrameLifecycleObserver { 17 class CORE_EXPORT ThreadedWorkletGlobalScope : public WorkletGlobalScope {
21 public: 18 public:
22 ~MainThreadWorkletGlobalScope() override; 19 ~ThreadedWorkletGlobalScope() override;
23 bool isMainThreadWorkletGlobalScope() const final { return true; } 20 void dispose() final;
24 21
25 // WorkletGlobalScopeProxy 22 // ExecutionContext
26 void evaluateScript(const ScriptSourceCode&) final; 23 bool isThreadedWorkletGlobalScope() const final { return true; }
27 void terminateWorkletGlobalScope() final; 24 bool isContextThread() const final;
28 25 void postTask(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask> , const String& taskNameForInstrumentation) final;
29 using LocalFrameLifecycleObserver::frame;
30 void addConsoleMessage(ConsoleMessage*) final; 26 void addConsoleMessage(ConsoleMessage*) final;
31 void exceptionThrown(ErrorEvent*) final; 27 void exceptionThrown(ErrorEvent*) final;
32 28
33 DEFINE_INLINE_VIRTUAL_TRACE() 29 WorkerThread* thread() const { return m_thread; }
34 {
35 WorkletGlobalScope::trace(visitor);
36 LocalFrameLifecycleObserver::trace(visitor);
37 }
38 30
39 protected: 31 protected:
40 MainThreadWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAge nt, PassRefPtr<SecurityOrigin>, v8::Isolate*); 32 ThreadedWorkletGlobalScope(const KURL&, const String& userAgent, PassRefPtr< SecurityOrigin>, v8::Isolate*, WorkerThread*);
33
34 private:
35 WorkerThread* m_thread;
41 }; 36 };
42 37
43 DEFINE_TYPE_CASTS(MainThreadWorkletGlobalScope, ExecutionContext, context, conte xt->isMainThreadWorkletGlobalScope(), context.isMainThreadWorkletGlobalScope()); 38 DEFINE_TYPE_CASTS(ThreadedWorkletGlobalScope, ExecutionContext, context, context ->isThreadedWorkletGlobalScope(), context.isThreadedWorkletGlobalScope());
44 39
45 } // namespace blink 40 } // namespace blink
46 41
47 #endif // MainThreadWorkletGlobalScope_h 42 #endif // ThreadedWorkletGlobalScope_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698