Chromium Code Reviews| Index: third_party/WebKit/Source/modules/sensor/Sensor.cpp |
| diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.cpp b/third_party/WebKit/Source/modules/sensor/Sensor.cpp |
| index c9f902d42ad470d7f9d58be39494524c9fa69d63..a66b1905615ffeb27602d7a68dcef009d878fd3e 100644 |
| --- a/third_party/WebKit/Source/modules/sensor/Sensor.cpp |
| +++ b/third_party/WebKit/Source/modules/sensor/Sensor.cpp |
| @@ -288,9 +288,9 @@ void Sensor::updateState(Sensor::SensorState newState) { |
| if (newState == m_state) |
| return; |
| m_state = newState; |
| - if (getExecutionContext()) { |
| + if (m_state == SensorState::ACTIVE && getExecutionContext()) { |
|
shalamov
2016/11/09 11:17:16
if (m_state == ACTIVATING && newState == ACTIVE &&
|
| getExecutionContext()->postTask( |
| - BLINK_FROM_HERE, createSameThreadTask(&Sensor::notifyStateChanged, |
| + BLINK_FROM_HERE, createSameThreadTask(&Sensor::notifyOnActivate, |
| wrapWeakPersistent(this))); |
| } |
| @@ -327,8 +327,8 @@ void Sensor::notifySensorReadingChanged() { |
| dispatchEvent(Event::create(EventTypeNames::change)); |
| } |
| -void Sensor::notifyStateChanged() { |
| - dispatchEvent(Event::create(EventTypeNames::statechange)); |
| +void Sensor::notifyOnActivate() { |
| + dispatchEvent(Event::create(EventTypeNames::activate)); |
| } |
| void Sensor::notifyError(DOMException* error) { |