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 #include "modules/worklet/WorkletGlobalScope.h" | 5 #include "modules/worklet/WorkletGlobalScope.h" |
6 | 6 |
7 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" | 7 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" |
8 #include "core/frame/FrameConsole.h" | 8 #include "core/frame/FrameConsole.h" |
9 #include "core/inspector/InspectorInstrumentation.h" | 9 #include "core/inspector/InspectorInstrumentation.h" |
10 #include "modules/worklet/WorkletConsole.h" | 10 #include "modules/worklet/WorkletConsole.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 // static | 14 // static |
15 PassRefPtrWillBeRawPtr<WorkletGlobalScope> WorkletGlobalScope::create(LocalFrame
* frame, const KURL& url, const String& userAgent, PassRefPtr<SecurityOrigin> se
curityOrigin, v8::Isolate* isolate) | 15 PassRefPtrWillBeRawPtr<WorkletGlobalScope> WorkletGlobalScope::create(LocalFrame
* frame, const KURL& url, const String& userAgent, PassRefPtr<SecurityOrigin> se
curityOrigin, v8::Isolate* isolate) |
16 { | 16 { |
17 RefPtrWillBeRawPtr<WorkletGlobalScope> workletGlobalScope = adoptRefWillBeNo
op(new WorkletGlobalScope(frame, url, userAgent, securityOrigin, isolate)); | 17 RefPtrWillBeRawPtr<WorkletGlobalScope> workletGlobalScope = adoptRefWillBeNo
op(new WorkletGlobalScope(frame, url, userAgent, securityOrigin, isolate)); |
18 workletGlobalScope->scriptController()->initializeContextIfNeeded(); | 18 workletGlobalScope->scriptController()->initializeContextIfNeeded(); |
19 return workletGlobalScope.release(); | 19 return workletGlobalScope.release(); |
20 } | 20 } |
21 | 21 |
22 WorkletGlobalScope::WorkletGlobalScope(LocalFrame* frame, const KURL& url, const
String& userAgent, PassRefPtr<SecurityOrigin> securityOrigin, v8::Isolate* isol
ate) | 22 WorkletGlobalScope::WorkletGlobalScope(LocalFrame* frame, const KURL& url, const
String& userAgent, PassRefPtr<SecurityOrigin> securityOrigin, v8::Isolate* isol
ate) |
23 : LocalFrameLifecycleObserver(frame) | 23 : MainThreadWorkletGlobalScope(frame) |
24 , m_url(url) | 24 , m_url(url) |
25 , m_userAgent(userAgent) | 25 , m_userAgent(userAgent) |
26 , m_scriptController(WorkerOrWorkletScriptController::create(this, isolate)) | 26 , m_scriptController(WorkerOrWorkletScriptController::create(this, isolate)) |
27 { | 27 { |
28 setSecurityOrigin(securityOrigin); | 28 setSecurityOrigin(securityOrigin); |
29 } | 29 } |
30 | 30 |
31 WorkletGlobalScope::~WorkletGlobalScope() | 31 WorkletGlobalScope::~WorkletGlobalScope() |
32 { | 32 { |
33 } | 33 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // Always use UTF-8 in Worklets. | 98 // Always use UTF-8 in Worklets. |
99 return KURL(m_url, url); | 99 return KURL(m_url, url); |
100 } | 100 } |
101 | 101 |
102 DEFINE_TRACE(WorkletGlobalScope) | 102 DEFINE_TRACE(WorkletGlobalScope) |
103 { | 103 { |
104 visitor->trace(m_scriptController); | 104 visitor->trace(m_scriptController); |
105 visitor->trace(m_console); | 105 visitor->trace(m_console); |
106 ExecutionContext::trace(visitor); | 106 ExecutionContext::trace(visitor); |
107 SecurityContext::trace(visitor); | 107 SecurityContext::trace(visitor); |
108 LocalFrameLifecycleObserver::trace(visitor); | 108 MainThreadWorkletGlobalScope::trace(visitor); |
109 } | 109 } |
110 | 110 |
111 } // namespace blink | 111 } // namespace blink |
OLD | NEW |