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

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

Issue 1818223002: Introduce PaintWorkletGlobalScope, rename renderWorklet attribute to paintWorklet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix interface listing order. Created 4 years, 9 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 2016 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 "modules/worklet/DOMWindowWorklet.h"
6
7 #include "core/frame/LocalDOMWindow.h"
8 #include "core/frame/LocalFrame.h"
9 #include "modules/worklet/Worklet.h"
10
11 namespace blink {
12
13 DOMWindowWorklet::DOMWindowWorklet(LocalDOMWindow& window)
14 : DOMWindowProperty(window.frame())
15 {
16 }
17
18 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowWorklet);
19
20 const char* DOMWindowWorklet::supplementName()
21 {
22 return "DOMWindowWorklet";
23 }
24
25 // static
26 DOMWindowWorklet& DOMWindowWorklet::from(LocalDOMWindow& window)
27 {
28 DOMWindowWorklet* supplement = static_cast<DOMWindowWorklet*>(WillBeHeapSupp lement<LocalDOMWindow>::from(window, supplementName()));
29 if (!supplement) {
30 supplement = new DOMWindowWorklet(window);
31 provideTo(window, supplementName(), adoptPtrWillBeNoop(supplement));
32 }
33 return *supplement;
34 }
35
36 // static
37 Worklet* DOMWindowWorklet::renderWorklet(ExecutionContext* executionContext, DOM Window& window)
38 {
39 return from(toLocalDOMWindow(window)).renderWorklet(executionContext);
40 }
41
42 Worklet* DOMWindowWorklet::renderWorklet(ExecutionContext* executionContext) con st
43 {
44 if (!m_renderWorklet && frame())
45 m_renderWorklet = Worklet::create(frame(), executionContext);
46 return m_renderWorklet.get();
47 }
48
49 DEFINE_TRACE(DOMWindowWorklet)
50 {
51 visitor->trace(m_renderWorklet);
52 WillBeHeapSupplement<LocalDOMWindow>::trace(visitor);
53 DOMWindowProperty::trace(visitor);
54 }
55
56 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698