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" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
13 #include "base/test/test_support_android.h" | 13 #include "base/test/test_support_android.h" |
14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
15 #include "components/cronet/android/test/cronet_test_util.h" | 15 #include "components/cronet/android/test/cronet_test_util.h" |
16 #include "jni/QuicTestServer_jni.h" | 16 #include "jni/QuicTestServer_jni.h" |
17 #include "net/base/ip_address.h" | 17 #include "net/base/ip_address.h" |
18 #include "net/base/ip_endpoint.h" | 18 #include "net/base/ip_endpoint.h" |
19 #include "net/quic/chromium/crypto/proof_source_chromium.h" | 19 #include "net/quic/chromium/crypto/proof_source_chromium.h" |
20 #include "net/test/test_data_directory.h" | 20 #include "net/test/test_data_directory.h" |
21 #include "net/tools/quic/quic_in_memory_cache.h" | 21 #include "net/tools/quic/quic_in_memory_cache.h" |
22 #include "net/tools/quic/quic_simple_server.h" | 22 #include "net/tools/quic/quic_simple_server.h" |
23 | 23 |
| 24 using base::android::JavaParamRef; |
| 25 using base::android::ScopedJavaLocalRef; |
| 26 |
24 namespace cronet { | 27 namespace cronet { |
25 | 28 |
26 namespace { | 29 namespace { |
27 | 30 |
28 static const int kServerPort = 6121; | 31 static const int kServerPort = 6121; |
29 | 32 |
30 base::Thread* g_quic_server_thread = nullptr; | 33 base::Thread* g_quic_server_thread = nullptr; |
31 net::QuicSimpleServer* g_quic_server = nullptr; | 34 net::QuicSimpleServer* g_quic_server = nullptr; |
32 | 35 |
33 void StartOnServerThread(const base::FilePath& test_files_root, | 36 void StartOnServerThread(const base::FilePath& test_files_root, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 111 |
109 int GetServerPort(JNIEnv* env, const JavaParamRef<jclass>& /*jcaller*/) { | 112 int GetServerPort(JNIEnv* env, const JavaParamRef<jclass>& /*jcaller*/) { |
110 return kServerPort; | 113 return kServerPort; |
111 } | 114 } |
112 | 115 |
113 bool RegisterQuicTestServer(JNIEnv* env) { | 116 bool RegisterQuicTestServer(JNIEnv* env) { |
114 return RegisterNativesImpl(env); | 117 return RegisterNativesImpl(env); |
115 } | 118 } |
116 | 119 |
117 } // namespace cronet | 120 } // namespace cronet |
OLD | NEW |