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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 10185003: Remove net-internals page for throttling, introduce flag for extension devs instead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 984ebd8563ed002d5f6a5b60c1da423895d94293..9b33493462a82979bb8530f1e3c5df2012f804da 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -285,15 +285,25 @@ void InitializeNetworkOptions(const CommandLine& parsed_command_line) {
}
}
-void InitializeURLRequestThrottlerManager(net::NetLog* net_log) {
- net::URLRequestThrottlerManager::GetInstance()->set_enable_thread_checks(
- true);
+void InitializeURLRequestThrottlerManager(
+ const CommandLine& parsed_command_line,
+ net::NetLog* net_log) {
+ net::URLRequestThrottlerManager* manager =
+ net::URLRequestThrottlerManager::GetInstance();
+
+ // Always done in production, disabled only for unit tests.
+ manager->set_enable_thread_checks(true);
+
+ if (parsed_command_line.HasSwitch(
+ switches::kDisableExtensionsHttpThrottling)) {
+ manager->set_enforce_throttling(false);
+ }
// TODO(joi): Passing the NetLog here is temporary; once I switch the
// URLRequestThrottlerManager to be part of the URLRequestContext it will
// come from there. Doing it this way for now (2011/5/12) to try to fail
// fast in case A/B experiment gives unexpected results.
- net::URLRequestThrottlerManager::GetInstance()->set_net_log(net_log);
+ manager->set_net_log(net_log);
}
// Returns the new local state object, guaranteed non-NULL.
@@ -1334,7 +1344,8 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
#endif
InitializeNetworkOptions(parsed_command_line());
- InitializeURLRequestThrottlerManager(browser_process_->net_log());
+ InitializeURLRequestThrottlerManager(parsed_command_line(),
+ browser_process_->net_log());
// Initialize histogram synchronizer system. This is a singleton and is used
// for posting tasks via base::Bind. Its deleted when it goes out of scope.

Powered by Google App Engine
This is Rietveld 408576698