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