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

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

Issue 1535943005: Initial implementation of bindings and basic classes for worklets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix memory leak. Created 4 years, 12 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "modules/worklet/WorkletGlobalScope.h"
7
8 #include "bindings/modules/v8/WorkletScriptController.h"
9
10 namespace blink {
11
12 // static
13 PassRefPtrWillBeRawPtr<WorkletGlobalScope> WorkletGlobalScope::create(const KURL & url, const String& userAgent, v8::Isolate* isolate)
14 {
15 return adoptRefWillBeNoop(new WorkletGlobalScope(url, userAgent, isolate));
16 }
17
18 WorkletGlobalScope::WorkletGlobalScope(const KURL& url, const String& userAgent, v8::Isolate* isolate)
19 : AbstractGlobalScope(url, userAgent)
20 , m_isolate(isolate)
21 , m_script(WorkletScriptController::create(this, m_isolate))
22 {
23 }
24
25 WorkletGlobalScope::~WorkletGlobalScope()
26 {
27 }
28
29 GlobalScopeScriptController* WorkletGlobalScope::script()
30 {
31 m_script->initializeContextIfNeeded();
32 return m_script.get();
33 }
34
35 v8::Local<v8::Object> WorkletGlobalScope::wrap(v8::Isolate*, v8::Local<v8::Objec t> creationContext)
36 {
37 // WorkletGlobalScope must never be wrapped with wrap method. The global
38 // object of ECMAScript environment is used as the wrapper.
39 RELEASE_ASSERT_NOT_REACHED();
40 return v8::Local<v8::Object>();
41 }
42
43 v8::Local<v8::Object> WorkletGlobalScope::associateWithWrapper(v8::Isolate*, con st WrapperTypeInfo*, v8::Local<v8::Object> wrapper)
44 {
45 RELEASE_ASSERT_NOT_REACHED(); // same as wrap method
46 return v8::Local<v8::Object>();
47 }
48
49 DEFINE_TRACE(WorkletGlobalScope)
50 {
51 AbstractGlobalScope::trace(visitor);
52 }
53
54 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698