| 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 "components/cronet/android/cronet_library_loader.h" | 5 #include "components/cronet/android/cronet_library_loader.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/android/base_jni_onload.h" | 10 #include "base/android/base_jni_onload.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "net/android/net_jni_registrar.h" | 29 #include "net/android/net_jni_registrar.h" |
| 30 #include "net/android/network_change_notifier_factory_android.h" | 30 #include "net/android/network_change_notifier_factory_android.h" |
| 31 #include "net/base/network_change_notifier.h" | 31 #include "net/base/network_change_notifier.h" |
| 32 #include "url/url_features.h" | 32 #include "url/url_features.h" |
| 33 #include "url/url_util.h" | 33 #include "url/url_util.h" |
| 34 | 34 |
| 35 #if !BUILDFLAG(USE_PLATFORM_ICU_ALTERNATIVES) | 35 #if !BUILDFLAG(USE_PLATFORM_ICU_ALTERNATIVES) |
| 36 #include "base/i18n/icu_util.h" // nogncheck | 36 #include "base/i18n/icu_util.h" // nogncheck |
| 37 #endif | 37 #endif |
| 38 | 38 |
| 39 using base::android::JavaParamRef; |
| 40 using base::android::ScopedJavaLocalRef; |
| 41 |
| 39 namespace cronet { | 42 namespace cronet { |
| 40 namespace { | 43 namespace { |
| 41 | 44 |
| 42 const base::android::RegistrationMethod kCronetRegisteredMethods[] = { | 45 const base::android::RegistrationMethod kCronetRegisteredMethods[] = { |
| 43 {"BaseAndroid", base::android::RegisterJni}, | 46 {"BaseAndroid", base::android::RegisterJni}, |
| 44 {"ChromiumUrlRequest", ChromiumUrlRequestRegisterJni}, | 47 {"ChromiumUrlRequest", ChromiumUrlRequestRegisterJni}, |
| 45 {"ChromiumUrlRequestContext", ChromiumUrlRequestContextRegisterJni}, | 48 {"ChromiumUrlRequestContext", ChromiumUrlRequestContextRegisterJni}, |
| 46 {"CronetBidirectionalStreamAdapter", | 49 {"CronetBidirectionalStreamAdapter", |
| 47 CronetBidirectionalStreamAdapter::RegisterJni}, | 50 CronetBidirectionalStreamAdapter::RegisterJni}, |
| 48 {"CronetLibraryLoader", RegisterNativesImpl}, | 51 {"CronetLibraryLoader", RegisterNativesImpl}, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 g_network_change_notifier = net::NetworkChangeNotifier::Create(); | 110 g_network_change_notifier = net::NetworkChangeNotifier::Create(); |
| 108 } | 111 } |
| 109 | 112 |
| 110 ScopedJavaLocalRef<jstring> GetCronetVersion( | 113 ScopedJavaLocalRef<jstring> GetCronetVersion( |
| 111 JNIEnv* env, | 114 JNIEnv* env, |
| 112 const JavaParamRef<jclass>& jcaller) { | 115 const JavaParamRef<jclass>& jcaller) { |
| 113 return base::android::ConvertUTF8ToJavaString(env, CRONET_VERSION); | 116 return base::android::ConvertUTF8ToJavaString(env, CRONET_VERSION); |
| 114 } | 117 } |
| 115 | 118 |
| 116 } // namespace cronet | 119 } // namespace cronet |
| OLD | NEW |