OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef DeviceLightEvent_h | |
6 #define DeviceLightEvent_h | |
7 | |
8 #include "core/events/Event.h" | |
9 #include "heap/Handle.h" | |
10 | |
11 namespace WebCore { | |
12 | |
13 struct DeviceLightEventInit : public EventInit { | |
14 DeviceLightEventInit() | |
15 : value(std::numeric_limits<double>::infinity()) | |
16 { | |
17 bubbles = true; | |
18 }; | |
19 | |
20 double value; | |
21 }; | |
22 | |
23 class DeviceLightEvent FINAL : public Event { | |
24 public: | |
25 virtual ~DeviceLightEvent(); | |
26 | |
27 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create() | |
sof
2014/03/20 16:27:15
Make this PassRefPtr<> only for now; Event hasn't
riju_
2014/03/20 20:12:29
Done.
| |
28 { | |
29 return adoptRefWillBeRefCountedGarbageCollected(new DeviceLightEvent); | |
sof
2014/03/20 16:27:15
Similarly, just adoptRef()
riju_
2014/03/20 20:12:29
Done.
| |
30 } | |
31 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& e ventType, const double value) | |
sof
2014/03/20 16:27:15
PassRefPtr<>
riju_
2014/03/20 20:12:29
Done.
| |
32 { | |
33 return adoptRefWillBeRefCountedGarbageCollected(new DeviceLightEvent(eve ntType, value)); | |
sof
2014/03/20 16:27:15
adoptRef()
riju_
2014/03/20 20:12:29
Done.
| |
34 } | |
35 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& e ventType, const DeviceLightEventInit& initializer) | |
sof
2014/03/20 16:27:15
PassRefPtr<>
riju_
2014/03/20 20:12:29
Done.
| |
36 { | |
37 return adoptRefWillBeRefCountedGarbageCollected(new DeviceLightEvent(eve ntType, initializer)); | |
sof
2014/03/20 16:27:15
adoptRef()
riju_
2014/03/20 20:12:29
Done.
| |
38 } | |
39 | |
40 double value() const { return m_value; } | |
41 | |
42 virtual const AtomicString& interfaceName() const OVERRIDE; | |
43 | |
44 private: | |
45 DeviceLightEvent(); | |
46 DeviceLightEvent(const AtomicString& eventType, const double value); | |
47 DeviceLightEvent(const AtomicString& eventType, const DeviceLightEventInit& initializer); | |
48 | |
49 double m_value; | |
50 }; | |
51 | |
52 DEFINE_TYPE_CASTS(DeviceLightEvent, Event, event, event->interfaceName() == Even tNames::DeviceLightEvent, event.interfaceName() == EventNames::DeviceLightEvent) ; | |
53 | |
54 } // namespace WebCore | |
55 | |
56 #endif // DeviceLightEvent_h | |
OLD | NEW |