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

Issue 2595723002: Allow CertNetFetcher to be shutdown from the network thread (Closed)

Created:
4 years ago by estark
Modified:
3 years, 11 months ago
Reviewers:
eroman
CC:
chromium-reviews, cbentzel+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow CertNetFetcher to be shut down from the network thread In order to be suitable for use from within CertVerifyProc, this CL makes CertNetFetcher shareable between the network and worker threads. The worker thread will start and wait for fetch requests, but the network thread needs to be able to create and shutdown the fetcher. Shutdown is needed to be able to destroy the URLRequestContext cleanly: since the CertNetFetcher will have a reference to the URLRequestContext, the network thread needs to be able to shut down the fetcher and cancel outstanding requests before destroying the URLRequestContext. Thus this CL makes CertNetFetcher refcounted (replacing its refcounted bridge class CertNetFetcherCore) and gives it a Shutdown method to cancel its outstanding requests and prevent new ones from starting. Note that there is still a race where a worker thread could issue a fetch request while the network thread is shutting down. In this case, the fetch task would never run on the network thread and WaitForResult would hang indefinitely. I'm not sure what to do about this except give WaitForResult() a timeout like nss_ocsp does. BUG=657549 Review-Url: https://codereview.chromium.org/2595723002 Cr-Commit-Position: refs/heads/master@{#443490} Committed: https://chromium.googlesource.com/chromium/src/+/6f57ec35020860e39d1b6f520169bbeb9f3790a8

Patch Set 1 #

Patch Set 2 : add shutdown flag, unit tests #

Patch Set 3 : update comments, and adapt for cert_verify_tool #

Patch Set 4 : tweak comments #

Total comments: 23

Patch Set 5 : eroman comments #

Patch Set 6 : fix AIA tests #

Total comments: 37

Patch Set 7 : eroman comments #

Total comments: 2

Patch Set 8 : fix verify tool #if #

Total comments: 17

Patch Set 9 : last round of eroman comments #

Total comments: 5

