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