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

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: Remove NON_EXPORTED_BASE where not needed. 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') | chrome/common/net/url_fetcher.cc » ('J')
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 06ad5f593ce34459b3965e9bdde0e4d2df41acde..d0b5134ea8db723a27531834bc21ecba8f244595 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"
@@ -203,6 +204,10 @@
#include "views/touchui/touch_factory.h"
#endif
+namespace net {
+class NetLog;
+}
yzshen1 2011/05/25 03:49:06 Please add "// namespace net"
Jói 2011/05/25 14:30:35 Done.
+
// BrowserMainParts ------------------------------------------------------------
BrowserMainParts::BrowserMainParts(const MainFunctionParams& parameters)
@@ -721,10 +726,18 @@ void InitializeNetworkOptions(const CommandLine& parsed_command_line) {
net::SpdySessionPool::set_max_sessions_per_domain(value);
}
+ SetDnsCertProvenanceCheckerFactory(CreateChromeDnsCertProvenanceChecker);
+}
+
+void InitializeURLRequestThrottlerManager(net::NetLog* net_log) {
net::URLRequestThrottlerManager::GetInstance()->set_enable_thread_checks(
true);
- SetDnsCertProvenanceCheckerFactory(CreateChromeDnsCertProvenanceChecker);
+ // 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
@@ -1391,6 +1404,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') | chrome/common/net/url_fetcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698