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

Unified Diff: Source/modules/device_light/DeviceLightDispatcher.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
Index: Source/modules/device_light/DeviceLightDispatcher.cpp
diff --git a/Source/modules/device_light/DeviceLightDispatcher.cpp b/Source/modules/device_light/DeviceLightDispatcher.cpp
index f692131b1a52415413cac7d72ddf535e2363d918..ed0b32f440d79863c110cd35ae796445c7559c64 100644
--- a/Source/modules/device_light/DeviceLightDispatcher.cpp
+++ b/Source/modules/device_light/DeviceLightDispatcher.cpp
@@ -8,7 +8,6 @@
#include "core/frame/DeviceSensorEventDispatcher.h"
#include "modules/device_light/DeviceLightController.h"
#include "public/platform/Platform.h"
-#include "wtf/TemporaryChange.h"
namespace WebCore {
@@ -27,17 +26,6 @@ DeviceLightDispatcher::~DeviceLightDispatcher()
{
}
-
-void DeviceLightDispatcher::addDeviceLightController(DeviceLightController* controller)
-{
- addController(controller);
-}
-
-void DeviceLightDispatcher::removeDeviceLightController(DeviceLightController* controller)
-{
- removeController(controller);
-}
-
void DeviceLightDispatcher::startListening()
{
blink::Platform::current()->setDeviceLightListener(this);
@@ -52,19 +40,7 @@ void DeviceLightDispatcher::stopListening()
void DeviceLightDispatcher::didChangeDeviceLight(double value)
{
m_lastDeviceLightData = value;
-
- {
- 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<DeviceLightController*>(m_controllers[i])->didChangeDeviceLight(m_lastDeviceLightData);
- }
- }
-
- if (m_needsPurge)
- purgeControllers();
+ notifyControllers();
}
double DeviceLightDispatcher::latestDeviceLightData() const
« no previous file with comments | « Source/modules/device_light/DeviceLightDispatcher.h ('k') | Source/modules/device_orientation/DeviceMotionController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698