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

Side by Side Diff: third_party/WebKit/Source/modules/sensor/SensorReadingEvent.h

Issue 2472403002: [Sensors] Align sensor reading attribute implementation with the specification (Closed)
Patch Set: Comments from Tim Created 4 years, 1 month 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 #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(const AtomicString& eventType,
20 SensorReading* reading) {
21 return new SensorReadingEvent(eventType, reading);
22 }
23
24 static SensorReadingEvent* create(const AtomicString& eventType,
25 const SensorReadingEventInit& initializer) {
26 return new SensorReadingEvent(eventType, initializer);
27 }
28
29 ~SensorReadingEvent() override;
30
31 const SensorReading* reading() const { return m_reading.get(); }
32 SensorReading* reading() { return m_reading.get(); }
33 const AtomicString& interfaceName() const override;
34
35 DECLARE_VIRTUAL_TRACE();
36
37 protected:
38 Member<SensorReading> m_reading;
39
40 private:
41 SensorReadingEvent(const AtomicString& eventType, SensorReading*);
42 SensorReadingEvent(const AtomicString& eventType,
43 const SensorReadingEventInit& initializer);
44 };
45
46 DEFINE_TYPE_CASTS(SensorReadingEvent,
47 Event,
48 event,
49 event->interfaceName() == EventNames::SensorReadingEvent,
50 event.interfaceName() == EventNames::SensorReadingEvent);
51
52 } // namepsace blink
53
54 #endif // SensorReadingEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698