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" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 DCHECK(!base::MessageLoop::current()); | 106 DCHECK(!base::MessageLoop::current()); |
107 DCHECK(!g_main_message_loop); | 107 DCHECK(!g_main_message_loop); |
108 g_main_message_loop = new base::MessageLoopForUI(); | 108 g_main_message_loop = new base::MessageLoopForUI(); |
109 base::MessageLoopForUI::current()->Start(); | 109 base::MessageLoopForUI::current()->Start(); |
110 DCHECK(!g_network_change_notifier); | 110 DCHECK(!g_network_change_notifier); |
111 net::NetworkChangeNotifier::SetFactory( | 111 net::NetworkChangeNotifier::SetFactory( |
112 new net::NetworkChangeNotifierFactoryAndroid()); | 112 new net::NetworkChangeNotifierFactoryAndroid()); |
113 g_network_change_notifier = net::NetworkChangeNotifier::Create(); | 113 g_network_change_notifier = net::NetworkChangeNotifier::Create(); |
114 } | 114 } |
115 | 115 |
116 ScopedJavaLocalRef<jstring> GetCronetVersion(JNIEnv* env, jclass jcaller) { | 116 jstring GetCronetVersion(JNIEnv* env, jclass jcaller) { |
117 return base::android::ConvertUTF8ToJavaString(env, CRONET_VERSION); | 117 return base::android::ConvertUTF8ToJavaString(env, CRONET_VERSION).Release(); |
118 } | 118 } |
119 | 119 |
120 } // namespace cronet | 120 } // namespace cronet |
OLD | NEW |