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

Unified Diff: remoting/client/jni/jni_interface.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/jni_interface.cc
diff --git a/remoting/client/jni/jni_interface.cc b/remoting/client/jni/jni_interface.cc
index 5ca45a013cffc1e237051b18d912bf7e10d1daa8..088ac82a42f762c71c01038aaf8f78a518a8248e 100644
--- a/remoting/client/jni/jni_interface.cc
+++ b/remoting/client/jni/jni_interface.cc
@@ -120,6 +120,9 @@ JNIEXPORT void JNICALL JNI_IMPLEMENTATION(mouseActionNative)(
jint y,
jint which_button,
jboolean button_down) {
+ // Button must be within the bounds of the MouseEvent_MouseButton enum.
+ DCHECK(which_button >= 0 && which_button < 5);
+
remoting::ChromotingJniRuntime::GetInstance()->session()->PerformMouseAction(
x,
y,

Powered by Google App Engine
This is Rietveld 408576698