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

Issue 2449193002: Attempt an on-demand time fetch when encountering a date invalid error (Closed)

Created:
4 years, 1 month ago by estark
Modified:
4 years, 1 month ago
Reviewers:
meacer, mmenke
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Attempt an on-demand time fetch when encountering a date invalid error This CL calls NetworkTimeTracker::StartTimeFetch() when a cert date invalid error is encountered. If network time is not available, StartTimeFetch() will kick off an on-demand time query, calling a callback when it completes. Thus, when network time is unavailable, SSLErrorHandler now waits up to 3 seconds for a time query to complete before showing an interstitial. This is motivated by the fact that network time is unavailable (either due to lost sync or due to no successful time queries) for ~25% of cert date invalid errors. This is a series of patches to add on-demand time fetches when handling cert date invalid errors. CL #1: https://codereview.chromium.org/2447183002/ CL #2: https://codereview.chromium.org/2453523002/ CL #3: https://codereview.chromium.org/2449193002/ <== this one BUG=589700 Committed: https://crrev.com/5057f82a13bba2cd2a98539371f21188f3e28500 Cr-Commit-Position: refs/heads/master@{#430720}

Patch Set 1 #

Patch Set 2 : add a test for the timer expiring #

Patch Set 3 : fix comments #

Patch Set 4 : Use WeakPtr so that SSLErrorHandler can be destroyed #

Total comments: 8

Patch Set 5 : meacer comments #

Patch Set 6 : rebase #

Patch Set 7 : add browser tests (rough draft, not ready for review) #

Patch Set 8 : cleanup #

Total comments: 32

Patch Set 9 : rework browser tests, meacer comments #

Patch Set 10 : fix unit tests #

Patch Set 11 : fix unit tests again #

Patch Set 12 : add comments #

Patch Set 13 : remove unnecessary EmptyClosure #

Total comments: 26

Patch Set 14 : meacer comments #

Patch Set 15 : do not queue a non-delayed request #

Patch Set 16 : remove unnecessary allocation causing memory leak #

Total comments: 7

Patch Set 17 : meacer comments #

Total comments: 28

Patch Set 18 : mmenke comments #

Total comments: 1

Patch Set 19 : remove obsolete comment about network delegate #

Patch Set 20 : Check that network time query state is as expected before triggering response #

Total comments: 6

