| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 FROM_HERE, base::Bind(&ServeFilesFromDirectory, test_files_root)); | 70 FROM_HERE, base::Bind(&ServeFilesFromDirectory, test_files_root)); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void ShutdownQuicTestServer(JNIEnv* env, jclass /*jcaller*/) { | 73 void ShutdownQuicTestServer(JNIEnv* env, jclass /*jcaller*/) { |
| 74 DCHECK(!g_quic_server_thread->task_runner()->BelongsToCurrentThread()); | 74 DCHECK(!g_quic_server_thread->task_runner()->BelongsToCurrentThread()); |
| 75 g_quic_server_thread->task_runner()->PostTask( | 75 g_quic_server_thread->task_runner()->PostTask( |
| 76 FROM_HERE, base::Bind(&ShutdownOnServerThread)); | 76 FROM_HERE, base::Bind(&ShutdownOnServerThread)); |
| 77 delete g_quic_server_thread; | 77 delete g_quic_server_thread; |
| 78 } | 78 } |
| 79 | 79 |
| 80 jstring GetServerHost(JNIEnv* env, jclass /*jcaller*/) { | 80 ScopedJavaLocalRef<jstring> GetServerHost(JNIEnv* env, jclass /*jcaller*/) { |
| 81 return base::android::ConvertUTF8ToJavaString(env, kServerHost).Release(); | 81 return base::android::ConvertUTF8ToJavaString(env, kServerHost); |
| 82 } | 82 } |
| 83 | 83 |
| 84 int GetServerPort(JNIEnv* env, jclass /*jcaller*/) { | 84 int GetServerPort(JNIEnv* env, jclass /*jcaller*/) { |
| 85 return kServerPort; | 85 return kServerPort; |
| 86 } | 86 } |
| 87 | 87 |
| 88 bool RegisterQuicTestServer(JNIEnv* env) { | 88 bool RegisterQuicTestServer(JNIEnv* env) { |
| 89 return RegisterNativesImpl(env); | 89 return RegisterNativesImpl(env); |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace cronet | 92 } // namespace cronet |
| OLD | NEW |