OLD | NEW |
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 MainThreadWorkletGlobalScope_h |
6 #define MainThreadWorkletGlobalScope_h | 6 #define MainThreadWorkletGlobalScope_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/dom/ExecutionContext.h" | 9 #include "core/dom/ExecutionContext.h" |
10 #include "core/frame/LocalFrameLifecycleObserver.h" | 10 #include "core/frame/LocalFrameLifecycleObserver.h" |
11 #include "core/workers/WorkletGlobalScope.h" | 11 #include "core/workers/WorkletGlobalScope.h" |
12 #include "core/workers/WorkletGlobalScopeProxy.h" | 12 #include "core/workers/WorkletGlobalScopeProxy.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class ConsoleMessage; | 16 class ConsoleMessage; |
17 class LocalFrame; | 17 class LocalFrame; |
18 | 18 |
19 class CORE_EXPORT MainThreadWorkletGlobalScope : public WorkletGlobalScope, publ
ic WorkletGlobalScopeProxy, public LocalFrameLifecycleObserver { | 19 class CORE_EXPORT MainThreadWorkletGlobalScope : public WorkletGlobalScope, publ
ic WorkletGlobalScopeProxy, public LocalFrameLifecycleObserver { |
20 public: | 20 public: |
21 ~MainThreadWorkletGlobalScope() override; | 21 ~MainThreadWorkletGlobalScope() override; |
22 bool isMainThreadWorkletGlobalScope() const final { return true; } | 22 bool isMainThreadWorkletGlobalScope() const final { return true; } |
23 | 23 |
24 // WorkletGlobalScopeProxy | 24 // WorkletGlobalScopeProxy |
25 void evaluateScript(const String& source, const KURL& scriptURL) final; | 25 void evaluateScript(const String& source, const KURL& scriptURL) final; |
26 void terminateWorkletGlobalScope() final; | 26 void terminateWorkletGlobalScope() final; |
27 | 27 |
| 28 // WorkerOrWorkletGlobalScope |
| 29 bool isClosing() const final { return false; } |
| 30 |
28 using LocalFrameLifecycleObserver::frame; | 31 using LocalFrameLifecycleObserver::frame; |
29 void addConsoleMessage(ConsoleMessage*) final; | 32 void addConsoleMessage(ConsoleMessage*) final; |
30 void exceptionThrown(const String& errorMessage, std::unique_ptr<SourceLocat
ion>) final; | 33 void exceptionThrown(const String& errorMessage, std::unique_ptr<SourceLocat
ion>) final; |
31 | 34 |
32 DEFINE_INLINE_VIRTUAL_TRACE() | 35 DEFINE_INLINE_VIRTUAL_TRACE() |
33 { | 36 { |
34 WorkletGlobalScope::trace(visitor); | 37 WorkletGlobalScope::trace(visitor); |
35 LocalFrameLifecycleObserver::trace(visitor); | 38 LocalFrameLifecycleObserver::trace(visitor); |
36 } | 39 } |
37 | 40 |
38 protected: | 41 protected: |
39 MainThreadWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAge
nt, PassRefPtr<SecurityOrigin>, v8::Isolate*); | 42 MainThreadWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAge
nt, PassRefPtr<SecurityOrigin>, v8::Isolate*); |
40 }; | 43 }; |
41 | 44 |
42 DEFINE_TYPE_CASTS(MainThreadWorkletGlobalScope, ExecutionContext, context, conte
xt->isMainThreadWorkletGlobalScope(), context.isMainThreadWorkletGlobalScope()); | 45 DEFINE_TYPE_CASTS(MainThreadWorkletGlobalScope, ExecutionContext, context, conte
xt->isMainThreadWorkletGlobalScope(), context.isMainThreadWorkletGlobalScope()); |
43 | 46 |
44 } // namespace blink | 47 } // namespace blink |
45 | 48 |
46 #endif // MainThreadWorkletGlobalScope_h | 49 #endif // MainThreadWorkletGlobalScope_h |
OLD | NEW |