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

Issue 1076853003: Refactor net::BackoffEntry to not require subclassing (Closed)

Created:
5 years, 8 months ago by johnme
Modified:
5 years, 8 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, zea+watch_chromium.org, oshima+watch_chromium.org, gcasto+watchlist_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, mkwst+watchlist-passwords_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor net::BackoffEntry to not require subclassing Before this patch, net::BackoffEntry had a virtual ImplGetTimeNow method that tests etc would override to change what time is considered "now". As suggested by rsleevi in https://codereview.chromium.org/1023473003, this patch removes that method, and instead makes net::BackoffEntry accept a base::TickClock in the constructor, to allow overriding the time without subclassing. (this will allow future changes to net::BackoffEntry without the fragile base class problem) Accordingly, I've removed all subclasses of BackoffEntry, and made them pass TickClocks instead; in most cases this has been a nice simplification. BUG=465399 TBR=stevenjb@chromium.org Committed: https://crrev.com/dce40c39e0d44436283fbc43fa9b708153dd04e6 Cr-Commit-Position: refs/heads/master@{#325865}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : Fix ConnectionFactoryImplTest #

Total comments: 7

Patch Set 6 : Address mmenke's review comments #

Patch Set 7 : Make DataReductionProxyConfigServiceClient::Now non-const #

Total comments: 27

Patch Set 8 : Address pneubeck's review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+219 lines, -347 lines) Patch
M chrome/browser/captive_portal/captive_portal_service.h View 1 2 3 4 5 6 7 6 chunks +4 lines, -17 lines 0 comments Download
M chrome/browser/captive_portal/captive_portal_service.cc View 1 2 3 4 5 6 7 5 chunks +13 lines, -23 lines 0 comments Download
M chrome/browser/captive_portal/captive_portal_service_unittest.cc View 1 2 3 4 5 6 7 4 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/net/network_portal_detector_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/net/network_portal_detector_impl.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M chromeos/network/portal_detector/network_portal_detector_strategy.h View 1 2 3 4 5 6 7 5 chunks +6 lines, -8 lines 0 comments Download
M chromeos/network/portal_detector/network_portal_detector_strategy.cc View 3 chunks +4 lines, -20 lines 0 comments Download
M components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h View 1 2 3 4 5 6 7 3 chunks +9 lines, -22 lines 0 comments Download
M components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc View 1 2 3 4 5 6 7 3 chunks +3 lines, -16 lines 0 comments Download
M components/domain_reliability/scheduler.cc View 2 chunks +2 lines, -1 line 0 comments Download
M components/domain_reliability/util.h View 4 chunks +10 lines, -22 lines 0 comments Download
M components/domain_reliability/util.cc View 1 chunk +0 lines, -13 lines 0 comments Download
M components/password_manager/core/browser/affiliation_fetch_throttler.cc View 2 chunks +1 line, -25 lines 0 comments Download
M google_apis/gcm/engine/connection_factory_impl_unittest.cc View 2 chunks +2 lines, -23 lines 0 comments Download
M net/base/backoff_entry.h View 1 2 3 4 5 6 7 4 chunks +15 lines, -6 lines 0 comments Download
M net/base/backoff_entry.cc View 1 2 3 4 5 6 7 8 chunks +22 lines, -19 lines 0 comments Download
M net/base/backoff_entry_unittest.cc View 1 2 3 4 5 16 chunks +56 lines, -55 lines 0 comments Download
M net/url_request/url_request_throttler_simulation_unittest.cc View 4 chunks +11 lines, -16 lines 0 comments Download
M net/url_request/url_request_throttler_test_support.h View 1 2 3 4 5 1 chunk +10 lines, -8 lines 0 comments Download
M net/url_request/url_request_throttler_test_support.cc View 1 chunk +5 lines, -10 lines 0 comments Download
M net/url_request/url_request_throttler_unittest.cc View 10 chunks +32 lines, -32 lines 0 comments Download

Messages

