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

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

Issue 21256002: Fire null Device Motion events only once. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixed comments Created 7 years, 5 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 b001f486f7a6c5c6c7c62bcc7c4384221a598eee..4e28bf2f254c1fc02e9604ff9f4edb99c56ad7e5 100644
--- a/Source/modules/device_orientation/DeviceMotionController.cpp
+++ b/Source/modules/device_orientation/DeviceMotionController.cpp
@@ -28,6 +28,7 @@
#include "modules/device_orientation/DeviceMotionController.h"
#include "core/dom/Document.h"
+#include "modules/device_orientation/DeviceMotionData.h"
#include "modules/device_orientation/DeviceMotionDispatcher.h"
#include "modules/device_orientation/DeviceMotionEvent.h"
@@ -82,4 +83,11 @@ void DeviceMotionController::unregisterWithDispatcher()
DeviceMotionDispatcher::instance().removeDeviceMotionController(this);
}
+bool DeviceMotionController::isNullEvent(Event* event)
+{
+ ASSERT(event->type() == eventNames().devicemotionEvent);
+ DeviceMotionEvent* motionEvent = static_cast<DeviceMotionEvent*>(event);
+ return !motionEvent->deviceMotionData()->canProvideEventData();
+}
+
} // namespace WebCore
« no previous file with comments | « Source/modules/device_orientation/DeviceMotionController.h ('k') | Source/modules/device_orientation/DeviceMotionData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698