OLD | NEW |
---|---|
(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 | |
OLD | NEW |