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

Unified Diff: third_party/WebKit/Source/modules/sensor/SensorReadingEvent.cpp

Issue 2317743002: [Sensors] Implementation of the Generic Sensor API (Closed)
Patch Set: Comments from Tim and haraken Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/sensor/SensorReadingEvent.cpp
diff --git a/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.cpp b/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.cpp
index 911ea9067ad1dc4d314f6560203f1d1a28ecf691..1a0ca9f71ad9acf216b0ecd2c3394b600da28ddc 100644
--- a/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.cpp
+++ b/third_party/WebKit/Source/modules/sensor/SensorReadingEvent.cpp
@@ -6,27 +6,18 @@
namespace blink {
-SensorReadingEvent::~SensorReadingEvent()
-{
-}
-
-SensorReadingEvent::SensorReadingEvent(const AtomicString& eventType)
- : Event(eventType, true, false) // let default be bubbles but is not cancelable.
- , m_reading(SensorReading::create())
-{
-}
+SensorReadingEvent::~SensorReadingEvent() = default;
-SensorReadingEvent::SensorReadingEvent(const AtomicString& eventType, SensorReading& reading)
- : Event(eventType, true, false) // let default be bubbles but is not cancelable.
+SensorReadingEvent::SensorReadingEvent(const AtomicString& eventType, SensorReading* reading)
+ : Event(eventType, false, false) // Does not bubble and is not cancelable.
, m_reading(reading)
{
+ DCHECK(m_reading);
}
SensorReadingEvent::SensorReadingEvent(const AtomicString& eventType, const SensorReadingEventInit& initializer)
- : Event(eventType, initializer)
- , m_reading(SensorReading::create())
+ : SensorReadingEvent(eventType, initializer.reading())
{
- setCanBubble(true);
}
const AtomicString& SensorReadingEvent::interfaceName() const
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/SensorReadingEvent.h ('k') | third_party/WebKit/Source/modules/sensor/SensorState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698