Total messages: 26 (6 generated)
johnme
mmenke: please review overall patch, and give owners approval for: - net/ - chrome/browser/captive_portal/ - ...
5 years, 8 months ago (2015-04-10 12:02:17 UTC) #2
mmenke
https://codereview.chromium.org/1076853003/diff/80001/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h File components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h (right): https://codereview.chromium.org/1076853003/diff/80001/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h#newcode136 components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h:136: mutable TestTickClock tick_clock_; Why does this have to be ...
5 years, 8 months ago (2015-04-10 15:50:43 UTC) #3
mmenke
Also, thanks for doing this - I think the code looks cleaner with this in ...
5 years, 8 months ago (2015-04-10 15:52:13 UTC) #4
johnme
Addressed review comments - thanks :) https://codereview.chromium.org/1076853003/diff/80001/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h File components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h (right): https://codereview.chromium.org/1076853003/diff/80001/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h#newcode136 components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h:136: mutable TestTickClock tick_clock_; ...
5 years, 8 months ago (2015-04-10 16:23:36 UTC) #5
mmenke
Still LGTM https://codereview.chromium.org/1076853003/diff/80001/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h File components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h (right): https://codereview.chromium.org/1076853003/diff/80001/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h#newcode136 components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h:136: mutable TestTickClock tick_clock_; On 2015/04/10 16:23:36, johnme ...
5 years, 8 months ago (2015-04-10 16:26:37 UTC) #6
johnme
On 2015/04/10 16:26:37, mmenke wrote: > Still LGTM > > https://codereview.chromium.org/1076853003/diff/80001/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h > File > components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h ...
5 years, 8 months ago (2015-04-10 16:48:48 UTC) #7
johnme
stevenjb: please give OWNERS approval for chromeos/network/ & chrome/browser/chromeos/net/ sclittle: please give OWNERS approval for ...
5 years, 8 months ago (2015-04-10 17:03:55 UTC) #9
vabr (Chromium)
components/password_manager/core/browser/affiliation_fetch_throttler.cc LGTM
5 years, 8 months ago (2015-04-10 17:15:48 UTC) #10
sclittle
jeremyim@ is more familiar with that part of the data_reduction_proxy code; I'm tagging him in ...
5 years, 8 months ago (2015-04-10 17:56:02 UTC) #12
jeremyim
On 2015/04/10 17:56:02, sclittle wrote: > jeremyim@ is more familiar with that part of the ...
5 years, 8 months ago (2015-04-10 18:27:08 UTC) #13
Nicolas Zea
gcm LGTM
5 years, 8 months ago (2015-04-10 20:08:20 UTC) #14
stevenjb
https://codereview.chromium.org/1076853003/diff/120001/chromeos/network/portal_detector/network_portal_detector_strategy.h File chromeos/network/portal_detector/network_portal_detector_strategy.h (right): https://codereview.chromium.org/1076853003/diff/120001/chromeos/network/portal_detector/network_portal_detector_strategy.h#newcode27 chromeos/network/portal_detector/network_portal_detector_strategy.h:27: class Delegate : public base::TickClock { I'm not actually ...
5 years, 8 months ago (2015-04-13 15:20:11 UTC) #16
pneubeck (no reviews)
https://codereview.chromium.org/1076853003/diff/120001/chrome/browser/captive_portal/captive_portal_service.h File chrome/browser/captive_portal/captive_portal_service.h (right): https://codereview.chromium.org/1076853003/diff/120001/chrome/browser/captive_portal/captive_portal_service.h#newcode30 chrome/browser/captive_portal/captive_portal_service.h:30: private base::TickClock { as you've hidden TickClock::NowTicks below, TickClock ...
5 years, 8 months ago (2015-04-14 10:27:05 UTC) #17
johnme
Addressed pneubeck's review comments - thanks! https://codereview.chromium.org/1076853003/diff/120001/chrome/browser/captive_portal/captive_portal_service.h File chrome/browser/captive_portal/captive_portal_service.h (right): https://codereview.chromium.org/1076853003/diff/120001/chrome/browser/captive_portal/captive_portal_service.h#newcode30 chrome/browser/captive_portal/captive_portal_service.h:30: private base::TickClock { ...
5 years, 8 months ago (2015-04-20 15:52:45 UTC) #18
johnme
Forgot to reply to a comment. https://codereview.chromium.org/1076853003/diff/120001/chromeos/network/portal_detector/network_portal_detector_strategy.h File chromeos/network/portal_detector/network_portal_detector_strategy.h (right): https://codereview.chromium.org/1076853003/diff/120001/chromeos/network/portal_detector/network_portal_detector_strategy.h#newcode44 chromeos/network/portal_detector/network_portal_detector_strategy.h:44: static scoped_ptr<PortalDetectorStrategy> CreateById(StrategyId ...
5 years, 8 months ago (2015-04-20 15:57:55 UTC) #19
pneubeck (no reviews)
lgtm https://codereview.chromium.org/1076853003/diff/120001/chrome/browser/captive_portal/captive_portal_service.h File chrome/browser/captive_portal/captive_portal_service.h (right): https://codereview.chromium.org/1076853003/diff/120001/chrome/browser/captive_portal/captive_portal_service.h#newcode30 chrome/browser/captive_portal/captive_portal_service.h:30: private base::TickClock { On 2015/04/20 15:52:44, johnme wrote: ...
5 years, 8 months ago (2015-04-20 16:35:50 UTC) #20
johnme
Thanks all for the reviews! TBR'ing stevenjb@chromium.org since he delegated to pneubeck, who gave his ...
5 years, 8 months ago (2015-04-20 17:00:29 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1076853003/140001
5 years, 8 months ago (2015-04-20 17:01:41 UTC) #24
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 8 months ago (2015-04-20 17:06:27 UTC) #25
commit-bot: I haz the power
5 years, 8 months ago (2015-04-20 17:07:13 UTC) #26
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/dce40c39e0d44436283fbc43fa9b708153dd04e6
Cr-Commit-Position: refs/heads/master@{#325865}

Powered by Google App Engine
This is Rietveld 408576698