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

Unified Diff: components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java

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 side-by-side diff with in-line comments
Download patch
Index: components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java
diff --git a/components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java b/components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java
index c7a7cb46b52ed2ece1448634f14f36b89cea496d..856d18f9dd7c4f35276ec6ba37fb3802ffe5aa18 100644
--- a/components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java
+++ b/components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java
@@ -12,7 +12,6 @@ import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.JNINamespace;
-import org.chromium.net.NetworkChangeNotifier;
/**
* CronetLibraryLoader loads and initializes native library on main thread.
@@ -86,17 +85,6 @@ public class CronetLibraryLoader {
if (sMainThreadInitDone) {
return;
}
- NetworkChangeNotifier.init(context);
- // Registers to always receive network notifications. Note
- // that this call is fine for Cronet because Cronet
- // embedders do not have API access to create network change
- // observers. Existing observers in the net stack do not
- // perform expensive work.
- NetworkChangeNotifier.registerToReceiveNotificationsAlways();
- // registerToReceiveNotificationsAlways() is called before the native
- // NetworkChangeNotifierAndroid is created, so as to avoid receiving
- // the undesired initial network change observer notification, which
- // will cause active requests to fail with ERR_NETWORK_CHANGED.
nativeCronetInitOnMainThread();
sMainThreadInitDone = true;
}

Powered by Google App Engine
This is Rietveld 408576698