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

Unified Diff: chrome/browser/net/passive_log_collector.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 | « chrome/browser/net/passive_log_collector.h ('k') | chrome/common/net/gaia/gaia_oauth_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/passive_log_collector.cc
diff --git a/chrome/browser/net/passive_log_collector.cc b/chrome/browser/net/passive_log_collector.cc
index 677e1d774649da600edd9d7ef2b61ffeab9ec4c9..9aa06c64350d80a73ba9e353b57758ccca2e8ba4 100644
--- a/chrome/browser/net/passive_log_collector.cc
+++ b/chrome/browser/net/passive_log_collector.cc
@@ -55,6 +55,8 @@ PassiveLogCollector::PassiveLogCollector()
ALLOW_THIS_IN_INITIALIZER_LIST(url_request_tracker_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(socket_stream_tracker_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(http_stream_job_tracker_(this)),
+ ALLOW_THIS_IN_INITIALIZER_LIST(
+ exponential_backoff_throttling_tracker_(this)),
num_events_seen_(0) {
// Define the mapping between source types and the tracker objects.
@@ -73,6 +75,8 @@ PassiveLogCollector::PassiveLogCollector()
trackers_[net::NetLog::SOURCE_DISK_CACHE_ENTRY] = &disk_cache_entry_tracker_;
trackers_[net::NetLog::SOURCE_MEMORY_CACHE_ENTRY] = &mem_cache_entry_tracker_;
trackers_[net::NetLog::SOURCE_HTTP_STREAM_JOB] = &http_stream_job_tracker_;
+ trackers_[net::NetLog::SOURCE_EXPONENTIAL_BACKOFF_THROTTLING] =
+ &exponential_backoff_throttling_tracker_;
// Make sure our mapping is up-to-date.
for (size_t i = 0; i < arraysize(trackers_); ++i)
DCHECK(trackers_[i]) << "Unhandled SourceType: " << i;
@@ -644,3 +648,25 @@ PassiveLogCollector::HttpStreamJobTracker::DoAddEntry(
return ACTION_NONE;
}
+
+//----------------------------------------------------------------------------
+// ExponentialBackoffThrottlingTracker
+//----------------------------------------------------------------------------
+
+const size_t PassiveLogCollector::
+ ExponentialBackoffThrottlingTracker::kMaxNumSources = 100;
+const size_t PassiveLogCollector::
+ ExponentialBackoffThrottlingTracker::kMaxGraveyardSize = 25;
+
+PassiveLogCollector::
+ ExponentialBackoffThrottlingTracker::ExponentialBackoffThrottlingTracker(
+ PassiveLogCollector* parent)
+ : SourceTracker(kMaxNumSources, kMaxGraveyardSize, parent) {
+}
+
+PassiveLogCollector::SourceTracker::Action
+PassiveLogCollector::ExponentialBackoffThrottlingTracker::DoAddEntry(
+ const ChromeNetLog::Entry& entry, SourceInfo* out_info) {
+ AddEntryToSourceInfo(entry, out_info);
+ return ACTION_NONE;
+}
« no previous file with comments | « chrome/browser/net/passive_log_collector.h ('k') | chrome/common/net/gaia/gaia_oauth_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698