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" | |
9 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "core/dom/ExecutionContext.h" | 9 #include "core/dom/ExecutionContext.h" |
11 #include "core/dom/ExecutionContextTask.h" | 10 #include "core/dom/ExecutionContextTask.h" |
12 #include "core/dom/SecurityContext.h" | 11 #include "core/dom/SecurityContext.h" |
13 #include "core/inspector/ConsoleMessage.h" | 12 #include "core/inspector/ConsoleMessage.h" |
14 #include "core/workers/MainThreadWorkletGlobalScope.h" | 13 #include "core/workers/MainThreadWorkletGlobalScope.h" |
15 #include "core/workers/WorkerOrWorkletGlobalScope.h" | 14 #include "core/workers/WorkerOrWorkletGlobalScope.h" |
16 #include "modules/ModulesExport.h" | 15 #include "modules/ModulesExport.h" |
17 #include "platform/heap/Handle.h" | 16 #include "platform/heap/Handle.h" |
18 | 17 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 50 |
52 DOMTimerCoordinator* timers() final { ASSERT_NOT_REACHED(); return nullptr;
} // WorkletGlobalScopes don't have timers. | 51 DOMTimerCoordinator* timers() final { ASSERT_NOT_REACHED(); return nullptr;
} // WorkletGlobalScopes don't have timers. |
53 void postTask(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>
) override | 52 void postTask(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>
) override |
54 { | 53 { |
55 // TODO(ikilpatrick): implement. | 54 // TODO(ikilpatrick): implement. |
56 ASSERT_NOT_REACHED(); | 55 ASSERT_NOT_REACHED(); |
57 } | 56 } |
58 | 57 |
59 void reportBlockedScriptExecutionToInspector(const String& directiveText) fi
nal; | 58 void reportBlockedScriptExecutionToInspector(const String& directiveText) fi
nal; |
60 void addConsoleMessage(ConsoleMessage*) final; | 59 void addConsoleMessage(ConsoleMessage*) final; |
61 void logExceptionToConsole(const String& errorMessage, int scriptId, const S
tring& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>)
final; | 60 void logExceptionToConsole(const String& errorMessage, PassOwnPtr<SourceLoca
tion>) final; |
62 | 61 |
63 DECLARE_VIRTUAL_TRACE(); | 62 DECLARE_VIRTUAL_TRACE(); |
64 | 63 |
65 protected: | 64 protected: |
66 // The url, userAgent and securityOrigin arguments are inherited from the | 65 // The url, userAgent and securityOrigin arguments are inherited from the |
67 // parent ExecutionContext for Worklets. | 66 // parent ExecutionContext for Worklets. |
68 WorkletGlobalScope(LocalFrame*, const KURL&, const String& userAgent, PassRe
fPtr<SecurityOrigin>, v8::Isolate*); | 67 WorkletGlobalScope(LocalFrame*, const KURL&, const String& userAgent, PassRe
fPtr<SecurityOrigin>, v8::Isolate*); |
69 | 68 |
70 private: | 69 private: |
71 const KURL& virtualURL() const final { return m_url; } | 70 const KURL& virtualURL() const final { return m_url; } |
72 KURL virtualCompleteURL(const String&) const final; | 71 KURL virtualCompleteURL(const String&) const final; |
73 | 72 |
74 EventTarget* errorEventTarget() final { return nullptr; } | 73 EventTarget* errorEventTarget() final { return nullptr; } |
75 void didUpdateSecurityOrigin() final { } | 74 void didUpdateSecurityOrigin() final { } |
76 | 75 |
77 KURL m_url; | 76 KURL m_url; |
78 String m_userAgent; | 77 String m_userAgent; |
79 Member<WorkerOrWorkletScriptController> m_scriptController; | 78 Member<WorkerOrWorkletScriptController> m_scriptController; |
80 }; | 79 }; |
81 | 80 |
82 DEFINE_TYPE_CASTS(WorkletGlobalScope, ExecutionContext, context, context->isWork
letGlobalScope(), context.isWorkletGlobalScope()); | 81 DEFINE_TYPE_CASTS(WorkletGlobalScope, ExecutionContext, context, context->isWork
letGlobalScope(), context.isWorkletGlobalScope()); |
83 | 82 |
84 } // namespace blink | 83 } // namespace blink |
85 | 84 |
86 #endif // WorkletGlobalScope_h | 85 #endif // WorkletGlobalScope_h |
OLD | NEW |