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

Unified Diff: Source/modules/gamepad/GamepadCommon.h

Issue 195993007: Factor out GamepadCommon base class from Gamepad and WebKitGamepad (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revised Created 6 years, 9 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/gamepad/GamepadCommon.h
diff --git a/Source/modules/gamepad/Gamepad.h b/Source/modules/gamepad/GamepadCommon.h
similarity index 78%
copy from Source/modules/gamepad/Gamepad.h
copy to Source/modules/gamepad/GamepadCommon.h
index 1787b1f83d5f63f9f51d3b66a44da924078f5a65..2c36a395730221cfa7a24f3e7885fd0e9c1d40ff 100644
--- a/Source/modules/gamepad/Gamepad.h
+++ b/Source/modules/gamepad/GamepadCommon.h
@@ -23,27 +23,18 @@
* DAMAGE.
*/
-#ifndef Gamepad_h
-#define Gamepad_h
+#ifndef GamepadCommon_h
+#define GamepadCommon_h
-#include "bindings/v8/ScriptWrappable.h"
-#include "heap/Handle.h"
-#include "modules/gamepad/GamepadButton.h"
#include "public/platform/WebGamepad.h"
-#include "wtf/RefCounted.h"
#include "wtf/Vector.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
-class Gamepad FINAL : public RefCountedWillBeGarbageCollectedFinalized<Gamepad>, public ScriptWrappable {
+class GamepadCommon {
public:
- static PassRefPtrWillBeRawPtr<Gamepad> create()
- {
- return adoptRefWillBeNoop(new Gamepad);
- }
- ~Gamepad();
-
+ GamepadCommon();
typedef Vector<float> FloatVector;
const String& id() const { return m_id; }
haraken 2014/03/13 09:33:50 Just to confirm: You don't want to add virtual to
@@ -64,22 +55,15 @@ public:
const FloatVector& axes() const { return m_axes; }
void setAxes(unsigned count, const float* data);
haraken 2014/03/13 09:33:50 Shall we add: virtual void trace(Visitor*) = 0; ?
zerny-chromium 2014/03/13 09:48:00 There is no need to trace this base so lets keep i
haraken 2014/03/13 10:22:35 Ditto. Ignore my previous comments about virtual :
- const GamepadButtonVector& buttons() const { return m_buttons; }
- void setButtons(unsigned count, const blink::WebGamepadButton* data);
-
- void trace(Visitor*);
-
-private:
- Gamepad();
+protected:
String m_id;
unsigned m_index;
bool m_connected;
unsigned long long m_timestamp;
String m_mapping;
FloatVector m_axes;
- GamepadButtonVector m_buttons;
};
} // namespace WebCore
-#endif // Gamepad_h
+#endif // GamepadCommon_h

Powered by Google App Engine
This is Rietveld 408576698