OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "native_test_server.h" | 5 #include "native_test_server.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 return base::android::ConvertUTF8ToJavaString(env, url.spec()).Release(); | 145 return base::android::ConvertUTF8ToJavaString(env, url.spec()).Release(); |
146 } | 146 } |
147 | 147 |
148 jstring GetHostPort(JNIEnv* env, jclass jcaller) { | 148 jstring GetHostPort(JNIEnv* env, jclass jcaller) { |
149 DCHECK(g_test_server); | 149 DCHECK(g_test_server); |
150 std::string host_port = | 150 std::string host_port = |
151 net::HostPortPair::FromURL(g_test_server->base_url()).ToString(); | 151 net::HostPortPair::FromURL(g_test_server->base_url()).ToString(); |
152 return base::android::ConvertUTF8ToJavaString(env, host_port).Release(); | 152 return base::android::ConvertUTF8ToJavaString(env, host_port).Release(); |
153 } | 153 } |
154 | 154 |
155 jboolean IsDataReductionProxySupported(JNIEnv* env, jclass jcaller) { | |
156 #if defined(DATA_REDUCTION_PROXY_SUPPORT) | |
157 return true; | |
mef
2015/05/13 18:21:24
JNI_TRUE
bengr
2015/05/15 00:54:55
Done.
| |
158 #else | |
159 return false; | |
mef
2015/05/13 18:21:25
JNI_FALSE
bengr
2015/05/15 00:54:55
Done.
| |
160 #endif | |
161 } | |
162 | |
155 bool RegisterNativeTestServer(JNIEnv* env) { | 163 bool RegisterNativeTestServer(JNIEnv* env) { |
156 return RegisterNativesImpl(env); | 164 return RegisterNativesImpl(env); |
157 } | 165 } |
158 | 166 |
159 } // namespace cronet | 167 } // namespace cronet |
OLD | NEW |