Patch Set 21 : meacer nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+913 lines, -75 lines) Patch
M chrome/browser/ssl/ssl_browser_tests.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +491 lines, -1 line 0 comments Download
M chrome/browser/ssl/ssl_error_handler.h View 1 2 3 6 chunks +14 lines, -3 lines 0 comments Download
M chrome/browser/ssl/ssl_error_handler.cc View 1 2 3 6 chunks +56 lines, -11 lines 0 comments Download
M chrome/browser/ssl/ssl_error_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 20 chunks +198 lines, -13 lines 0 comments Download
M chrome/test/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M components/network_time/network_time_test_utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +36 lines, -8 lines 0 comments Download
M components/network_time/network_time_test_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +55 lines, -21 lines 0 comments Download
M components/network_time/network_time_tracker.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -0 lines 0 comments Download
M components/network_time/network_time_tracker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 6 chunks +46 lines, -8 lines 0 comments Download
M components/network_time/network_time_tracker_unittest.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +9 lines, -8 lines 0 comments Download
M components/ssl_errors/error_classification_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -2 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 89 (60 generated)
estark
meacer: three of three. This uses the new StartTimeFetch() method to kick off time fetches ...
4 years, 1 month ago (2016-10-25 20:14:30 UTC) #5
meacer
Looking good. I think we might also want to add browser tests for this as ...
4 years, 1 month ago (2016-10-26 20:03:03 UTC) #13
estark
Added some browser tests, PTAL. In doing so, I changed the NetworkTimeTracker Finch param: now ...
4 years, 1 month ago (2016-10-31 16:03:25 UTC) #22
meacer
Looking good. Mostly questions and nits, but also a request for an additional test case ...
4 years, 1 month ago (2016-11-01 22:20:18 UTC) #23
estark
Ok, wphew, I took another pass at the browser tests. As discussed in person, when ...
4 years, 1 month ago (2016-11-02 19:58:13 UTC) #38
estark
(Btw you might want to diff against patch set 8)
4 years, 1 month ago (2016-11-02 20:03:45 UTC) #39
meacer
Thanks for adding the browser tests. Overall looking good again, just more questions and nits. ...
4 years, 1 month ago (2016-11-02 22:43:23 UTC) #42
meacer
https://codereview.chromium.org/2449193002/diff/240001/chrome/browser/ssl/ssl_browser_tests.cc File chrome/browser/ssl/ssl_browser_tests.cc (right): https://codereview.chromium.org/2449193002/diff/240001/chrome/browser/ssl/ssl_browser_tests.cc#newcode2977 chrome/browser/ssl/ssl_browser_tests.cc:2977: class SSLNetworkTimeIOThreadHelper { On 2016/11/02 22:43:22, Mustafa Emre Acer ...
4 years, 1 month ago (2016-11-02 22:44:38 UTC) #43
estark
https://codereview.chromium.org/2449193002/diff/240001/chrome/browser/ssl/ssl_browser_tests.cc File chrome/browser/ssl/ssl_browser_tests.cc (right): https://codereview.chromium.org/2449193002/diff/240001/chrome/browser/ssl/ssl_browser_tests.cc#newcode2863 chrome/browser/ssl/ssl_browser_tests.cc:2863: class DelayableTimeURLRequestJob : public net::URLRequestJob { On 2016/11/02 22:43:22, ...
4 years, 1 month ago (2016-11-03 01:36:05 UTC) #48
estark
(My brain is kind of fried so don't feel pressured to take another look tonight; ...
4 years, 1 month ago (2016-11-03 01:37:21 UTC) #49
estark
Ok, I think this is ready for another review. I'm getting all confused about the ...
4 years, 1 month ago (2016-11-03 17:39:52 UTC) #54
meacer
I think this is fine now, but now my brain has fried and I'd like ...
4 years, 1 month ago (2016-11-04 01:17:26 UTC) #57
meacer
Two more comments. https://codereview.chromium.org/2449193002/diff/300001/chrome/browser/ssl/ssl_browser_tests.cc File chrome/browser/ssl/ssl_browser_tests.cc (right): https://codereview.chromium.org/2449193002/diff/300001/chrome/browser/ssl/ssl_browser_tests.cc#newcode3026 chrome/browser/ssl/ssl_browser_tests.cc:3026: void TriggerTimeResponse(const base::Closure& callback) { Since ...
4 years, 1 month ago (2016-11-04 19:21:07 UTC) #58
estark
https://codereview.chromium.org/2449193002/diff/300001/chrome/browser/ssl/ssl_browser_tests.cc File chrome/browser/ssl/ssl_browser_tests.cc (right): https://codereview.chromium.org/2449193002/diff/300001/chrome/browser/ssl/ssl_browser_tests.cc#newcode3021 chrome/browser/ssl/ssl_browser_tests.cc:3021: weak_factory_.GetWeakPtr(), On 2016/11/04 01:17:26, Mustafa Emre Acer wrote: > ...
4 years, 1 month ago (2016-11-04 20:43:30 UTC) #59
meacer
https://codereview.chromium.org/2449193002/diff/300001/chrome/browser/ssl/ssl_browser_tests.cc File chrome/browser/ssl/ssl_browser_tests.cc (right): https://codereview.chromium.org/2449193002/diff/300001/chrome/browser/ssl/ssl_browser_tests.cc#newcode3021 chrome/browser/ssl/ssl_browser_tests.cc:3021: weak_factory_.GetWeakPtr(), On 2016/11/04 20:43:30, estark wrote: > On 2016/11/04 ...
4 years, 1 month ago (2016-11-04 22:23:00 UTC) #60
estark
mmenke, could you please take a look at the newly added test fixture and URLRequestInterceptor ...
4 years, 1 month ago (2016-11-04 22:54:53 UTC) #62
mmenke
Didn't do a full in-depth review, just focused on correctness of the Intercept/URLRequestJob stuff. If ...
4 years, 1 month ago (2016-11-07 15:27:46 UTC) #63
estark
Thanks, mmenke! No code changes yet, just a quick clarifying question inline. https://codereview.chromium.org/2449193002/diff/320001/chrome/browser/ssl/ssl_browser_tests.cc File chrome/browser/ssl/ssl_browser_tests.cc ...
4 years, 1 month ago (2016-11-07 17:17:19 UTC) #64
mmenke
https://codereview.chromium.org/2449193002/diff/320001/chrome/browser/ssl/ssl_browser_tests.cc File chrome/browser/ssl/ssl_browser_tests.cc (right): https://codereview.chromium.org/2449193002/diff/320001/chrome/browser/ssl/ssl_browser_tests.cc#newcode3034 chrome/browser/ssl/ssl_browser_tests.cc:3034: interceptor_ = new DelayedNetworkTimeInterceptor(); On 2016/11/07 17:17:19, estark wrote: ...
4 years, 1 month ago (2016-11-07 17:21:41 UTC) #65
estark
Thanks again. I addressed mmenke's comments. One thing that came up in doing so, and ...
4 years, 1 month ago (2016-11-07 23:24:00 UTC) #68
mmenke
https://codereview.chromium.org/2449193002/diff/320001/chrome/browser/ssl/ssl_browser_tests.cc File chrome/browser/ssl/ssl_browser_tests.cc (right): https://codereview.chromium.org/2449193002/diff/320001/chrome/browser/ssl/ssl_browser_tests.cc#newcode2970 chrome/browser/ssl/ssl_browser_tests.cc:2970: request->Resume(quit_closure); On 2016/11/07 23:24:00, estark wrote: > On 2016/11/07 ...
4 years, 1 month ago (2016-11-08 15:24:21 UTC) #71
estark
https://codereview.chromium.org/2449193002/diff/320001/chrome/browser/ssl/ssl_browser_tests.cc File chrome/browser/ssl/ssl_browser_tests.cc (right): https://codereview.chromium.org/2449193002/diff/320001/chrome/browser/ssl/ssl_browser_tests.cc#newcode2970 chrome/browser/ssl/ssl_browser_tests.cc:2970: request->Resume(quit_closure); On 2016/11/08 15:24:21, mmenke wrote: > On 2016/11/07 ...
4 years, 1 month ago (2016-11-08 17:54:01 UTC) #76
mmenke
On 2016/11/08 17:54:01, estark wrote: > https://codereview.chromium.org/2449193002/diff/320001/chrome/browser/ssl/ssl_browser_tests.cc > File chrome/browser/ssl/ssl_browser_tests.cc (right): > > https://codereview.chromium.org/2449193002/diff/320001/chrome/browser/ssl/ssl_browser_tests.cc#newcode2970 > ...
4 years, 1 month ago (2016-11-08 17:56:33 UTC) #77
estark
On 2016/11/08 17:56:33, mmenke wrote: > On 2016/11/08 17:54:01, estark wrote: > > > https://codereview.chromium.org/2449193002/diff/320001/chrome/browser/ssl/ssl_browser_tests.cc ...
4 years, 1 month ago (2016-11-08 19:04:24 UTC) #80
meacer
> In other words, if the test doesn't crash before or during tear-down, then we've ...
4 years, 1 month ago (2016-11-08 19:39:41 UTC) #81
estark
> I patched the CL and modified ssl_error_handler.cc to pass itself to > HandleCertDateInvalidErrorImpl as ...
4 years, 1 month ago (2016-11-08 19:46:34 UTC) #82
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/2449193002/400001
4 years, 1 month ago (2016-11-08 19:48:05 UTC) #85
commit-bot: I haz the power
Committed patchset #21 (id:400001)
4 years, 1 month ago (2016-11-08 21:35:29 UTC) #87
commit-bot: I haz the power
4 years, 1 month ago (2016-11-08 21:45:58 UTC) #89
Message was sent while issue was closed.
Patchset 21 (id:??) landed as
https://crrev.com/5057f82a13bba2cd2a98539371f21188f3e28500
Cr-Commit-Position: refs/heads/master@{#430720}

Powered by Google App Engine
This is Rietveld 408576698