| Index: Source/WebCore/page/DOMWindow.cpp
|
| diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp
|
| index 75bd58521d638c1595697025c5e12873cf8e29c6..475dabff48ed734ed75a5bf88e46a1636c9eff61 100644
|
| --- a/Source/WebCore/page/DOMWindow.cpp
|
| +++ b/Source/WebCore/page/DOMWindow.cpp
|
| @@ -1622,8 +1622,7 @@ bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<Event
|
| addBeforeUnloadEventListener(this);
|
| #if ENABLE(DEVICE_ORIENTATION)
|
| else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatures::deviceMotionEnabled()) {
|
| - if (DeviceMotionController* controller = DeviceMotionController::from(page()))
|
| - controller->addDeviceEventListener(this);
|
| + DeviceMotionController::shared().addDeviceEventListener(this);
|
| } else if (eventType == eventNames().deviceorientationEvent && RuntimeEnabledFeatures::deviceOrientationEnabled()) {
|
| if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
|
| controller->addDeviceEventListener(this);
|
| @@ -1658,8 +1657,7 @@ bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener
|
| removeBeforeUnloadEventListener(this);
|
| #if ENABLE(DEVICE_ORIENTATION)
|
| else if (eventType == eventNames().devicemotionEvent) {
|
| - if (DeviceMotionController* controller = DeviceMotionController::from(page()))
|
| - controller->removeDeviceEventListener(this);
|
| + DeviceMotionController::shared().removeDeviceEventListener(this);
|
| } else if (eventType == eventNames().deviceorientationEvent) {
|
| if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
|
| controller->removeDeviceEventListener(this);
|
| @@ -1723,8 +1721,7 @@ void DOMWindow::removeAllEventListeners()
|
| EventTarget::removeAllEventListeners();
|
|
|
| #if ENABLE(DEVICE_ORIENTATION)
|
| - if (DeviceMotionController* controller = DeviceMotionController::from(page()))
|
| - controller->removeAllDeviceEventListeners(this);
|
| + DeviceMotionController::shared().removeAllDeviceEventListeners(this);
|
| if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
|
| controller->removeAllDeviceEventListeners(this);
|
| #endif
|
|
|