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

Unified Diff: base/android/jni_unguessable_token.h

Issue 2468353002: Added UnguessableToken.java . (Closed)
Patch Set: added final for findbugs compilation failure Created 4 years, 1 month 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: base/android/jni_unguessable_token.h
diff --git a/base/android/jni_unguessable_token.h b/base/android/jni_unguessable_token.h
new file mode 100644
index 0000000000000000000000000000000000000000..c42845271b5be0757bbd3252aec54a306d8b5884
--- /dev/null
+++ b/base/android/jni_unguessable_token.h
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_ANDROID_JNI_UNGUESSABLE_TOKEN_H_
nyquist 2016/11/08 19:04:42 We usually use jni_foo_thing.h naming for things t
liberato (no reviews please) 2016/11/09 18:18:33 thanks, Done.
+#define BASE_ANDROID_JNI_UNGUESSABLE_TOKEN_H_
+
+#include <jni.h>
+
+#include "base/android/scoped_java_ref.h"
+#include "base/base_export.h"
+#include "base/unguessable_token.h"
+
+namespace base {
+namespace android {
+
+// Create a java UnguessableToken with the same value as |token|.
nyquist 2016/11/08 19:04:42 Nit: Java
liberato (no reviews please) 2016/11/09 18:18:33 Done.
+BASE_EXPORT ScopedJavaLocalRef<jobject> CreateJavaUnguessableToken(
+ JNIEnv* env,
+ const base::UnguessableToken& token);
+
+// Create a native UnguessableToken from |token|.
nyquist 2016/11/08 19:04:42 Nit: Could you specify which Java type |token| mus
liberato (no reviews please) 2016/11/09 18:18:33 Done.
+BASE_EXPORT base::UnguessableToken ConvertFromJavaUnguessableToken(
+ JNIEnv* env,
+ const JavaRef<jobject>& token);
+
+// Parcel |token| and unparcel it, and return the result. While this method is
+// intended for facilitating unit tests, it results only in a clone of |token|.
+BASE_EXPORT ScopedJavaLocalRef<jobject>
+ParcelAndUnparcelUnguessableTokenForTesting(JNIEnv* env,
+ const JavaRef<jobject>& token);
+
+} // namespace android
+} // namespace base
+
+#endif // BASE_ANDROID_JNI_UNGUESSABLE_TOKEN_H_

Powered by Google App Engine
This is Rietveld 408576698