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

Side by Side Diff: components/cronet/android/test/native_test_server.cc

Issue 1112513003: Put Data Reduction Proxy support in Cronet behind a gyp flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cronet
Patch Set: Created 5 years, 7 months 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698