Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: components/cronet/android/network_change_notifier_initer.cc

Issue 2811813003: [Cronet] Move NetworkChangeNotifier initialization off UI thread (Closed)
Patch Set: fix NPE Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/cronet/android/network_change_notifier_initer.h"
6
7 #include <jni.h>
8
9 #include "jni/NetworkChangeNotifierIniter_jni.h"
10 #include "net/android/network_change_notifier_factory_android.h"
11 #include "net/base/network_change_notifier.h"
12
13 namespace cronet {
14
15 void NetworkChangeNotifierInit(
16 JNIEnv* env,
17 const base::android::JavaParamRef<jclass>& jcaller) {
18 net::NetworkChangeNotifier::SetFactory(
19 new net::NetworkChangeNotifierFactoryAndroid());
20 net::NetworkChangeNotifier::Create();
21 }
22
23 void NetworkChangeNotifierInit() {
24 JNIEnv* env = base::android::AttachCurrentThread();
25 Java_NetworkChangeNotifierIniter_init(env);
26 }
27
28 // Explicitly register static JNI functions.
29 bool NetworkChangeNotifierIniterRegisterJni(JNIEnv* env) {
30 return RegisterNativesImpl(env);
31 }
32
33 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698