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

Side by Side Diff: third_party/WebKit/Source/modules/gamepad/GamepadList.cpp

Issue 2808093006: [Device Service] Move Gamepad Blink headers to be part of the Gamepad client library (Closed)
Patch Set: rebase and address comments Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met: 5 * modification, are permitted provided that the following conditions are met:
6 * 6 *
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 12 matching lines...) Expand all
23 * DAMAGE. 23 * DAMAGE.
24 */ 24 */
25 25
26 #include "modules/gamepad/GamepadList.h" 26 #include "modules/gamepad/GamepadList.h"
27 27
28 namespace blink { 28 namespace blink {
29 29
30 GamepadList::GamepadList() {} 30 GamepadList::GamepadList() {}
31 31
32 void GamepadList::Set(unsigned index, Gamepad* gamepad) { 32 void GamepadList::Set(unsigned index, Gamepad* gamepad) {
33 if (index >= WebGamepads::kItemsLengthCap) 33 if (index >= device::Gamepads::kItemsLengthCap)
34 return; 34 return;
35 items_[index] = gamepad; 35 items_[index] = gamepad;
36 } 36 }
37 37
38 Gamepad* GamepadList::item(unsigned index) { 38 Gamepad* GamepadList::item(unsigned index) {
39 return index < length() ? items_[index].Get() : 0; 39 return index < length() ? items_[index].Get() : 0;
40 } 40 }
41 41
42 DEFINE_TRACE(GamepadList) { 42 DEFINE_TRACE(GamepadList) {
43 for (unsigned index = 0; index < WebGamepads::kItemsLengthCap; index++) { 43 for (unsigned index = 0; index < device::Gamepads::kItemsLengthCap; index++) {
44 visitor->Trace(items_[index]); 44 visitor->Trace(items_[index]);
45 } 45 }
46 } 46 }
47 47
48 } // namespace blink 48 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/gamepad/GamepadList.h ('k') | third_party/WebKit/Source/modules/gamepad/GamepadPose.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698