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 "quic_test_server.h" | 5 #include "quic_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/android/path_utils.h" | 9 #include "base/android/path_utils.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 | 97 |
98 void ShutdownQuicTestServer(JNIEnv* env, | 98 void ShutdownQuicTestServer(JNIEnv* env, |
99 const JavaParamRef<jclass>& /*jcaller*/) { | 99 const JavaParamRef<jclass>& /*jcaller*/) { |
100 DCHECK(!g_quic_server_thread->task_runner()->BelongsToCurrentThread()); | 100 DCHECK(!g_quic_server_thread->task_runner()->BelongsToCurrentThread()); |
101 g_quic_server_thread->task_runner()->PostTask( | 101 g_quic_server_thread->task_runner()->PostTask( |
102 FROM_HERE, base::Bind(&ShutdownOnServerThread)); | 102 FROM_HERE, base::Bind(&ShutdownOnServerThread)); |
103 delete g_quic_server_thread; | 103 delete g_quic_server_thread; |
104 } | 104 } |
105 | 105 |
106 ScopedJavaLocalRef<jstring> GetServerHost( | |
107 JNIEnv* env, | |
108 const JavaParamRef<jclass>& /*jcaller*/) { | |
109 return base::android::ConvertUTF8ToJavaString(env, kFakeQuicDomain); | |
110 } | |
111 | |
112 int GetServerPort(JNIEnv* env, const JavaParamRef<jclass>& /*jcaller*/) { | 106 int GetServerPort(JNIEnv* env, const JavaParamRef<jclass>& /*jcaller*/) { |
113 return kServerPort; | 107 return kServerPort; |
114 } | 108 } |
115 | 109 |
116 bool RegisterQuicTestServer(JNIEnv* env) { | 110 bool RegisterQuicTestServer(JNIEnv* env) { |
117 return RegisterNativesImpl(env); | 111 return RegisterNativesImpl(env); |
118 } | 112 } |
119 | 113 |
120 } // namespace cronet | 114 } // namespace cronet |
OLD | NEW |