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

Unified Diff: ppapi/shared_impl/ppb_gamepad_shared.cc

Issue 165983005: Updating Gamepad API to match latest spec (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed typo in GamepadProviderTest Created 6 years, 10 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
« no previous file with comments | « ppapi/shared_impl/ppb_gamepad_shared.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4f83b39956d14bf1e6e10c51adfcaf013726b1f3..c45494a00c1c2dd07b4bf9778350ddf583825c7b 100644
--- a/ppapi/shared_impl/ppb_gamepad_shared.cc
+++ b/ppapi/shared_impl/ppb_gamepad_shared.cc
@@ -20,15 +20,14 @@ void ConvertWebKitGamepadData(const WebKitGamepads& webkit_data,
id_size_does_not_match);
COMPILE_ASSERT(sizeof(output_pad.axes) == sizeof(webkit_pad.axes),
axes_size_does_not_match);
- COMPILE_ASSERT(sizeof(output_pad.buttons) == sizeof(webkit_pad.buttons),
- buttons_size_does_not_match);
memcpy(output_pad.id, webkit_pad.id, sizeof(output_pad.id));
output_pad.timestamp = webkit_pad.timestamp;
output_pad.axes_length = webkit_pad.axes_length;
memcpy(output_pad.axes, webkit_pad.axes, sizeof(output_pad.axes));
output_pad.buttons_length = webkit_pad.buttons_length;
- memcpy(
- output_pad.buttons, webkit_pad.buttons, sizeof(output_pad.buttons));
+
+ for (unsigned j = 0; j < webkit_pad.buttons_length; ++j)
+ output_pad.buttons[j] = webkit_pad.buttons[j].value;
}
}
}
« no previous file with comments | « ppapi/shared_impl/ppb_gamepad_shared.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698