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

Side by Side Diff: base/android/jni_unguessable_token.cc

Issue 2468353002: Added UnguessableToken.java . (Closed)
Patch Set: comments 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/android/jni_unguessable_token.h"
6
7 #include "jni/UnguessableToken_jni.h"
8
9 namespace base {
10 namespace android {
11
12 ScopedJavaLocalRef<jobject> CreateJavaUnguessableToken(
13 JNIEnv* env,
14 const base::UnguessableToken& token) {
15 return Java_UnguessableToken_create(env, token.GetHighForSerialization(),
tguilbert 2016/11/02 23:31:50 Can you add a DCHECK(token) here? One of the goals
liberato (no reviews please) 2016/11/03 15:42:30 Done.
16 token.GetLowForSerialization());
17 }
18
19 base::UnguessableToken ConvertFromJavaUnguessableToken(
20 JNIEnv* env,
21 const JavaRef<jobject>& token) {
22 const uint64_t high =
23 Java_UnguessableToken_getHighForSerialization(env, token);
24 const uint64_t low = Java_UnguessableToken_getLowForSerialization(env, token);
tguilbert 2016/11/02 23:31:50 Can you add a DCHECK to make sure the token that w
liberato (no reviews please) 2016/11/03 15:42:30 Done.
25 return base::UnguessableToken::Deserialize(high, low);
26 }
27
28 } // namespace android
29 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698