OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/variations/android/variations_seed_bridge.h" | 5 #include "components/variations/android/variations_seed_bridge.h" |
6 | 6 |
7 #include <jni.h> | 7 #include <jni.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 21 matching lines...) Expand all Loading... | |
32 | 32 |
33 namespace variations { | 33 namespace variations { |
34 namespace android { | 34 namespace android { |
35 | 35 |
36 bool RegisterVariationsSeedBridge(JNIEnv* env) { | 36 bool RegisterVariationsSeedBridge(JNIEnv* env) { |
37 return RegisterNativesImpl(env); | 37 return RegisterNativesImpl(env); |
38 } | 38 } |
39 | 39 |
40 void GetVariationsFirstRunSeed(std::string* seed_data, | 40 void GetVariationsFirstRunSeed(std::string* seed_data, |
41 std::string* seed_signature, | 41 std::string* seed_signature, |
42 std::string* seed_country) { | 42 std::string* seed_country, |
43 std::string* response_time, | |
44 bool* is_gzip_compressed) { | |
43 JNIEnv* env = AttachCurrentThread(); | 45 JNIEnv* env = AttachCurrentThread(); |
44 ScopedJavaLocalRef<jbyteArray> j_seed_data = | 46 ScopedJavaLocalRef<jbyteArray> j_seed_data = |
45 Java_VariationsSeedBridge_getVariationsFirstRunSeedData( | 47 Java_VariationsSeedBridge_getVariationsFirstRunSeedData( |
46 env, GetApplicationContext()); | 48 env, GetApplicationContext()); |
47 ScopedJavaLocalRef<jstring> j_seed_signature = | 49 ScopedJavaLocalRef<jstring> j_seed_signature = |
48 Java_VariationsSeedBridge_getVariationsFirstRunSeedSignature( | 50 Java_VariationsSeedBridge_getVariationsFirstRunSeedSignature( |
49 env, GetApplicationContext()); | 51 env, GetApplicationContext()); |
50 ScopedJavaLocalRef<jstring> j_seed_country = | 52 ScopedJavaLocalRef<jstring> j_seed_country = |
51 Java_VariationsSeedBridge_getVariationsFirstRunSeedCountry( | 53 Java_VariationsSeedBridge_getVariationsFirstRunSeedCountry( |
52 env, GetApplicationContext()); | 54 env, GetApplicationContext()); |
55 ScopedJavaLocalRef<jstring> j_response_time = | |
Alexei Svitkine (slow)
2015/11/12 22:25:29
Nit: use "date" terminology throughout. Right now,
Alexander Agulenko
2015/11/12 22:37:55
Done.
| |
56 Java_VariationsSeedBridge_getVariationsFirstRunSeedDate( | |
57 env, GetApplicationContext()); | |
58 jboolean j_is_gzip_compressed = | |
59 Java_VariationsSeedBridge_getVariationsFirstRunSeedIsGzipCompressed( | |
60 env, GetApplicationContext()); | |
53 *seed_data = JavaByteArrayToString(env, j_seed_data.obj()); | 61 *seed_data = JavaByteArrayToString(env, j_seed_data.obj()); |
54 *seed_signature = ConvertJavaStringToUTF8(j_seed_signature); | 62 *seed_signature = ConvertJavaStringToUTF8(j_seed_signature); |
55 *seed_country = ConvertJavaStringToUTF8(j_seed_country); | 63 *seed_country = ConvertJavaStringToUTF8(j_seed_country); |
64 *response_time = ConvertJavaStringToUTF8(j_response_time); | |
65 *is_gzip_compressed = static_cast<bool>(j_is_gzip_compressed); | |
56 } | 66 } |
57 | 67 |
58 } // namespace android | 68 } // namespace android |
59 } // namespace variations | 69 } // namespace variations |
OLD | NEW |