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

Unified Diff: Source/core/frame/DeviceEventDispatcherBase.h

Issue 315573002: Generalize and refactor DeviceSensorEvent* architecture to support multi-event type targets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: similarity=60 Created 6 years, 7 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/core/frame/DeviceEventDispatcherBase.h
diff --git a/Source/core/frame/DeviceSensorEventDispatcher.h b/Source/core/frame/DeviceEventDispatcherBase.h
similarity index 77%
copy from Source/core/frame/DeviceSensorEventDispatcher.h
copy to Source/core/frame/DeviceEventDispatcherBase.h
index 26c269515f95d1bf6c5a51c0928273eebb6ff625..d8b1593cad67b2c0e601b8281c64f2bbc89c80d2 100644
--- a/Source/core/frame/DeviceSensorEventDispatcher.h
+++ b/Source/core/frame/DeviceEventDispatcherBase.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2014 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -28,31 +28,36 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef DeviceSensorEventDispatcher_h
-#define DeviceSensorEventDispatcher_h
+#ifndef DeviceEventDispatcherBase_h
+#define DeviceEventDispatcherBase_h
#include "wtf/Vector.h"
namespace WebCore {
-class DeviceSensorEventController;
+class DeviceEventControllerBase;
+
+class DeviceEventDispatcherBase {
+public:
+ void addController(DeviceEventControllerBase*);
+ void removeController(DeviceEventControllerBase*);
-class DeviceSensorEventDispatcher {
protected:
- DeviceSensorEventDispatcher();
- virtual ~DeviceSensorEventDispatcher();
+ DeviceEventDispatcherBase();
+ virtual ~DeviceEventDispatcherBase();
- void addController(DeviceSensorEventController*);
- void removeController(DeviceSensorEventController*);
- void purgeControllers();
+ void notifyControllers();
virtual void startListening() = 0;
virtual void stopListening() = 0;
- Vector<DeviceSensorEventController*> m_controllers;
+private:
+ void purgeControllers();
+
+ Vector<DeviceEventControllerBase*> m_controllers;
bool m_needsPurge;
bool m_isDispatching;
};
} // namespace WebCore
-#endif // DeviceSensorEventDispatcher_h
+#endif // DeviceEventDispatcherBase_h

Powered by Google App Engine
This is Rietveld 408576698