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

Unified Diff: ppapi/shared_impl/ppb_gamepad_shared.cc

Issue 2572323002: Delete WebGamepads::length. (Closed)
Patch Set: Rebase Created 3 years, 11 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: ppapi/shared_impl/ppb_gamepad_shared.cc
diff --git a/ppapi/shared_impl/ppb_gamepad_shared.cc b/ppapi/shared_impl/ppb_gamepad_shared.cc
index a70792670a3b62012f641910453d5c84109f65d0..4ee0dd94761e3d20df3a029d4fda65fed7da78b5 100644
--- a/ppapi/shared_impl/ppb_gamepad_shared.cc
+++ b/ppapi/shared_impl/ppb_gamepad_shared.cc
@@ -14,10 +14,8 @@ const size_t WebKitGamepads::kItemsLengthCap;
void ConvertWebKitGamepadData(const WebKitGamepads& webkit_data,
PP_GamepadsSampleData* output_data) {
- size_t length = std::min(WebKitGamepads::kItemsLengthCap,
- static_cast<const size_t>(webkit_data.length));
- output_data->length = static_cast<unsigned>(length);
- for (unsigned i = 0; i < length; ++i) {
+ output_data->length = WebKitGamepads::kItemsLengthCap;
+ for (unsigned i = 0; i < WebKitGamepads::kItemsLengthCap; ++i) {
PP_GamepadSampleData& output_pad = output_data->items[i];
const WebKitGamepad& webkit_pad = webkit_data.items[i];
output_pad.connected = webkit_pad.connected ? PP_TRUE : PP_FALSE;
« no previous file with comments | « ppapi/shared_impl/ppb_gamepad_shared.h ('k') | third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698