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

Issue 617393005: Make URLRequestContextAdapter initialization asynchronous (Closed)

Created:
6 years, 2 months ago by xunjieli
Modified:
6 years, 2 months ago
Reviewers:
mef, mmenke
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Make URLRequestContextAdapter initialization asynchronous Currently we place a 2-second on URLRequestContextAdapter initialization, so that context can be initialized when embedders make requests. This CL changes so that tasks that depend on context being initialized will be run after the context is initialized properly, and URLRequestContextAdapter initialization won't block. BUG= Committed: https://crrev.com/be3c72f84d1b9421948cc1b1a813ee562cd74666 Cr-Commit-Position: refs/heads/master@{#299145}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Addressed Comments #

Patch Set 3 : Addressed comments #

Total comments: 1

Patch Set 4 : Removed mStarted #

Total comments: 8

Patch Set 5 : Addressed comments #

Total comments: 4

Patch Set 6 : Addressed comments #

Total comments: 12

Patch Set 7 : Addressed comments #

Total comments: 4

Patch Set 8 : Addressed Misha's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -14 lines) Patch
M components/cronet/android/java/src/org/chromium/net/ChromiumUrlRequestContext.java View 1 2 3 4 chunks +2 lines, -8 lines 0 comments Download
M components/cronet/android/url_request_adapter.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M components/cronet/android/url_request_adapter.cc View 1 2 3 4 5 6 7 13 chunks +24 lines, -4 lines 0 comments Download
M components/cronet/android/url_request_context_adapter.h View 1 2 3 4 5 6 7 4 chunks +25 lines, -0 lines 0 comments Download
M components/cronet/android/url_request_context_adapter.cc View 1 2 3 4 5 6 7 6 chunks +46 lines, -2 lines 0 comments Download

Messages

Total messages: 24 (3 generated)
xunjieli
This is the CL that implements the change we talked about earlier. PTAL. Thanks!
6 years, 2 months ago (2014-10-02 19:29:16 UTC) #2
mmenke
My main concern is testing this - it's complicated enough that we should have tests ...
6 years, 2 months ago (2014-10-02 19:51:18 UTC) #3
mmenke
Oh, and I should add - we should make sure we both have tests where ...
6 years, 2 months ago (2014-10-02 19:53:13 UTC) #4
xunjieli
Thanks Matt for bringing up the cases to think about! I have uploaded a new ...
6 years, 2 months ago (2014-10-02 21:39:42 UTC) #5
xunjieli
https://codereview.chromium.org/617393005/diff/40001/components/cronet/android/java/src/org/chromium/net/ChromiumUrlRequestContext.java File components/cronet/android/java/src/org/chromium/net/ChromiumUrlRequestContext.java (right): https://codereview.chromium.org/617393005/diff/40001/components/cronet/android/java/src/org/chromium/net/ChromiumUrlRequestContext.java#newcode91 components/cronet/android/java/src/org/chromium/net/ChromiumUrlRequestContext.java:91: mStarted.open(); I should probably get rid of mStarted completely, ...
6 years, 2 months ago (2014-10-02 21:52:28 UTC) #6
mmenke
https://codereview.chromium.org/617393005/diff/60001/components/cronet/android/url_request_adapter.cc File components/cronet/android/url_request_adapter.cc (right): https://codereview.chromium.org/617393005/diff/60001/components/cronet/android/url_request_adapter.cc#newcode173 components/cronet/android/url_request_adapter.cc:173: FROM_HERE, base::Bind(&URLRequestAdapter::OnDestroyRequest, this)); Sorry, this should also use RunTask, ...
6 years, 2 months ago (2014-10-02 22:11:53 UTC) #7
xunjieli
Thanks for the review! I have uploaded a new patch to address the comments. PTAL. ...
6 years, 2 months ago (2014-10-03 14:32:55 UTC) #9
mmenke
Just suggesting some DCHECKs out of paranoia, and then I'm happy with this. https://codereview.chromium.org/617393005/diff/100001/components/cronet/android/url_request_adapter.cc File ...
6 years, 2 months ago (2014-10-03 19:36:14 UTC) #10
xunjieli
I have uploaded a new patch to address the comments. PTAL. https://codereview.chromium.org/617393005/diff/100001/components/cronet/android/url_request_adapter.cc File components/cronet/android/url_request_adapter.cc (right): ...
6 years, 2 months ago (2014-10-03 20:09:55 UTC) #11
mmenke
LGTM, just nits. https://codereview.chromium.org/617393005/diff/120001/components/cronet/android/url_request_adapter.cc File components/cronet/android/url_request_adapter.cc (right): https://codereview.chromium.org/617393005/diff/120001/components/cronet/android/url_request_adapter.cc#newcode43 components/cronet/android/url_request_adapter.cc:43: URLRequestAdapter::~URLRequestAdapter() { Could have a DCHECK(OnNetworkThread()); ...
6 years, 2 months ago (2014-10-03 20:26:58 UTC) #12
xunjieli
Thanks for the review! I have also put a DCHECK(OnNetworkThread()) in URLRequestAdapter::OnAppendChunk, URLRequestAdapter::OnInitiateConnection, URLRequestAdapter::OnCancelRequest. I ...
6 years, 2 months ago (2014-10-03 20:39:52 UTC) #13
xunjieli
Pinging for reviews. Thanks!
6 years, 2 months ago (2014-10-10 13:19:10 UTC) #14
mmenke
On 2014/10/10 13:19:10, xunjieli wrote: > Pinging for reviews. Thanks! Not sure if you want ...
6 years, 2 months ago (2014-10-10 14:25:30 UTC) #15
xunjieli
Ok. Thanks Matt! Misha, could you take a look at this CL? thanks! On Fri, ...
6 years, 2 months ago (2014-10-10 14:45:33 UTC) #16
mef
On 2014/10/10 14:45:33, xunjieli wrote: > Ok. Thanks Matt! Misha, could you take a look ...
6 years, 2 months ago (2014-10-10 14:47:59 UTC) #17
mef
Looks pretty good with couple of questions / suggestions. Also, what about tests? https://codereview.chromium.org/617393005/diff/140001/components/cronet/android/url_request_adapter.cc File ...
6 years, 2 months ago (2014-10-10 15:06:27 UTC) #18
xunjieli
The tests are in a follow-up CL (https://codereview.chromium.org/624443003/), since this CL does not introduce any ...
6 years, 2 months ago (2014-10-10 17:25:45 UTC) #19
mef
lgtm
6 years, 2 months ago (2014-10-10 17:41:55 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/617393005/210001
6 years, 2 months ago (2014-10-10 17:43:55 UTC) #22
commit-bot: I haz the power
Committed patchset #8 (id:210001)
6 years, 2 months ago (2014-10-10 18:29:18 UTC) #23
commit-bot: I haz the power
6 years, 2 months ago (2014-10-10 18:30:22 UTC) #24
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/be3c72f84d1b9421948cc1b1a813ee562cd74666
Cr-Commit-Position: refs/heads/master@{#299145}

Powered by Google App Engine
This is Rietveld 408576698