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

Issue 2812963002: [Cronet] Move initialization to a new thread rather than the UI thread. (Closed)

Created:
3 years, 8 months ago by pauljensen
Modified:
3 years, 7 months ago
Reviewers:
kapishnikov, xunjieli
CC:
chromium-reviews, cbentzel+watch_chromium.org, agrieve+watch_chromium.org, net-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+221 lines, -86 lines) Patch
M components/cronet/android/cronet_library_loader.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M components/cronet/android/cronet_library_loader.cc View 1 2 3 4 5 6 7 4 chunks +10 lines, -6 lines 0 comments Download
M components/cronet/android/cronet_url_request_context_adapter.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -4 lines 0 comments Download
M components/cronet/android/cronet_url_request_context_adapter.cc View 1 2 3 4 5 6 7 4 chunks +7 lines, -6 lines 0 comments Download
M components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java View 1 2 3 4 5 6 7 8 5 chunks +43 lines, -26 lines 0 comments Download
M components/cronet/android/java/src/org/chromium/net/impl/CronetUrlRequestContext.java View 1 2 3 4 5 6 7 4 chunks +8 lines, -16 lines 0 comments Download
M net/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M net/android/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java View 1 2 3 4 5 6 7 15 chunks +61 lines, -23 lines 0 comments Download
M net/android/java/src/org/chromium/net/ProxyChangeListener.java View 1 2 3 4 5 6 7 7 chunks +43 lines, -5 lines 0 comments Download
A net/android/javatests/src/org/chromium/net/AndroidProxyConfigServiceTestUtil.java View 1 2 3 1 chunk +22 lines, -0 lines 0 comments Download
M net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -0 lines 0 comments Download
M net/proxy/proxy_config_service_android_unittest.cc View 1 2 3 4 5 6 3 chunks +14 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (12 generated)
pauljensen
Helen, could you review this? I think you're best suited to review as you've been ...
3 years, 8 months ago (2017-04-12 17:56:51 UTC) #4
xunjieli
On 2017/04/12 17:56:51, pauljensen wrote: > Helen, could you review this? I think you're best ...
3 years, 8 months ago (2017-04-13 15:12:59 UTC) #6
pauljensen
On 2017/04/13 15:12:59, xunjieli wrote: > On 2017/04/12 17:56:51, pauljensen wrote: > > Helen, could ...
3 years, 8 months ago (2017-04-13 16:32:48 UTC) #7
xunjieli
https://codereview.chromium.org/2812963002/diff/100001/components/cronet/android/cronet_library_loader.cc File components/cronet/android/cronet_library_loader.cc (right): https://codereview.chromium.org/2812963002/diff/100001/components/cronet/android/cronet_library_loader.cc#newcode75 components/cronet/android/cronet_library_loader.cc:75: bool OnInitThread() { This global static function will return ...
3 years, 8 months ago (2017-04-13 18:44:55 UTC) #8
pauljensen
https://codereview.chromium.org/2812963002/diff/100001/components/cronet/android/cronet_library_loader.cc File components/cronet/android/cronet_library_loader.cc (right): https://codereview.chromium.org/2812963002/diff/100001/components/cronet/android/cronet_library_loader.cc#newcode75 components/cronet/android/cronet_library_loader.cc:75: bool OnInitThread() { On 2017/04/13 18:44:54, xunjieli wrote: > ...
3 years, 7 months ago (2017-05-01 15:35:53 UTC) #9
xunjieli
lgtm! one question below. https://codereview.chromium.org/2812963002/diff/140001/components/cronet/android/cronet_library_loader.h File components/cronet/android/cronet_library_loader.h (right): https://codereview.chromium.org/2812963002/diff/140001/components/cronet/android/cronet_library_loader.h#newcode16 components/cronet/android/cronet_library_loader.h:16: // Only callable after initiailization ...
3 years, 7 months ago (2017-05-02 14:59:16 UTC) #10
pauljensen
https://codereview.chromium.org/2812963002/diff/140001/components/cronet/android/cronet_library_loader.h File components/cronet/android/cronet_library_loader.h (right): https://codereview.chromium.org/2812963002/diff/140001/components/cronet/android/cronet_library_loader.h#newcode16 components/cronet/android/cronet_library_loader.h:16: // Only callable after initiailization thread is started. On ...
3 years, 7 months ago (2017-05-02 20:35:55 UTC) #11
pauljensen
So I imagined this might slow down initialization because: 1. I'm introducing another thread that ...
3 years, 7 months ago (2017-05-03 15:29:55 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2812963002/160001
3 years, 7 months ago (2017-05-03 15:33:13 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/375614)
3 years, 7 months ago (2017-05-03 17:00:35 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2812963002/160001
3 years, 7 months ago (2017-05-03 17:03:06 UTC) #19
pauljensen
Helen, PTAL @ net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java I had to adjust the tests that send synthetic onReceived() updates ...
3 years, 7 months ago (2017-05-04 14:14:03 UTC) #21
xunjieli
On 2017/05/04 14:14:03, pauljensen wrote: > Helen, PTAL @ > net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java > I had to ...
3 years, 7 months ago (2017-05-05 00:04:45 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2812963002/180001
3 years, 7 months ago (2017-05-05 01:17:28 UTC) #24
commit-bot: I haz the power
3 years, 7 months ago (2017-05-05 03:00:50 UTC) #27
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/6815aefeae88a9e62065ca808407...

Powered by Google App Engine
This is Rietveld 408576698