Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.cpp

Issue 1684303002: Add a basic version of Worklet#import. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix non-oilpan build. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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, PassRefPtr<SecurityOrigin> securityOrigin, v8::I solate* isolate)
13 { 13 {
14 RefPtrWillBeRawPtr<WorkletGlobalScope> workletGlobalScope = adoptRefWillBeNo op(new WorkletGlobalScope(url, userAgent, isolate)); 14 RefPtrWillBeRawPtr<WorkletGlobalScope> workletGlobalScope = adoptRefWillBeNo op(new WorkletGlobalScope(url, userAgent, securityOrigin, isolate));
15 workletGlobalScope->script()->initializeContextIfNeeded(); 15 workletGlobalScope->script()->initializeContextIfNeeded();
16 return workletGlobalScope.release(); 16 return workletGlobalScope.release();
17 } 17 }
18 18
19 WorkletGlobalScope::WorkletGlobalScope(const KURL& url, const String& userAgent, v8::Isolate* isolate) 19 WorkletGlobalScope::WorkletGlobalScope(const KURL& url, const String& userAgent, PassRefPtr<SecurityOrigin> securityOrigin, v8::Isolate* isolate)
20 : m_script(WorkerOrWorkletScriptController::create(this, isolate)) 20 : m_url(url)
21 , m_userAgent(userAgent)
22 , m_script(WorkerOrWorkletScriptController::create(this, isolate))
21 { 23 {
24 setSecurityOrigin(securityOrigin);
22 } 25 }
23 26
24 WorkletGlobalScope::~WorkletGlobalScope() 27 WorkletGlobalScope::~WorkletGlobalScope()
25 { 28 {
26 } 29 }
27 30
28 v8::Local<v8::Object> WorkletGlobalScope::wrap(v8::Isolate*, v8::Local<v8::Objec t> creationContext) 31 v8::Local<v8::Object> WorkletGlobalScope::wrap(v8::Isolate*, v8::Local<v8::Objec t> creationContext)
29 { 32 {
30 // WorkletGlobalScope must never be wrapped with wrap method. The global 33 // WorkletGlobalScope must never be wrapped with wrap method. The global
31 // object of ECMAScript environment is used as the wrapper. 34 // object of ECMAScript environment is used as the wrapper.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 67 }
65 68
66 DEFINE_TRACE(WorkletGlobalScope) 69 DEFINE_TRACE(WorkletGlobalScope)
67 { 70 {
68 visitor->trace(m_script); 71 visitor->trace(m_script);
69 ExecutionContext::trace(visitor); 72 ExecutionContext::trace(visitor);
70 SecurityContext::trace(visitor); 73 SecurityContext::trace(visitor);
71 } 74 }
72 75
73 } // namespace blink 76 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698