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

Unified Diff: remoting/client/jni/android_keymap.cc

Issue 21236002: Chromoting Android app mouse/keyboard bugfixes and enhancements (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move non-negative and in-bounds input checks to C++, fix style nits Created 7 years, 5 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: remoting/client/jni/android_keymap.cc
diff --git a/remoting/client/jni/android_keymap.cc b/remoting/client/jni/android_keymap.cc
index f42704661399f7832fd0579796fd11e9111904e2..659e50baf670480c21e12111145745c9d7041a49 100644
--- a/remoting/client/jni/android_keymap.cc
+++ b/remoting/client/jni/android_keymap.cc
@@ -4,6 +4,8 @@
#include "remoting/client/jni/android_keymap.h"
+#include "base/logging.h"
+
namespace {
// These must be defined in the same order as the Android keycodes in
@@ -201,7 +203,9 @@ const uint32 usb_keycodes[] = {
namespace remoting {
-uint32 AndroidKeycodeToUsbKeycode(int android) {
+uint32 AndroidKeycodeToUsbKeycode(size_t android) {
+ DCHECK(android < sizeof usb_keycodes / sizeof (uint32));
Sergey Ulanov 2013/07/30 21:55:18 DCHECK_LT. Please add parenthesis around usb_keyco
solb 2013/07/30 23:03:38 Done.
+
return usb_keycodes[android];
}

Powered by Google App Engine
This is Rietveld 408576698