Patch Set 10 : update comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+406 lines, -231 lines) Patch
M net/cert/cert_net_fetcher.h View 1 2 3 4 5 6 3 chunks +15 lines, -7 lines 0 comments Download
M net/cert/internal/cert_issuer_source_aia.h View 1 2 3 4 5 2 chunks +5 lines, -5 lines 0 comments Download
M net/cert/internal/cert_issuer_source_aia.cc View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M net/cert/internal/cert_issuer_source_aia_unittest.cc View 1 2 3 4 5 6 19 chunks +54 lines, -38 lines 0 comments Download
M net/cert_net/cert_net_fetcher_impl.h View 1 2 3 4 1 chunk +8 lines, -8 lines 0 comments Download
M net/cert_net/cert_net_fetcher_impl.cc View 1 2 3 4 5 6 7 8 9 19 chunks +160 lines, -114 lines 0 comments Download
M net/cert_net/cert_net_fetcher_impl_unittest.cc View 1 2 3 4 5 6 24 chunks +153 lines, -57 lines 0 comments Download
M net/test/url_request/url_request_hanging_read_job.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M net/tools/cert_verify_tool/verify_using_path_builder.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 52 (33 generated)
estark
eroman, PTAL? https://codereview.chromium.org/2595723002/diff/60001/net/test/url_request/url_request_hanging_read_job.cc File net/test/url_request/url_request_hanging_read_job.cc (right): https://codereview.chromium.org/2595723002/diff/60001/net/test/url_request/url_request_hanging_read_job.cc#newcode95 net/test/url_request/url_request_hanging_read_job.cc:95: if (is_done()) This is a little weird. ...
4 years ago (2016-12-21 20:03:00 UTC) #11
estark
friendly ping
3 years, 11 months ago (2016-12-29 06:00:12 UTC) #14
eroman
https://codereview.chromium.org/2595723002/diff/60001/net/cert/cert_net_fetcher.h File net/cert/cert_net_fetcher.h (right): https://codereview.chromium.org/2595723002/diff/60001/net/cert/cert_net_fetcher.h#newcode49 net/cert/cert_net_fetcher.h:49: // Shuts down the CertNetFetcher and cancels outstanding requests. ...
3 years, 11 months ago (2017-01-03 20:42:38 UTC) #15
estark
https://codereview.chromium.org/2595723002/diff/60001/net/cert/cert_net_fetcher.h File net/cert/cert_net_fetcher.h (right): https://codereview.chromium.org/2595723002/diff/60001/net/cert/cert_net_fetcher.h#newcode49 net/cert/cert_net_fetcher.h:49: // Shuts down the CertNetFetcher and cancels outstanding requests. ...
3 years, 11 months ago (2017-01-05 19:08:40 UTC) #21
estark
Friendly ping (sorry to rush you... I'm reeeeeally hoping to get android AIA fetching into ...
3 years, 11 months ago (2017-01-09 22:43:27 UTC) #25
eroman
will review the new patchset asap today
3 years, 11 months ago (2017-01-10 19:25:46 UTC) #26
eroman
https://codereview.chromium.org/2595723002/diff/100001/net/cert/cert_net_fetcher.h File net/cert/cert_net_fetcher.h (right): https://codereview.chromium.org/2595723002/diff/100001/net/cert/cert_net_fetcher.h#newcode51 net/cert/cert_net_fetcher.h:51: // Request::WaitForResult() calls will be completed. Could you add ...
3 years, 11 months ago (2017-01-11 01:57:00 UTC) #27
estark
Thanks, PTAL. https://codereview.chromium.org/2595723002/diff/100001/net/cert/cert_net_fetcher.h File net/cert/cert_net_fetcher.h (right): https://codereview.chromium.org/2595723002/diff/100001/net/cert/cert_net_fetcher.h#newcode51 net/cert/cert_net_fetcher.h:51: // Request::WaitForResult() calls will be completed. On ...
3 years, 11 months ago (2017-01-12 01:06:31 UTC) #35
estark
https://codereview.chromium.org/2595723002/diff/100001/net/cert_net/cert_net_fetcher_impl.cc File net/cert_net/cert_net_fetcher_impl.cc (right): https://codereview.chromium.org/2595723002/diff/100001/net/cert_net/cert_net_fetcher_impl.cc#newcode736 net/cert_net/cert_net_fetcher_impl.cc:736: request->Cancel(); On 2017/01/12 01:06:31, estark wrote: > On 2017/01/11 ...
3 years, 11 months ago (2017-01-12 01:19:10 UTC) #36
eroman
Thanks, looks good! I will do a deeper review pass later tonight (I know you ...
3 years, 11 months ago (2017-01-12 02:11:37 UTC) #37
estark
On 2017/01/12 02:11:37, eroman (slow) wrote: > Thanks, looks good! > > I will do ...
3 years, 11 months ago (2017-01-12 02:17:24 UTC) #38
eroman
LGTM! https://codereview.chromium.org/2595723002/diff/160001/net/cert_net/cert_net_fetcher_impl.cc File net/cert_net/cert_net_fetcher_impl.cc (left): https://codereview.chromium.org/2595723002/diff/160001/net/cert_net/cert_net_fetcher_impl.cc#oldcode411 net/cert_net/cert_net_fetcher_impl.cc:411: // TODO(eroman): Don't post a task for this ...
3 years, 11 months ago (2017-01-13 01:13:53 UTC) #39
estark
Thanks! Will update the Android CL tomorrow. https://codereview.chromium.org/2595723002/diff/160001/net/cert_net/cert_net_fetcher_impl.cc File net/cert_net/cert_net_fetcher_impl.cc (right): https://codereview.chromium.org/2595723002/diff/160001/net/cert_net/cert_net_fetcher_impl.cc#newcode384 net/cert_net/cert_net_fetcher_impl.cc:384: void RequestCore::Cancel() ...
3 years, 11 months ago (2017-01-13 02:42:57 UTC) #40
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/2595723002/180001
3 years, 11 months ago (2017-01-13 02:43:39 UTC) #43
eroman
https://codereview.chromium.org/2595723002/diff/180001/net/cert_net/cert_net_fetcher_impl.cc File net/cert_net/cert_net_fetcher_impl.cc (right): https://codereview.chromium.org/2595723002/diff/180001/net/cert_net/cert_net_fetcher_impl.cc#newcode229 net/cert_net/cert_net_fetcher_impl.cc:229: // does not signal completion. Can be called from ...
3 years, 11 months ago (2017-01-13 02:51:18 UTC) #44
estark
https://codereview.chromium.org/2595723002/diff/180001/net/cert_net/cert_net_fetcher_impl.cc File net/cert_net/cert_net_fetcher_impl.cc (right): https://codereview.chromium.org/2595723002/diff/180001/net/cert_net/cert_net_fetcher_impl.cc#newcode229 net/cert_net/cert_net_fetcher_impl.cc:229: // does not signal completion. Can be called from ...
3 years, 11 months ago (2017-01-13 02:57:34 UTC) #46
eroman
lgtm https://codereview.chromium.org/2595723002/diff/180001/net/cert_net/cert_net_fetcher_impl.cc File net/cert_net/cert_net_fetcher_impl.cc (right): https://codereview.chromium.org/2595723002/diff/180001/net/cert_net/cert_net_fetcher_impl.cc#newcode401 net/cert_net/cert_net_fetcher_impl.cc:401: // Writing to |error_| or |job_| is safe ...
3 years, 11 months ago (2017-01-13 03:04:12 UTC) #47
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/2595723002/200001
3 years, 11 months ago (2017-01-13 03:05:51 UTC) #49
commit-bot: I haz the power
3 years, 11 months ago (2017-01-13 04:41:05 UTC) #52
Message was sent while issue was closed.
Committed patchset #10 (id:200001) as
https://chromium.googlesource.com/chromium/src/+/6f57ec35020860e39d1b6f520169...

Powered by Google App Engine
This is Rietveld 408576698