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

Side by Side Diff: third_party/WebKit/Source/modules/device_light/DeviceLightController.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/device_light/DeviceLightController.h" 5 #include "modules/device_light/DeviceLightController.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "modules/EventModules.h" 8 #include "modules/EventModules.h"
9 #include "modules/device_light/DeviceLightDispatcher.h" 9 #include "modules/device_light/DeviceLightDispatcher.h"
10 #include "modules/device_light/DeviceLightEvent.h" 10 #include "modules/device_light/DeviceLightEvent.h"
(...skipping 13 matching lines...) Expand all
24 #endif 24 #endif
25 } 25 }
26 26
27 const char* DeviceLightController::supplementName() 27 const char* DeviceLightController::supplementName()
28 { 28 {
29 return "DeviceLightController"; 29 return "DeviceLightController";
30 } 30 }
31 31
32 DeviceLightController& DeviceLightController::from(Document& document) 32 DeviceLightController& DeviceLightController::from(Document& document)
33 { 33 {
34 DeviceLightController* controller = static_cast<DeviceLightController*>(Heap Supplement<Document>::from(document, supplementName())); 34 DeviceLightController* controller = static_cast<DeviceLightController*>(Supp lement<Document>::from(document, supplementName()));
35 if (!controller) { 35 if (!controller) {
36 controller = new DeviceLightController(document); 36 controller = new DeviceLightController(document);
37 HeapSupplement<Document>::provideTo(document, supplementName(), controll er); 37 Supplement<Document>::provideTo(document, supplementName(), controller);
38 } 38 }
39 return *controller; 39 return *controller;
40 } 40 }
41 41
42 bool DeviceLightController::hasLastData() 42 bool DeviceLightController::hasLastData()
43 { 43 {
44 return DeviceLightDispatcher::instance().latestDeviceLightData() >= 0; 44 return DeviceLightDispatcher::instance().latestDeviceLightData() >= 0;
45 } 45 }
46 46
47 void DeviceLightController::registerWithDispatcher() 47 void DeviceLightController::registerWithDispatcher()
(...skipping 19 matching lines...) Expand all
67 } 67 }
68 68
69 const AtomicString& DeviceLightController::eventTypeName() const 69 const AtomicString& DeviceLightController::eventTypeName() const
70 { 70 {
71 return EventTypeNames::devicelight; 71 return EventTypeNames::devicelight;
72 } 72 }
73 73
74 DEFINE_TRACE(DeviceLightController) 74 DEFINE_TRACE(DeviceLightController)
75 { 75 {
76 DeviceSingleWindowEventController::trace(visitor); 76 DeviceSingleWindowEventController::trace(visitor);
77 HeapSupplement<Document>::trace(visitor); 77 Supplement<Document>::trace(visitor);
78 } 78 }
79 79
80 80
81 } // namespace blink 81 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698