OLD | NEW |
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 // Appends all the captured entries to |out|. The ordering is undefined. | 84 // Appends all the captured entries to |out|. The ordering is undefined. |
85 virtual void AppendAllEntries(ChromeNetLog::EntryList* out) const = 0; | 85 virtual void AppendAllEntries(ChromeNetLog::EntryList* out) const = 0; |
86 }; | 86 }; |
87 | 87 |
88 // This source tracker is intended for TYPE_NONE. All entries go into a | 88 // This source tracker is intended for TYPE_NONE. All entries go into a |
89 // circular buffer, and there is no concept of live/dead requests. | 89 // circular buffer, and there is no concept of live/dead requests. |
90 class GlobalSourceTracker : public SourceTrackerInterface { | 90 class GlobalSourceTracker : public SourceTrackerInterface { |
91 public: | 91 public: |
92 GlobalSourceTracker(); | 92 GlobalSourceTracker(); |
93 ~GlobalSourceTracker(); | 93 virtual ~GlobalSourceTracker(); |
94 | 94 |
95 // SourceTrackerInterface implementation: | 95 // SourceTrackerInterface implementation: |
96 virtual void OnAddEntry(const ChromeNetLog::Entry& entry); | 96 virtual void OnAddEntry(const ChromeNetLog::Entry& entry); |
97 virtual void Clear(); | 97 virtual void Clear(); |
98 virtual void AppendAllEntries(ChromeNetLog::EntryList* out) const; | 98 virtual void AppendAllEntries(ChromeNetLog::EntryList* out) const; |
99 | 99 |
100 private: | 100 private: |
101 typedef std::deque<ChromeNetLog::Entry> CircularEntryList; | 101 typedef std::deque<ChromeNetLog::Entry> CircularEntryList; |
102 CircularEntryList entries_; | 102 CircularEntryList entries_; |
103 DISALLOW_COPY_AND_ASSIGN(GlobalSourceTracker); | 103 DISALLOW_COPY_AND_ASSIGN(GlobalSourceTracker); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 344 |
345 PassiveLogCollector(); | 345 PassiveLogCollector(); |
346 ~PassiveLogCollector(); | 346 virtual ~PassiveLogCollector(); |
347 | 347 |
348 // ThreadSafeObserver implementation: | 348 // ThreadSafeObserver implementation: |
349 virtual void OnAddEntry(net::NetLog::EventType type, | 349 virtual void OnAddEntry(net::NetLog::EventType type, |
350 const base::TimeTicks& time, | 350 const base::TimeTicks& time, |
351 const net::NetLog::Source& source, | 351 const net::NetLog::Source& source, |
352 net::NetLog::EventPhase phase, | 352 net::NetLog::EventPhase phase, |
353 net::NetLog::EventParameters* params); | 353 net::NetLog::EventParameters* params); |
354 | 354 |
355 // Clears all of the passively logged data. | 355 // Clears all of the passively logged data. |
356 void Clear(); | 356 void Clear(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 SourceTrackerInterface* trackers_[net::NetLog::SOURCE_COUNT]; | 388 SourceTrackerInterface* trackers_[net::NetLog::SOURCE_COUNT]; |
389 | 389 |
390 // The count of how many events have flowed through this log. Used to set the | 390 // The count of how many events have flowed through this log. Used to set the |
391 // "order" field on captured events. | 391 // "order" field on captured events. |
392 uint32 num_events_seen_; | 392 uint32 num_events_seen_; |
393 | 393 |
394 DISALLOW_COPY_AND_ASSIGN(PassiveLogCollector); | 394 DISALLOW_COPY_AND_ASSIGN(PassiveLogCollector); |
395 }; | 395 }; |
396 | 396 |
397 #endif // CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_ | 397 #endif // CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_ |
OLD | NEW |