Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 #ifndef SensorReadingEvent_h | |
| 6 #define SensorReadingEvent_h | |
| 7 | |
| 8 #include "modules/EventModules.h" | |
| 9 #include "modules/sensor/SensorReading.h" | |
| 10 #include "modules/sensor/SensorReadingEventInit.h" | |
| 11 #include "platform/heap/Handle.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 | |
| 15 class SensorReadingEvent : public Event { | |
| 16 DEFINE_WRAPPERTYPEINFO(); | |
| 17 | |
| 18 public: | |
| 19 static SensorReadingEvent* create() | |
| 20 { | |
| 21 return new SensorReadingEvent; | |
| 22 } | |
| 23 | |
| 24 static SensorReadingEvent* create(const AtomicString& eventType) | |
| 25 { | |
| 26 return new SensorReadingEvent(eventType); | |
| 27 } | |
| 28 | |
| 29 static SensorReadingEvent* create(const AtomicString& eventType, SensorReadi ng& reading) | |
| 30 { | |
| 31 return new SensorReadingEvent(eventType, reading); | |
| 32 } | |
| 33 | |
| 34 static SensorReadingEvent* create(const AtomicString& eventType, const Senso rReadingEventInit& initializer) | |
| 35 { | |
| 36 return new SensorReadingEvent(eventType, initializer); | |
| 37 } | |
| 38 | |
| 39 ~SensorReadingEvent() override; | |
| 40 | |
| 41 // TODO(riju): crbug.com/614797 . | |
| 42 SensorReading* reading() const { return m_reading.get(); } | |
| 43 const AtomicString& interfaceName() const override; | |
| 44 | |
| 45 DECLARE_VIRTUAL_TRACE(); | |
| 46 | |
| 47 protected: | |
| 48 Member<SensorReading> m_reading; | |
| 49 | |
| 50 private: | |
| 51 SensorReadingEvent(); | |
| 52 SensorReadingEvent(const AtomicString& eventType); | |
|
haraken
2016/05/28 00:09:23
Add explicit.
riju_
2016/05/30 10:15:13
Done.
| |
| 53 SensorReadingEvent(const AtomicString& eventType, SensorReading&); | |
| 54 SensorReadingEvent(const AtomicString& eventType, const SensorReadingEventIn it& initializer); | |
| 55 | |
| 56 }; | |
| 57 | |
| 58 DEFINE_TYPE_CASTS(SensorReadingEvent, Event, event, event->interfaceName() == Ev entNames::SensorReadingEvent, event.interfaceName() == EventNames::SensorReading Event); | |
| 59 | |
| 60 } // namepsace blink | |
| 61 | |
| 62 #endif // SensorReadingEvent_h | |
| OLD | NEW |