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

Unified Diff: Source/modules/device_orientation/DeviceMotionController.cpp

Issue 256593010: Gracefully support Navigator Gamepad methods in a detached state. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have document supplements keep a reference to their document Created 6 years, 8 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: Source/modules/device_orientation/DeviceMotionController.cpp
diff --git a/Source/modules/device_orientation/DeviceMotionController.cpp b/Source/modules/device_orientation/DeviceMotionController.cpp
index d36e1983f4f4121ac381586f821816928f26cf82..78409747ccb1beac7e73be0fea2f9c83446e0138 100644
--- a/Source/modules/device_orientation/DeviceMotionController.cpp
+++ b/Source/modules/device_orientation/DeviceMotionController.cpp
@@ -37,8 +37,9 @@
namespace WebCore {
DeviceMotionController::DeviceMotionController(Document& document)
- : DeviceSensorEventController(document)
+ : DeviceSensorEventController(document.page())
, DOMWindowLifecycleObserver(document.domWindow())
+ , m_document(document)
{
}
@@ -93,6 +94,11 @@ bool DeviceMotionController::isNullEvent(Event* event)
return !motionEvent->deviceMotionData()->canProvideEventData();
}
+Document* DeviceMotionController::document()
+{
+ return &m_document;
+}
+
void DeviceMotionController::didAddEventListener(DOMWindow* window, const AtomicString& eventType)
{
if (eventType != EventTypeNames::devicemotion)

Powered by Google App Engine
This is Rietveld 408576698