diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/modules/gamepad/GamepadList.h')
-rw-r--r-- | chromium/third_party/WebKit/Source/modules/gamepad/GamepadList.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/chromium/third_party/WebKit/Source/modules/gamepad/GamepadList.h b/chromium/third_party/WebKit/Source/modules/gamepad/GamepadList.h index 2f36298149f..ce07d8b3149 100644 --- a/chromium/third_party/WebKit/Source/modules/gamepad/GamepadList.h +++ b/chromium/third_party/WebKit/Source/modules/gamepad/GamepadList.h @@ -28,31 +28,30 @@ #include "bindings/v8/ScriptWrappable.h" #include "modules/gamepad/Gamepad.h" -#include "wtf/PassRefPtr.h" +#include "platform/heap/Handle.h" +#include "public/platform/WebGamepads.h" #include "wtf/RefCounted.h" #include "wtf/Vector.h" namespace WebCore { -typedef Vector<RefPtr<Gamepad> > GamepadVector; - -class GamepadList : public RefCounted<GamepadList>, public ScriptWrappable { +class GamepadList FINAL : public GarbageCollectedFinalized<GamepadList>, public ScriptWrappable { public: - static PassRefPtr<GamepadList> create() { return adoptRef(new GamepadList); } + static GamepadList* create() + { + return new GamepadList(); + } ~GamepadList(); - void set(unsigned index, PassRefPtr<Gamepad>); + void set(unsigned index, Gamepad*); Gamepad* item(unsigned index); - unsigned length() const; + unsigned length() const { return blink::WebGamepads::itemsLengthCap; } -private: - enum { kMaximumGamepads = 4 }; - GamepadList() - { - ScriptWrappable::init(this); - } + void trace(Visitor*); - RefPtr<Gamepad> m_items[kMaximumGamepads]; +private: + GamepadList(); + Member<Gamepad> m_items[blink::WebGamepads::itemsLengthCap]; }; } // namespace WebCore |