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

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

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/base/backoff_entry.cc ('k') | trunk/src/net/url_request/url_request_throttler_manager.cc » ('j') | 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.h
===================================================================
--- trunk/src/net/url_request/url_request_throttler_manager.h (revision 212147)
+++ trunk/src/net/url_request/url_request_throttler_manager.h (working copy)
@@ -63,6 +63,12 @@
// It is only used by unit tests.
void EraseEntryForTests(const GURL& url);
+ // Turns threading model verification on or off. Any code that correctly
+ // uses the network stack should preferably call this function to enable
+ // verification of correct adherence to the network stack threading model.
+ void set_enable_thread_checks(bool enable);
+ bool enable_thread_checks() const;
+
// Whether throttling is enabled or not.
void set_enforce_throttling(bool enforce);
bool enforce_throttling();
@@ -134,6 +140,14 @@
// Valid after construction.
GURL::Replacements url_id_replacements_;
+ // Certain tests do not obey the net component's threading policy, so we
+ // keep track of whether we're being used by tests, and turn off certain
+ // checks.
+ //
+ // TODO(joi): See if we can fix the offending unit tests and remove this
+ // workaround.
+ bool enable_thread_checks_;
+
// Initially false, switches to true once we have logged because of back-off
// being disabled for localhost.
bool logged_for_localhost_disabled_;
« no previous file with comments | « trunk/src/net/base/backoff_entry.cc ('k') | trunk/src/net/url_request/url_request_throttler_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698