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

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

Issue 315573002: Generalize and refactor DeviceSensorEvent* architecture to support multi-event type targets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add stopUpdating in destructor of BatteryManager. Created 6 years, 6 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/DeviceOrientationDispatcher.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/DeviceOrientationDispatcher.cpp
diff --git a/Source/modules/device_orientation/DeviceOrientationDispatcher.cpp b/Source/modules/device_orientation/DeviceOrientationDispatcher.cpp
index ed73d039e8a2fe02e57b474002e88edfc65157d1..4c82b25aaa92041c0318862cf2a01268c79d3f62 100644
--- a/Source/modules/device_orientation/DeviceOrientationDispatcher.cpp
+++ b/Source/modules/device_orientation/DeviceOrientationDispatcher.cpp
@@ -34,7 +34,6 @@
#include "modules/device_orientation/DeviceOrientationController.h"
#include "modules/device_orientation/DeviceOrientationData.h"
#include "public/platform/Platform.h"
-#include "wtf/TemporaryChange.h"
namespace WebCore {
@@ -52,16 +51,6 @@ DeviceOrientationDispatcher::~DeviceOrientationDispatcher()
{
}
-void DeviceOrientationDispatcher::addDeviceOrientationController(DeviceOrientationController* controller)
-{
- addController(controller);
-}
-
-void DeviceOrientationDispatcher::removeDeviceOrientationController(DeviceOrientationController* controller)
-{
- removeController(controller);
-}
-
void DeviceOrientationDispatcher::startListening()
{
blink::Platform::current()->setDeviceOrientationListener(this);
@@ -76,19 +65,7 @@ void DeviceOrientationDispatcher::stopListening()
void DeviceOrientationDispatcher::didChangeDeviceOrientation(const blink::WebDeviceOrientationData& motion)
{
m_lastDeviceOrientationData = DeviceOrientationData::create(motion);
-
- {
- TemporaryChange<bool> changeIsDispatching(m_isDispatching, true);
- // Don't fire controllers removed or added during event dispatch.
- size_t size = m_controllers.size();
- for (size_t i = 0; i < size; ++i) {
- if (m_controllers[i])
- static_cast<DeviceOrientationController*>(m_controllers[i])->didChangeDeviceOrientation(m_lastDeviceOrientationData.get());
- }
- }
-
- if (m_needsPurge)
- purgeControllers();
+ notifyControllers();
}
DeviceOrientationData* DeviceOrientationDispatcher::latestDeviceOrientationData()
« no previous file with comments | « Source/modules/device_orientation/DeviceOrientationDispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698