OLD | NEW |
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 <jni.h> | 5 #include <jni.h> |
6 | 6 |
7 #include "base/android/base_jni_registrar.h" | 7 #include "base/android/base_jni_registrar.h" |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_registrar.h" | 9 #include "base/android/jni_registrar.h" |
10 #include "components/cronet/android/cronet_library_loader.h" | 10 #include "components/cronet/android/cronet_library_loader.h" |
11 #include "mock_url_request_job_factory.h" | 11 #include "mock_url_request_job_factory.h" |
12 #include "native_test_server.h" | 12 #include "native_test_server.h" |
13 #include "network_change_notifier_util.h" | 13 #include "network_change_notifier_util.h" |
14 #include "quic_test_server.h" | 14 #include "quic_test_server.h" |
| 15 #include "sdch_test_util.h" |
15 #include "test_upload_data_stream_handler.h" | 16 #include "test_upload_data_stream_handler.h" |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
19 const base::android::RegistrationMethod kCronetTestsRegisteredMethods[] = { | 20 const base::android::RegistrationMethod kCronetTestsRegisteredMethods[] = { |
20 {"MockUrlRequestJobFactory", cronet::RegisterMockUrlRequestJobFactory}, | 21 {"MockUrlRequestJobFactory", cronet::RegisterMockUrlRequestJobFactory}, |
21 {"NativeTestServer", cronet::RegisterNativeTestServer}, | 22 {"NativeTestServer", cronet::RegisterNativeTestServer}, |
| 23 {"NetworkChangeNotifierUtil", cronet::RegisterNetworkChangeNotifierUtil}, |
22 {"QuicTestServer", cronet::RegisterQuicTestServer}, | 24 {"QuicTestServer", cronet::RegisterQuicTestServer}, |
23 {"NetworkChangeNotifierUtil", cronet::RegisterNetworkChangeNotifierUtil}, | 25 {"SdchTestUtil", cronet::RegisterSdchTestUtil}, |
24 {"TestUploadDataStreamHandlerRegisterJni", | 26 {"TestUploadDataStreamHandlerRegisterJni", |
25 cronet::TestUploadDataStreamHandlerRegisterJni}, | 27 cronet::TestUploadDataStreamHandlerRegisterJni}, |
26 }; | 28 }; |
27 | 29 |
28 } // namespace | 30 } // namespace |
29 | 31 |
30 // This is called by the VM when the shared library is first loaded. | 32 // This is called by the VM when the shared library is first loaded. |
31 // Checks the available version of JNI. Also, caches Java reflection artifacts. | 33 // Checks the available version of JNI. Also, caches Java reflection artifacts. |
32 extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) { | 34 extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) { |
33 JNIEnv* env; | 35 JNIEnv* env; |
(...skipping 11 matching lines...) Expand all Loading... |
45 arraysize(kCronetTestsRegisteredMethods))) { | 47 arraysize(kCronetTestsRegisteredMethods))) { |
46 return -1; | 48 return -1; |
47 } | 49 } |
48 return cronet_onload; | 50 return cronet_onload; |
49 } | 51 } |
50 | 52 |
51 extern "C" void JNI_OnUnLoad(JavaVM* vm, void* reserved) { | 53 extern "C" void JNI_OnUnLoad(JavaVM* vm, void* reserved) { |
52 cronet::CronetOnUnLoad(vm, reserved); | 54 cronet::CronetOnUnLoad(vm, reserved); |
53 } | 55 } |
54 | 56 |
OLD | NEW |