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 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
11 // static | 11 // static |
12 PassRefPtrWillBeRawPtr<WorkletGlobalScope> WorkletGlobalScope::create(const KURL & url, const String& userAgent, v8::Isolate* isolate) | 12 PassRefPtrWillBeRawPtr<WorkletGlobalScope> WorkletGlobalScope::create(const KURL & url, const String& userAgent, v8::Isolate* isolate) |
13 { | 13 { |
14 return adoptRefWillBeNoop(new WorkletGlobalScope(url, userAgent, isolate)); | 14 RefPtrWillBeRawPtr<WorkletGlobalScope> workletGlobalScope = adoptRefWillBeNo op(new WorkletGlobalScope(url, userAgent, isolate)); |
15 workletGlobalScope->script()->initializeContextIfNeeded(); | |
ikilpatrick
2016/01/14 19:31:57
This was added here as within:
V8DOMWrapper::assoc
| |
16 return workletGlobalScope.release(); | |
15 } | 17 } |
16 | 18 |
17 WorkletGlobalScope::WorkletGlobalScope(const KURL& url, const String& userAgent, v8::Isolate* isolate) | 19 WorkletGlobalScope::WorkletGlobalScope(const KURL& url, const String& userAgent, v8::Isolate* isolate) |
18 : m_script(WorkerOrWorkletScriptController::create(this, isolate)) | 20 : m_script(WorkerOrWorkletScriptController::create(this, isolate)) |
19 { | 21 { |
20 m_script->initializeContextIfNeeded(); | |
21 } | 22 } |
22 | 23 |
23 WorkletGlobalScope::~WorkletGlobalScope() | 24 WorkletGlobalScope::~WorkletGlobalScope() |
24 { | 25 { |
25 } | 26 } |
26 | 27 |
27 v8::Local<v8::Object> WorkletGlobalScope::wrap(v8::Isolate*, v8::Local<v8::Objec t> creationContext) | 28 v8::Local<v8::Object> WorkletGlobalScope::wrap(v8::Isolate*, v8::Local<v8::Objec t> creationContext) |
28 { | 29 { |
29 // WorkletGlobalScope must never be wrapped with wrap method. The global | 30 // WorkletGlobalScope must never be wrapped with wrap method. The global |
30 // object of ECMAScript environment is used as the wrapper. | 31 // object of ECMAScript environment is used as the wrapper. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 } | 64 } |
64 | 65 |
65 DEFINE_TRACE(WorkletGlobalScope) | 66 DEFINE_TRACE(WorkletGlobalScope) |
66 { | 67 { |
67 visitor->trace(m_script); | 68 visitor->trace(m_script); |
68 ExecutionContext::trace(visitor); | 69 ExecutionContext::trace(visitor); |
69 SecurityContext::trace(visitor); | 70 SecurityContext::trace(visitor); |
70 } | 71 } |
71 | 72 |
72 } // namespace blink | 73 } // namespace blink |
OLD | NEW |