| 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 | 8 |
| 9 #include "base/android/base_jni_onload.h" | 9 #include "base/android/base_jni_onload.h" |
| 10 #include "base/android/base_jni_registrar.h" | 10 #include "base/android/base_jni_registrar.h" |
| 11 #include "base/android/jni_android.h" | 11 #include "base/android/jni_android.h" |
| 12 #include "base/android/jni_registrar.h" | 12 #include "base/android/jni_registrar.h" |
| 13 #include "base/android/jni_utils.h" | 13 #include "base/android/jni_utils.h" |
| 14 #include "base/android/library_loader/library_loader_hooks.h" | 14 #include "base/android/library_loader/library_loader_hooks.h" |
| 15 #include "base/command_line.h" |
| 15 #include "base/logging.h" | 16 #include "base/logging.h" |
| 16 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 17 #include "components/cronet/android/chromium_url_request.h" | 18 #include "components/cronet/android/chromium_url_request.h" |
| 18 #include "components/cronet/android/chromium_url_request_context.h" | 19 #include "components/cronet/android/chromium_url_request_context.h" |
| 19 #include "components/cronet/android/cronet_histogram_manager.h" | 20 #include "components/cronet/android/cronet_histogram_manager.h" |
| 20 #include "components/cronet/android/cronet_upload_data_stream_delegate.h" | 21 #include "components/cronet/android/cronet_upload_data_stream_delegate.h" |
| 21 #include "components/cronet/android/cronet_url_request_adapter.h" | 22 #include "components/cronet/android/cronet_url_request_adapter.h" |
| 22 #include "components/cronet/android/cronet_url_request_context_adapter.h" | 23 #include "components/cronet/android/cronet_url_request_context_adapter.h" |
| 23 #include "jni/CronetLibraryLoader_jni.h" | 24 #include "jni/CronetLibraryLoader_jni.h" |
| 24 #include "net/android/net_jni_registrar.h" | 25 #include "net/android/net_jni_registrar.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 base::android::ScopedJavaLocalRef<jobject> scoped_app_context(env, | 92 base::android::ScopedJavaLocalRef<jobject> scoped_app_context(env, |
| 92 japp_context); | 93 japp_context); |
| 93 base::android::InitApplicationContext(env, scoped_app_context); | 94 base::android::InitApplicationContext(env, scoped_app_context); |
| 94 } | 95 } |
| 95 | 96 |
| 96 void CronetInitOnMainThread(JNIEnv* env, jclass jcaller) { | 97 void CronetInitOnMainThread(JNIEnv* env, jclass jcaller) { |
| 97 #if !defined(USE_ICU_ALTERNATIVES_ON_ANDROID) | 98 #if !defined(USE_ICU_ALTERNATIVES_ON_ANDROID) |
| 98 base::i18n::InitializeICU(); | 99 base::i18n::InitializeICU(); |
| 99 #endif | 100 #endif |
| 100 | 101 |
| 102 // TODO(bengr): Remove once Data Reduction Proxy no longer needs this for |
| 103 // configuration information. |
| 104 base::CommandLine::Init(0, nullptr); |
| 101 DCHECK(!base::MessageLoop::current()); | 105 DCHECK(!base::MessageLoop::current()); |
| 102 DCHECK(!g_main_message_loop); | 106 DCHECK(!g_main_message_loop); |
| 103 g_main_message_loop = new base::MessageLoopForUI(); | 107 g_main_message_loop = new base::MessageLoopForUI(); |
| 104 base::MessageLoopForUI::current()->Start(); | 108 base::MessageLoopForUI::current()->Start(); |
| 105 DCHECK(!g_network_change_notifier); | 109 DCHECK(!g_network_change_notifier); |
| 106 net::NetworkChangeNotifier::SetFactory( | 110 net::NetworkChangeNotifier::SetFactory( |
| 107 new net::NetworkChangeNotifierFactoryAndroid()); | 111 new net::NetworkChangeNotifierFactoryAndroid()); |
| 108 g_network_change_notifier = net::NetworkChangeNotifier::Create(); | 112 g_network_change_notifier = net::NetworkChangeNotifier::Create(); |
| 109 } | 113 } |
| 110 | 114 |
| 111 } // namespace cronet | 115 } // namespace cronet |
| OLD | NEW |