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

Side by Side Diff: chrome/browser/net/passive_log_collector.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | chrome/browser/net/passive_log_collector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_ 5 #ifndef CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_
6 #define CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_ 6 #define CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <string> 10 #include <string>
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 static const size_t kMaxGraveyardSize; 334 static const size_t kMaxGraveyardSize;
335 335
336 explicit HttpStreamJobTracker(PassiveLogCollector* parent); 336 explicit HttpStreamJobTracker(PassiveLogCollector* parent);
337 337
338 private: 338 private:
339 virtual Action DoAddEntry(const ChromeNetLog::Entry& entry, 339 virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
340 SourceInfo* out_info); 340 SourceInfo* out_info);
341 DISALLOW_COPY_AND_ASSIGN(HttpStreamJobTracker); 341 DISALLOW_COPY_AND_ASSIGN(HttpStreamJobTracker);
342 }; 342 };
343 343
344 class ExponentialBackoffThrottlingTracker : public SourceTracker {
345 public:
346 static const size_t kMaxNumSources;
347 static const size_t kMaxGraveyardSize;
348
349 explicit ExponentialBackoffThrottlingTracker(PassiveLogCollector* parent);
350
351 private:
352 virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
353 SourceInfo* out_info);
354 DISALLOW_COPY_AND_ASSIGN(ExponentialBackoffThrottlingTracker);
355 };
356
344 357
345 PassiveLogCollector(); 358 PassiveLogCollector();
346 virtual ~PassiveLogCollector(); 359 virtual ~PassiveLogCollector();
347 360
348 // ThreadSafeObserver implementation: 361 // ThreadSafeObserver implementation:
349 virtual void OnAddEntry(net::NetLog::EventType type, 362 virtual void OnAddEntry(net::NetLog::EventType type,
350 const base::TimeTicks& time, 363 const base::TimeTicks& time,
351 const net::NetLog::Source& source, 364 const net::NetLog::Source& source,
352 net::NetLog::EventPhase phase, 365 net::NetLog::EventPhase phase,
353 net::NetLog::EventParameters* params); 366 net::NetLog::EventParameters* params);
(...skipping 20 matching lines...) Expand all
374 SocketTracker socket_tracker_; 387 SocketTracker socket_tracker_;
375 RequestTracker url_request_tracker_; 388 RequestTracker url_request_tracker_;
376 RequestTracker socket_stream_tracker_; 389 RequestTracker socket_stream_tracker_;
377 InitProxyResolverTracker init_proxy_resolver_tracker_; 390 InitProxyResolverTracker init_proxy_resolver_tracker_;
378 SpdySessionTracker spdy_session_tracker_; 391 SpdySessionTracker spdy_session_tracker_;
379 DNSRequestTracker dns_request_tracker_; 392 DNSRequestTracker dns_request_tracker_;
380 DNSJobTracker dns_job_tracker_; 393 DNSJobTracker dns_job_tracker_;
381 DiskCacheEntryTracker disk_cache_entry_tracker_; 394 DiskCacheEntryTracker disk_cache_entry_tracker_;
382 MemCacheEntryTracker mem_cache_entry_tracker_; 395 MemCacheEntryTracker mem_cache_entry_tracker_;
383 HttpStreamJobTracker http_stream_job_tracker_; 396 HttpStreamJobTracker http_stream_job_tracker_;
397 ExponentialBackoffThrottlingTracker exponential_backoff_throttling_tracker_;
384 398
385 // This array maps each NetLog::SourceType to one of the tracker instances 399 // This array maps each NetLog::SourceType to one of the tracker instances
386 // defined above. Use of this array avoid duplicating the list of trackers 400 // defined above. Use of this array avoid duplicating the list of trackers
387 // elsewhere. 401 // elsewhere.
388 SourceTrackerInterface* trackers_[net::NetLog::SOURCE_COUNT]; 402 SourceTrackerInterface* trackers_[net::NetLog::SOURCE_COUNT];
389 403
390 // The count of how many events have flowed through this log. Used to set the 404 // The count of how many events have flowed through this log. Used to set the
391 // "order" field on captured events. 405 // "order" field on captured events.
392 uint32 num_events_seen_; 406 uint32 num_events_seen_;
393 407
394 DISALLOW_COPY_AND_ASSIGN(PassiveLogCollector); 408 DISALLOW_COPY_AND_ASSIGN(PassiveLogCollector);
395 }; 409 };
396 410
397 #endif // CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_ 411 #endif // CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | chrome/browser/net/passive_log_collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698