Description[Cronet] Move initialization to a new thread rather than the UI thread.
The UI thread is generally overbooked (esp at app startup time) so
avoiding it can greatly improve Cronet startup time. The UI thread
was used for initialization previously because it simplified the
NetworkChangeNotifierAutoDetect and ProxyChangeListener logic because
BroadcastReceiver onReceived callbacks always happen on the UI thread
so those classes could be completely single-threaded. This change
leaves those classes single-threaded except for their onRecieved()
methods which now immediately post to the new initialization thread
and check whether their BroadcastReceivers are currently registered.
BUG=709336
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester
Review-Url: https://codereview.chromium.org/2812963002
Cr-Commit-Position: refs/heads/master@{#469578}
Committed: https://chromium.googlesource.com/chromium/src/+/6815aefeae88a9e62065ca8084075e3e98dec267
Patch Set 1 #Patch Set 2 : check isAlive #Patch Set 3 : fix ProxyChangeListener #Patch Set 4 : init looper for ProxyConfigService unittest #Patch Set 5 : init looper earlier #Patch Set 6 : mostly renaming #
Total comments: 20
Patch Set 7 : address Helen's comments #Patch Set 8 : sync #
Total comments: 4
Patch Set 9 : address Helen's comments #Patch Set 10 : update tests to account for mRegistered change #Messages
Total messages: 27 (12 generated)
|