| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 size_t max_graveyard_size, | 135 size_t max_graveyard_size, |
| 136 PassiveLogCollector* parent); | 136 PassiveLogCollector* parent); |
| 137 | 137 |
| 138 virtual ~SourceTracker(); | 138 virtual ~SourceTracker(); |
| 139 | 139 |
| 140 // SourceTrackerInterface implementation: | 140 // SourceTrackerInterface implementation: |
| 141 virtual void OnAddEntry(const Entry& entry); | 141 virtual void OnAddEntry(const Entry& entry); |
| 142 virtual void Clear(); | 142 virtual void Clear(); |
| 143 virtual void AppendAllEntries(EntryList* out) const; | 143 virtual void AppendAllEntries(EntryList* out) const; |
| 144 | 144 |
| 145 // Finds a source info with given id. | |
| 146 SourceInfo* GetSourceInfo(uint32 id); | |
| 147 | |
| 148 #ifdef UNIT_TEST | 145 #ifdef UNIT_TEST |
| 149 // Helper used to inspect the current state by unit-tests. | 146 // Helper used to inspect the current state by unit-tests. |
| 150 // Retuns a copy of the source infos held by the tracker. | 147 // Retuns a copy of the source infos held by the tracker. |
| 151 SourceInfoList GetAllDeadOrAliveSources(bool is_alive) const { | 148 SourceInfoList GetAllDeadOrAliveSources(bool is_alive) const { |
| 152 SourceInfoList result; | 149 SourceInfoList result; |
| 153 for (SourceIDToInfoMap::const_iterator it = sources_.begin(); | 150 for (SourceIDToInfoMap::const_iterator it = sources_.begin(); |
| 154 it != sources_.end(); ++it) { | 151 it != sources_.end(); ++it) { |
| 155 if (it->second.is_alive == is_alive) | 152 if (it->second.is_alive == is_alive) |
| 156 result.push_back(it->second); | 153 result.push_back(it->second); |
| 157 } | 154 } |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 SourceTrackerInterface* trackers_[net::NetLog::SOURCE_COUNT]; | 323 SourceTrackerInterface* trackers_[net::NetLog::SOURCE_COUNT]; |
| 327 | 324 |
| 328 // The count of how many events have flowed through this log. Used to set the | 325 // The count of how many events have flowed through this log. Used to set the |
| 329 // "order" field on captured events. | 326 // "order" field on captured events. |
| 330 uint32 num_events_seen_; | 327 uint32 num_events_seen_; |
| 331 | 328 |
| 332 DISALLOW_COPY_AND_ASSIGN(PassiveLogCollector); | 329 DISALLOW_COPY_AND_ASSIGN(PassiveLogCollector); |
| 333 }; | 330 }; |
| 334 | 331 |
| 335 #endif // CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_ | 332 #endif // CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_ |
| OLD | NEW |