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

Side by Side Diff: net/url_request/url_request_throttler_manager.h

Issue 10440119: Introduce a delegate to avoid hardcoding "chrome-extension" in net/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review nit and merge to LKGR for commit. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_
6 #define NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // Set of hosts that have opted out. 134 // Set of hosts that have opted out.
135 OptOutHosts opt_out_hosts_; 135 OptOutHosts opt_out_hosts_;
136 136
137 // This keeps track of how many requests have been made. Used with 137 // This keeps track of how many requests have been made. Used with
138 // GarbageCollectEntries. 138 // GarbageCollectEntries.
139 unsigned int requests_since_last_gc_; 139 unsigned int requests_since_last_gc_;
140 140
141 // Valid after construction. 141 // Valid after construction.
142 GURL::Replacements url_id_replacements_; 142 GURL::Replacements url_id_replacements_;
143 143
144 // Whether we would like to reject outgoing HTTP requests during the back-off
145 // period.
146 bool enforce_throttling_;
147
148 // Certain tests do not obey the net component's threading policy, so we 144 // Certain tests do not obey the net component's threading policy, so we
149 // keep track of whether we're being used by tests, and turn off certain 145 // keep track of whether we're being used by tests, and turn off certain
150 // checks. 146 // checks.
151 // 147 //
152 // TODO(joi): See if we can fix the offending unit tests and remove this 148 // TODO(joi): See if we can fix the offending unit tests and remove this
153 // workaround. 149 // workaround.
154 bool enable_thread_checks_; 150 bool enable_thread_checks_;
155 151
156 // Initially false, switches to true once we have logged because of back-off 152 // Initially false, switches to true once we have logged because of back-off
157 // being disabled for localhost. 153 // being disabled for localhost.
158 bool logged_for_localhost_disabled_; 154 bool logged_for_localhost_disabled_;
159 155
160 // NetLog to use, if configured. 156 // NetLog to use, if configured.
161 BoundNetLog net_log_; 157 BoundNetLog net_log_;
162 158
163 // Valid once we've registered for network notifications. 159 // Valid once we've registered for network notifications.
164 base::PlatformThreadId registered_from_thread_; 160 base::PlatformThreadId registered_from_thread_;
165 161
166 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerManager); 162 DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerManager);
167 }; 163 };
168 164
169 } // namespace net 165 } // namespace net
170 166
171 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_ 167 #endif // NET_URL_REQUEST_URL_REQUEST_THROTTLER_MANAGER_H_
OLDNEW
« no previous file with comments | « net/url_request/url_request_throttler_entry_interface.h ('k') | net/url_request/url_request_throttler_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698