1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 #include "modules/gamepad/WebKitGamepadList.h"
10 WebKitGamepadList::WebKitGamepadList()
12 ScriptWrappable::init(this);
15 WebKitGamepadList::~WebKitGamepadList()
19 void WebKitGamepadList::set(unsigned index, WebKitGamepad* gamepad)
21 if (index >= blink::WebGamepads::itemsLengthCap)
23 m_items[index] = gamepad;
26 WebKitGamepad* WebKitGamepadList::item(unsigned index)
28 return index < length() ? m_items[index].get() : 0;
31 void WebKitGamepadList::trace(Visitor* visitor)
33 for (unsigned index = 0; index < blink::WebGamepads::itemsLengthCap; index++) {
34 visitor->trace(m_items[index]);
38 } // namespace WebCore