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

Unified Diff: trunk/src/net/url_request/url_request_throttler_manager.cc

Issue 19674007: Revert 212129 "Cleaning up TODO(joi) entries in //net." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 5 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
« no previous file with comments | « trunk/src/net/url_request/url_request_throttler_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/net/url_request/url_request_throttler_manager.cc
===================================================================
--- trunk/src/net/url_request/url_request_throttler_manager.cc (revision 212147)
+++ trunk/src/net/url_request/url_request_throttler_manager.cc (working copy)
@@ -18,6 +18,7 @@
URLRequestThrottlerManager::URLRequestThrottlerManager()
: requests_since_last_gc_(0),
+ enable_thread_checks_(false),
logged_for_localhost_disabled_(false),
registered_from_thread_(base::kInvalidThreadId) {
url_id_replacements_.ClearPassword();
@@ -49,7 +50,7 @@
scoped_refptr<URLRequestThrottlerEntryInterface>
URLRequestThrottlerManager::RegisterRequestUrl(const GURL &url) {
- DCHECK(CalledOnValidThread());
+ DCHECK(!enable_thread_checks_ || CalledOnValidThread());
// Normalize the url.
std::string url_id = GetIdFromUrl(url);
@@ -86,11 +87,10 @@
NetLog::StringCallback("host", &host));
}
- // If sliding window was separate from back-off throttling, we
- // could simply return a dummy implementation of
- // URLRequestThrottlerEntryInterface here that never blocks
- // anything (and not keep entries in url_entries_ for opted-out
- // sites).
+ // TODO(joi): Once sliding window is separate from back-off throttling,
+ // we can simply return a dummy implementation of
+ // URLRequestThrottlerEntryInterface here that never blocks anything (and
+ // not keep entries in url_entries_ for opted-out sites).
entry->DisableBackoffThrottling();
}
}
@@ -131,6 +131,14 @@
url_entries_.erase(url_id);
}
+void URLRequestThrottlerManager::set_enable_thread_checks(bool enable) {
+ enable_thread_checks_ = enable;
+}
+
+bool URLRequestThrottlerManager::enable_thread_checks() const {
+ return enable_thread_checks_;
+}
+
void URLRequestThrottlerManager::set_net_log(NetLog* net_log) {
DCHECK(net_log);
net_log_ = BoundNetLog::Make(net_log,
« no previous file with comments | « trunk/src/net/url_request/url_request_throttler_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698