| 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,
|
|
|