| Index: components/cronet/android/network_change_notifier_initer.cc
|
| diff --git a/components/cronet/android/network_change_notifier_initer.cc b/components/cronet/android/network_change_notifier_initer.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..65d0b88f5b7af57edc388bc1dacf935494911757
|
| --- /dev/null
|
| +++ b/components/cronet/android/network_change_notifier_initer.cc
|
| @@ -0,0 +1,33 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "components/cronet/android/network_change_notifier_initer.h"
|
| +
|
| +#include <jni.h>
|
| +
|
| +#include "jni/NetworkChangeNotifierIniter_jni.h"
|
| +#include "net/android/network_change_notifier_factory_android.h"
|
| +#include "net/base/network_change_notifier.h"
|
| +
|
| +namespace cronet {
|
| +
|
| +void NetworkChangeNotifierInit(
|
| + JNIEnv* env,
|
| + const base::android::JavaParamRef<jclass>& jcaller) {
|
| + net::NetworkChangeNotifier::SetFactory(
|
| + new net::NetworkChangeNotifierFactoryAndroid());
|
| + net::NetworkChangeNotifier::Create();
|
| +}
|
| +
|
| +void NetworkChangeNotifierInit() {
|
| + JNIEnv* env = base::android::AttachCurrentThread();
|
| + Java_NetworkChangeNotifierIniter_init(env);
|
| +}
|
| +
|
| +// Explicitly register static JNI functions.
|
| +bool NetworkChangeNotifierIniterRegisterJni(JNIEnv* env) {
|
| + return RegisterNativesImpl(env);
|
| +}
|
| +
|
| +} // namespace cronet
|
|
|