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

Unified Diff: chrome/browser/browser_main.cc

Issue 6966038: Anti-DDoS enhancements: Log to net log, UMA stats, improved policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head. Created 9 years, 7 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 | « no previous file | chrome/browser/net/passive_log_collector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_main.cc
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 596fe0eb5a85b82a0b087ab9738f85083c19cba5..8876c30f54675799e778d3c9b8c341c56465766d 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -52,6 +52,7 @@
#include "chrome/browser/metrics/thread_watcher.h"
#include "chrome/browser/net/chrome_dns_cert_provenance_checker.h"
#include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h"
+#include "chrome/browser/net/chrome_net_log.h"
#include "chrome/browser/net/predictor_api.h"
#include "chrome/browser/net/sdch_dictionary_fetcher.h"
#include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h"
@@ -204,6 +205,10 @@
#include "views/touchui/touch_factory.h"
#endif
+namespace net {
+class NetLog;
+} // namespace net
+
// BrowserMainParts ------------------------------------------------------------
BrowserMainParts::BrowserMainParts(const MainFunctionParams& parameters)
@@ -722,9 +727,6 @@ void InitializeNetworkOptions(const CommandLine& parsed_command_line) {
net::SpdySessionPool::set_max_sessions_per_domain(value);
}
- net::URLRequestThrottlerManager::GetInstance()->set_enable_thread_checks(
- true);
-
SetDnsCertProvenanceCheckerFactory(CreateChromeDnsCertProvenanceChecker);
if (parsed_command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) {
@@ -733,6 +735,17 @@ void InitializeNetworkOptions(const CommandLine& parsed_command_line) {
}
}
+void InitializeURLRequestThrottlerManager(net::NetLog* net_log) {
+ net::URLRequestThrottlerManager::GetInstance()->set_enable_thread_checks(
+ true);
+
+ // 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);
+}
+
// Creates key child threads. We need to do this explicitly since
// BrowserThread::PostTask silently deletes a posted task if the target message
// loop isn't created.
@@ -1409,6 +1422,7 @@ int BrowserMain(const MainFunctionParams& parameters) {
CommandLine::ForCurrentProcess());
InitializeNetworkOptions(parsed_command_line);
+ InitializeURLRequestThrottlerManager(browser_process->net_log());
// Initialize histogram synchronizer system. This is a singleton and is used
// for posting tasks via NewRunnableMethod. Its deleted when it goes out of
« no previous file with comments | « no previous file | chrome/browser/net/passive_log_collector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698