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 WorkletGlobalScope_h | 5 #ifndef WorkletGlobalScope_h |
6 #define WorkletGlobalScope_h | 6 #define WorkletGlobalScope_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptCallStack.h" | 8 #include "bindings/core/v8/ScriptCallStack.h" |
9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "core/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // parent ExecutionContext for Worklets. | 35 // parent ExecutionContext for Worklets. |
36 static PassRefPtrWillBeRawPtr<WorkletGlobalScope> create(LocalFrame*, const
KURL&, const String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*); | 36 static PassRefPtrWillBeRawPtr<WorkletGlobalScope> create(LocalFrame*, const
KURL&, const String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*); |
37 ~WorkletGlobalScope() override; | 37 ~WorkletGlobalScope() override; |
38 | 38 |
39 bool isWorkletGlobalScope() const final { return true; } | 39 bool isWorkletGlobalScope() const final { return true; } |
40 | 40 |
41 // WorkletGlobalScope | 41 // WorkletGlobalScope |
42 WorkletConsole* console(); | 42 WorkletConsole* console(); |
43 | 43 |
44 // WorkerOrWorkletGlobalScope | 44 // WorkerOrWorkletGlobalScope |
45 ScriptWrappable* scriptWrappable() const final { return const_cast<WorkletGl
obalScope*>(this); } | 45 ScriptWrappable* getScriptWrappable() const final { return const_cast<Workle
tGlobalScope*>(this); } |
46 WorkerOrWorkletScriptController* scriptController() final { return m_scriptC
ontroller.get(); } | 46 WorkerOrWorkletScriptController* scriptController() final { return m_scriptC
ontroller.get(); } |
47 | 47 |
48 // ScriptWrappable | 48 // ScriptWrappable |
49 v8::Local<v8::Object> wrap(v8::Isolate*, v8::Local<v8::Object> creationConte
xt) final; | 49 v8::Local<v8::Object> wrap(v8::Isolate*, v8::Local<v8::Object> creationConte
xt) final; |
50 v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const WrapperTypeIn
fo*, v8::Local<v8::Object> wrapper) final; | 50 v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const WrapperTypeIn
fo*, v8::Local<v8::Object> wrapper) final; |
51 | 51 |
52 // ExecutionContext | 52 // ExecutionContext |
53 void disableEval(const String& errorMessage) final; | 53 void disableEval(const String& errorMessage) final; |
54 String userAgent() const final { return m_userAgent; } | 54 String userAgent() const final { return m_userAgent; } |
55 SecurityContext& securityContext() final { return *this; } | 55 SecurityContext& securityContext() final { return *this; } |
56 EventQueue* eventQueue() const final { ASSERT_NOT_REACHED(); return nullptr;
} // WorkletGlobalScopes don't have an event queue. | 56 EventQueue* getEventQueue() const final { ASSERT_NOT_REACHED(); return nullp
tr; } // WorkletGlobalScopes don't have an event queue. |
57 bool isSecureContext(String& errorMessage, const SecureContextCheck = Standa
rdSecureContextCheck) const final; | 57 bool isSecureContext(String& errorMessage, const SecureContextCheck = Standa
rdSecureContextCheck) const final; |
58 | 58 |
59 using SecurityContext::securityOrigin; | 59 using SecurityContext::getSecurityOrigin; |
60 using SecurityContext::contentSecurityPolicy; | 60 using SecurityContext::contentSecurityPolicy; |
61 | 61 |
62 DOMTimerCoordinator* timers() final { ASSERT_NOT_REACHED(); return nullptr;
} // WorkletGlobalScopes don't have timers. | 62 DOMTimerCoordinator* timers() final { ASSERT_NOT_REACHED(); return nullptr;
} // WorkletGlobalScopes don't have timers. |
63 void postTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTask>) ove
rride | 63 void postTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTask>) ove
rride |
64 { | 64 { |
65 // TODO(ikilpatrick): implement. | 65 // TODO(ikilpatrick): implement. |
66 ASSERT_NOT_REACHED(); | 66 ASSERT_NOT_REACHED(); |
67 } | 67 } |
68 | 68 |
69 void reportBlockedScriptExecutionToInspector(const String& directiveText) fi
nal; | 69 void reportBlockedScriptExecutionToInspector(const String& directiveText) fi
nal; |
(...skipping 21 matching lines...) Expand all Loading... |
91 KURL m_url; | 91 KURL m_url; |
92 String m_userAgent; | 92 String m_userAgent; |
93 OwnPtrWillBeMember<WorkerOrWorkletScriptController> m_scriptController; | 93 OwnPtrWillBeMember<WorkerOrWorkletScriptController> m_scriptController; |
94 }; | 94 }; |
95 | 95 |
96 DEFINE_TYPE_CASTS(WorkletGlobalScope, ExecutionContext, context, context->isWork
letGlobalScope(), context.isWorkletGlobalScope()); | 96 DEFINE_TYPE_CASTS(WorkletGlobalScope, ExecutionContext, context, context->isWork
letGlobalScope(), context.isWorkletGlobalScope()); |
97 | 97 |
98 } // namespace blink | 98 } // namespace blink |
99 | 99 |
100 #endif // WorkletGlobalScope_h | 100 #endif // WorkletGlobalScope_h |
OLD | NEW |