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

Unified Diff: Source/modules/device_orientation/NewDeviceOrientationController.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
« no previous file with comments | « Source/modules/device_orientation/NewDeviceOrientationController.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/device_orientation/NewDeviceOrientationController.cpp
diff --git a/Source/modules/device_orientation/NewDeviceOrientationController.cpp b/Source/modules/device_orientation/NewDeviceOrientationController.cpp
index 3cf3197694528942473a2ab27e6856b88a34a9ed..b1cf62c300c8b104a7de1bcee45ef3c0575f5745 100644
--- a/Source/modules/device_orientation/NewDeviceOrientationController.cpp
+++ b/Source/modules/device_orientation/NewDeviceOrientationController.cpp
@@ -28,6 +28,7 @@
#include "modules/device_orientation/NewDeviceOrientationController.h"
#include "core/dom/Document.h"
+#include "modules/device_orientation/DeviceOrientationData.h"
#include "modules/device_orientation/DeviceOrientationDispatcher.h"
#include "modules/device_orientation/DeviceOrientationEvent.h"
@@ -83,4 +84,11 @@ void NewDeviceOrientationController::unregisterWithDispatcher()
DeviceOrientationDispatcher::instance().removeDeviceOrientationController(this);
}
+bool NewDeviceOrientationController::isNullEvent(Event* event)
+{
+ ASSERT(event->type() == eventNames().devicemotionEvent);
+ DeviceOrientationEvent* orientationEvent = static_cast<DeviceOrientationEvent*>(event);
+ return !orientationEvent->orientation()->canProvideEventData();
+}
+
} // namespace WebCore
« no previous file with comments | « Source/modules/device_orientation/NewDeviceOrientationController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698