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

Side by Side Diff: third_party/WebKit/Source/modules/vr/VRController.cpp

Issue 1846913009: HeapSupplements are now just Supplements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 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 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/vr/VRController.h" 5 #include "modules/vr/VRController.h"
6 6
7 #include "core/frame/LocalFrame.h" 7 #include "core/frame/LocalFrame.h"
8 #include "platform/RuntimeEnabledFeatures.h" 8 #include "platform/RuntimeEnabledFeatures.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 VRController::~VRController() 12 VRController::~VRController()
13 { 13 {
14 } 14 }
15 15
16 void VRController::provideTo(LocalFrame& frame, WebVRClient* client) 16 void VRController::provideTo(LocalFrame& frame, WebVRClient* client)
17 { 17 {
18 ASSERT(RuntimeEnabledFeatures::webVREnabled()); 18 ASSERT(RuntimeEnabledFeatures::webVREnabled());
19 19
20 VRController* controller = new VRController(frame, client); 20 VRController* controller = new VRController(frame, client);
21 HeapSupplement<LocalFrame>::provideTo(frame, supplementName(), controller); 21 Supplement<LocalFrame>::provideTo(frame, supplementName(), controller);
22 } 22 }
23 23
24 VRController* VRController::from(LocalFrame& frame) 24 VRController* VRController::from(LocalFrame& frame)
25 { 25 {
26 return static_cast<VRController*>(HeapSupplement<LocalFrame>::from(frame, su pplementName())); 26 return static_cast<VRController*>(Supplement<LocalFrame>::from(frame, supple mentName()));
27 } 27 }
28 28
29 VRController::VRController(LocalFrame& frame, WebVRClient* client) 29 VRController::VRController(LocalFrame& frame, WebVRClient* client)
30 : LocalFrameLifecycleObserver(&frame) 30 : LocalFrameLifecycleObserver(&frame)
31 , m_client(client) 31 , m_client(client)
32 { 32 {
33 } 33 }
34 34
35 const char* VRController::supplementName() 35 const char* VRController::supplementName()
36 { 36 {
(...skipping 29 matching lines...) Expand all
66 m_client->resetSensor(index); 66 m_client->resetSensor(index);
67 } 67 }
68 68
69 void VRController::willDetachFrameHost() 69 void VRController::willDetachFrameHost()
70 { 70 {
71 m_client = nullptr; 71 m_client = nullptr;
72 } 72 }
73 73
74 DEFINE_TRACE(VRController) 74 DEFINE_TRACE(VRController)
75 { 75 {
76 HeapSupplement<LocalFrame>::trace(visitor); 76 Supplement<LocalFrame>::trace(visitor);
77 LocalFrameLifecycleObserver::trace(visitor); 77 LocalFrameLifecycleObserver::trace(visitor);
78 } 78 }
79 79
80 } // namespace blink 80 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRController.h ('k') | third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698