Refactor net::BackoffEntry to not require subclassing
commitdce40c39e0d44436283fbc43fa9b708153dd04e6
authorjohnme <johnme@chromium.org>
Mon, 20 Apr 2015 17:06:20 +0000 (20 10:06 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 20 Apr 2015 17:06:21 +0000 (20 17:06 +0000)
treec680a23267bba048f057cddf9d04a2cb2e099e61
parent32be343ac9b22aa66d645aed4c701f127072aaab
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

Review URL: https://codereview.chromium.org/1076853003

Cr-Commit-Position: refs/heads/master@{#325865}
23 files changed:
chrome/browser/captive_portal/captive_portal_service.cc
chrome/browser/captive_portal/captive_portal_service.h
chrome/browser/captive_portal/captive_portal_service_unittest.cc
chrome/browser/chromeos/net/network_portal_detector_impl.cc
chrome/browser/chromeos/net/network_portal_detector_impl.h
chromeos/network/portal_detector/network_portal_detector_strategy.cc
chromeos/network/portal_detector/network_portal_detector_strategy.h
components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.cc
components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.h
components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc
components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h
components/domain_reliability/scheduler.cc
components/domain_reliability/util.cc
components/domain_reliability/util.h
components/password_manager/core/browser/affiliation_fetch_throttler.cc
google_apis/gcm/engine/connection_factory_impl_unittest.cc
net/base/backoff_entry.cc
net/base/backoff_entry.h
net/base/backoff_entry_unittest.cc
net/url_request/url_request_throttler_simulation_unittest.cc
net/url_request/url_request_throttler_test_support.cc
net/url_request/url_request_throttler_test_support.h
net/url_request/url_request_throttler_unittest.cc