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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <string> | 10 #include <string> |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 | 276 |
277 SpdySessionTracker(); | 277 SpdySessionTracker(); |
278 | 278 |
279 protected: | 279 protected: |
280 virtual Action DoAddEntry(const Entry& entry, SourceInfo* out_info); | 280 virtual Action DoAddEntry(const Entry& entry, SourceInfo* out_info); |
281 | 281 |
282 private: | 282 private: |
283 DISALLOW_COPY_AND_ASSIGN(SpdySessionTracker); | 283 DISALLOW_COPY_AND_ASSIGN(SpdySessionTracker); |
284 }; | 284 }; |
285 | 285 |
| 286 // Tracks the log entries for the last seen SOURCE_HOST_RESOLVER_IMPL_REQUEST. |
| 287 class DNSRequestTracker : public SourceTracker { |
| 288 public: |
| 289 static const size_t kMaxNumSources; |
| 290 static const size_t kMaxGraveyardSize; |
| 291 |
| 292 DNSRequestTracker(); |
| 293 |
| 294 protected: |
| 295 virtual Action DoAddEntry(const Entry& entry, SourceInfo* out_info); |
| 296 |
| 297 private: |
| 298 DISALLOW_COPY_AND_ASSIGN(DNSRequestTracker); |
| 299 }; |
| 300 |
| 301 // Tracks the log entries for the last seen SOURCE_HOST_RESOLVER_IMPL_JOB. |
| 302 class DNSJobTracker : public SourceTracker { |
| 303 public: |
| 304 static const size_t kMaxNumSources; |
| 305 static const size_t kMaxGraveyardSize; |
| 306 |
| 307 DNSJobTracker(); |
| 308 |
| 309 protected: |
| 310 virtual Action DoAddEntry(const Entry& entry, SourceInfo* out_info); |
| 311 |
| 312 private: |
| 313 DISALLOW_COPY_AND_ASSIGN(DNSJobTracker); |
| 314 }; |
| 315 |
286 PassiveLogCollector(); | 316 PassiveLogCollector(); |
287 ~PassiveLogCollector(); | 317 ~PassiveLogCollector(); |
288 | 318 |
289 // Observer implementation: | 319 // Observer implementation: |
290 virtual void OnAddEntry(net::NetLog::EventType type, | 320 virtual void OnAddEntry(net::NetLog::EventType type, |
291 const base::TimeTicks& time, | 321 const base::TimeTicks& time, |
292 const net::NetLog::Source& source, | 322 const net::NetLog::Source& source, |
293 net::NetLog::EventPhase phase, | 323 net::NetLog::EventPhase phase, |
294 net::NetLog::EventParameters* params); | 324 net::NetLog::EventParameters* params); |
295 | 325 |
(...skipping 14 matching lines...) Expand all Loading... |
310 FRIEND_TEST_ALL_PREFIXES(PassiveLogCollectorTest, | 340 FRIEND_TEST_ALL_PREFIXES(PassiveLogCollectorTest, |
311 HoldReferenceToDeletedSource); | 341 HoldReferenceToDeletedSource); |
312 | 342 |
313 GlobalSourceTracker global_source_tracker_; | 343 GlobalSourceTracker global_source_tracker_; |
314 ConnectJobTracker connect_job_tracker_; | 344 ConnectJobTracker connect_job_tracker_; |
315 SocketTracker socket_tracker_; | 345 SocketTracker socket_tracker_; |
316 RequestTracker url_request_tracker_; | 346 RequestTracker url_request_tracker_; |
317 RequestTracker socket_stream_tracker_; | 347 RequestTracker socket_stream_tracker_; |
318 InitProxyResolverTracker init_proxy_resolver_tracker_; | 348 InitProxyResolverTracker init_proxy_resolver_tracker_; |
319 SpdySessionTracker spdy_session_tracker_; | 349 SpdySessionTracker spdy_session_tracker_; |
| 350 DNSRequestTracker dns_request_tracker_; |
| 351 DNSJobTracker dns_job_tracker_; |
320 | 352 |
321 // This array maps each NetLog::SourceType to one of the tracker instances | 353 // This array maps each NetLog::SourceType to one of the tracker instances |
322 // defined above. Use of this array avoid duplicating the list of trackers | 354 // defined above. Use of this array avoid duplicating the list of trackers |
323 // elsewhere. | 355 // elsewhere. |
324 SourceTrackerInterface* trackers_[net::NetLog::SOURCE_COUNT]; | 356 SourceTrackerInterface* trackers_[net::NetLog::SOURCE_COUNT]; |
325 | 357 |
326 // The count of how many events have flowed through this log. Used to set the | 358 // The count of how many events have flowed through this log. Used to set the |
327 // "order" field on captured events. | 359 // "order" field on captured events. |
328 uint32 num_events_seen_; | 360 uint32 num_events_seen_; |
329 | 361 |
330 DISALLOW_COPY_AND_ASSIGN(PassiveLogCollector); | 362 DISALLOW_COPY_AND_ASSIGN(PassiveLogCollector); |
331 }; | 363 }; |
332 | 364 |
333 #endif // CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_ | 365 #endif // CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_ |
OLD | NEW |