Chromium Code Reviews| Index: Source/modules/gamepad/Gamepad.h |
| diff --git a/Source/modules/gamepad/Gamepad.h b/Source/modules/gamepad/Gamepad.h |
| index 1787b1f83d5f63f9f51d3b66a44da924078f5a65..893d4f68220bcdff62c8d7d77907ed843bcc35fe 100644 |
| --- a/Source/modules/gamepad/Gamepad.h |
| +++ b/Source/modules/gamepad/Gamepad.h |
| @@ -29,54 +29,27 @@ |
| #include "bindings/v8/ScriptWrappable.h" |
| #include "heap/Handle.h" |
| #include "modules/gamepad/GamepadButton.h" |
| +#include "modules/gamepad/GamepadCommon.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 Gamepad FINAL : public GamepadCommon, public RefCountedWillBeGarbageCollectedFinalized<Gamepad>, public ScriptWrappable { |
|
kouhei (in TOK)
2014/03/13 09:05:11
RefCountedWillBeGarbageCollectedFinalized must be
Nils Barth (inactive)
2014/03/13 09:15:14
Thanks, got it, done!
|
| public: |
| static PassRefPtrWillBeRawPtr<Gamepad> create() |
| { |
| return adoptRefWillBeNoop(new Gamepad); |
| } |
| - ~Gamepad(); |
| - |
| - typedef Vector<float> FloatVector; |
| - |
| - const String& id() const { return m_id; } |
| - void setId(const String& id) { m_id = id; } |
| - |
| - unsigned index() const { return m_index; } |
| - void setIndex(unsigned val) { m_index = val; } |
| - |
| - bool connected() const { return m_connected; } |
| - void setConnected(bool val) { m_connected = val; } |
| - |
| - unsigned long long timestamp() const { return m_timestamp; } |
| - void setTimestamp(unsigned long long val) { m_timestamp = val; } |
| - |
| - const String& mapping() const { return m_mapping; } |
| - void setMapping(const String& val) { m_mapping = val; } |
| - |
| - const FloatVector& axes() const { return m_axes; } |
| - void setAxes(unsigned count, const float* data); |
| + ~Gamepad() { } |
| const GamepadButtonVector& buttons() const { return m_buttons; } |
| void setButtons(unsigned count, const blink::WebGamepadButton* data); |
| - void trace(Visitor*); |
| + void trace(Visitor* visitor) { visitor->trace(m_buttons); } |
|
kouhei (in TOK)
2014/03/13 09:05:11
write this in cpp file.
Nils Barth (inactive)
2014/03/13 09:15:14
ok;
is there a rule about this?
(When to inline?)
kouhei (in TOK)
2014/03/13 09:17:10
IIRC the oilpan rule for trace() was write in cpp
Nils Barth (inactive)
2014/03/13 09:19:52
Thanks for explaining!
|
| private: |
| - Gamepad(); |
| - String m_id; |
| - unsigned m_index; |
| - bool m_connected; |
| - unsigned long long m_timestamp; |
| - String m_mapping; |
| - FloatVector m_axes; |
| + Gamepad() { ScriptWrappable::init(this); } |
| GamepadButtonVector m_buttons; |
| }; |