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

Unified Diff: net/url_request/url_request_throttler_manager.cc

Issue 10440119: Introduce a delegate to avoid hardcoding "chrome-extension" in net/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge to LKGR Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request_throttler_manager.cc
diff --git a/net/url_request/url_request_throttler_manager.cc b/net/url_request/url_request_throttler_manager.cc
index 5c505587a465bfab5515cb9dc2c2c5d7f63e2092..a58365ea147eb5c444f1be4db9298f064b8448f6 100644
--- a/net/url_request/url_request_throttler_manager.cc
+++ b/net/url_request/url_request_throttler_manager.cc
@@ -16,12 +16,13 @@ namespace net {
const unsigned int URLRequestThrottlerManager::kMaximumNumberOfEntries = 1500;
const unsigned int URLRequestThrottlerManager::kRequestsBetweenCollecting = 200;
-URLRequestThrottlerManager::URLRequestThrottlerManager()
+URLRequestThrottlerManager::URLRequestThrottlerManager(
+ URLRequestThrottlerManagerDelegate* delegate)
: requests_since_last_gc_(0),
- enforce_throttling_(true),
enable_thread_checks_(false),
logged_for_localhost_disabled_(false),
- registered_from_thread_(base::kInvalidThreadId) {
+ registered_from_thread_(base::kInvalidThreadId),
+ delegate_(delegate) {
url_id_replacements_.ClearPassword();
url_id_replacements_.ClearUsername();
url_id_replacements_.ClearQuery();
@@ -35,10 +36,8 @@ URLRequestThrottlerManager::~URLRequestThrottlerManager() {
NetworkChangeNotifier::RemoveIPAddressObserver(this);
NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
- // Since, for now, the manager object might conceivably go away before
- // the entries, detach the entries' back-pointer to the manager.
- //
- // TODO(joi): Revisit whether to make entries non-refcounted.
+ // Since the manager object might conceivably go away before the
+ // entries, detach the entries' back-pointer to the manager.
UrlEntryMap::iterator i = url_entries_.begin();
while (i != url_entries_.end()) {
if (i->second != NULL) {
@@ -144,14 +143,6 @@ bool URLRequestThrottlerManager::enable_thread_checks() const {
return enable_thread_checks_;
}
-void URLRequestThrottlerManager::set_enforce_throttling(bool enforce) {
- enforce_throttling_ = enforce;
-}
-
-bool URLRequestThrottlerManager::enforce_throttling() {
- return enforce_throttling_;
-}
-
void URLRequestThrottlerManager::set_net_log(NetLog* net_log) {
DCHECK(net_log);
net_log_ = BoundNetLog::Make(net_log,

Powered by Google App Engine
This is Rietveld 408576698