Chromium Code Reviews| Index: net/android/network_change_notifier_android.cc |
| diff --git a/net/android/network_change_notifier_android.cc b/net/android/network_change_notifier_android.cc |
| index 473fa644eca3a15a2904577f4f2df9087c0f5f70..9963f927b61579061d96455606dcfe5b14f2821c 100644 |
| --- a/net/android/network_change_notifier_android.cc |
| +++ b/net/android/network_change_notifier_android.cc |
| @@ -13,25 +13,27 @@ namespace android { |
| NetworkChangeNotifier::NetworkChangeNotifier() { |
| JNIEnv* env = base::android::AttachCurrentThread(); |
| - CreateJavaObject(env); |
| + java_network_change_notifier_.Reset( |
| + Java_NetworkChangeNotifier_createInstance( |
| + env, |
| + base::android::GetApplicationContext(), |
| + reinterpret_cast<jint>(this))); |
| } |
| NetworkChangeNotifier::~NetworkChangeNotifier() { |
| JNIEnv* env = base::android::AttachCurrentThread(); |
| - Java_NetworkChangeNotifier_destroy( |
| - env, java_network_change_notifier_.obj()); |
| + Java_NetworkChangeNotifier_destroyInstance(env); |
| + java_network_change_notifier_.Reset(); |
| } |
| -void NetworkChangeNotifier::CreateJavaObject(JNIEnv* env) { |
| - java_network_change_notifier_.Reset( |
| - Java_NetworkChangeNotifier_create( |
| - env, |
| - base::android::GetApplicationContext(), |
| - reinterpret_cast<jint>(this))); |
| +void NetworkChangeNotifier::NotifyObserversOfConnectionTypeChange(JNIEnv* env, |
|
szym
2012/09/14 19:07:29
watch out for conflict with http://codereview.chro
gone
2012/09/15 01:01:55
Keeping an eye on it.
|
| + jobject obj) { |
| + net::NetworkChangeNotifier::NotifyObserversOfConnectionTypeChange(); |
| } |
| -void NetworkChangeNotifier::NotifyObservers(JNIEnv* env, jobject obj) { |
| - NotifyObserversOfConnectionTypeChange(); |
| +void NetworkChangeNotifier::ForceConnectivityState(bool state) { |
| + JNIEnv* env = base::android::AttachCurrentThread(); |
| + Java_NetworkChangeNotifier_forceConnectivityState(env, state); |
| } |
| net::NetworkChangeNotifier::ConnectionType |