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

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

Issue 4067002: First pass at adding http/backend cache to NetLog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Removing class I decided not to use Created 10 years 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
OLDNEW
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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 DNSJobTracker(); 297 DNSJobTracker();
298 298
299 protected: 299 protected:
300 virtual Action DoAddEntry(const ChromeNetLog::Entry& entry, 300 virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
301 SourceInfo* out_info); 301 SourceInfo* out_info);
302 302
303 private: 303 private:
304 DISALLOW_COPY_AND_ASSIGN(DNSJobTracker); 304 DISALLOW_COPY_AND_ASSIGN(DNSJobTracker);
305 }; 305 };
306 306
307 // Tracks the log entries for the last seen SOURCE_HTTP_CACHE_ENTRY.
308 class HttpCacheEntryTracker : public SourceTracker {
309 public:
310 static const size_t kMaxNumSources;
311 static const size_t kMaxGraveyardSize;
312
313 HttpCacheEntryTracker();
314
315 protected:
316 virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
317 SourceInfo* out_info);
318
319 private:
320 DISALLOW_COPY_AND_ASSIGN(HttpCacheEntryTracker);
321 };
322
323 // Tracks the log entries for the last seen SOURCE_DISK_CACHE_ENTRY.
324 class DiskCacheEntryTracker : public SourceTracker {
325 public:
326 static const size_t kMaxNumSources;
327 static const size_t kMaxGraveyardSize;
328
329 DiskCacheEntryTracker();
330
331 protected:
332 virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
333 SourceInfo* out_info);
334
335 private:
336 DISALLOW_COPY_AND_ASSIGN(DiskCacheEntryTracker);
337 };
338
307 PassiveLogCollector(); 339 PassiveLogCollector();
308 ~PassiveLogCollector(); 340 ~PassiveLogCollector();
309 341
310 // ThreadSafeObserver implementation: 342 // ThreadSafeObserver implementation:
311 virtual void OnAddEntry(net::NetLog::EventType type, 343 virtual void OnAddEntry(net::NetLog::EventType type,
312 const base::TimeTicks& time, 344 const base::TimeTicks& time,
313 const net::NetLog::Source& source, 345 const net::NetLog::Source& source,
314 net::NetLog::EventPhase phase, 346 net::NetLog::EventPhase phase,
315 net::NetLog::EventParameters* params); 347 net::NetLog::EventParameters* params);
316 348
(...skipping 16 matching lines...) Expand all
333 365
334 GlobalSourceTracker global_source_tracker_; 366 GlobalSourceTracker global_source_tracker_;
335 ConnectJobTracker connect_job_tracker_; 367 ConnectJobTracker connect_job_tracker_;
336 SocketTracker socket_tracker_; 368 SocketTracker socket_tracker_;
337 RequestTracker url_request_tracker_; 369 RequestTracker url_request_tracker_;
338 RequestTracker socket_stream_tracker_; 370 RequestTracker socket_stream_tracker_;
339 InitProxyResolverTracker init_proxy_resolver_tracker_; 371 InitProxyResolverTracker init_proxy_resolver_tracker_;
340 SpdySessionTracker spdy_session_tracker_; 372 SpdySessionTracker spdy_session_tracker_;
341 DNSRequestTracker dns_request_tracker_; 373 DNSRequestTracker dns_request_tracker_;
342 DNSJobTracker dns_job_tracker_; 374 DNSJobTracker dns_job_tracker_;
375 HttpCacheEntryTracker http_cache_entry_tracker_;
376 DiskCacheEntryTracker disk_cache_entry_tracker_;
343 377
344 // This array maps each NetLog::SourceType to one of the tracker instances 378 // This array maps each NetLog::SourceType to one of the tracker instances
345 // defined above. Use of this array avoid duplicating the list of trackers 379 // defined above. Use of this array avoid duplicating the list of trackers
346 // elsewhere. 380 // elsewhere.
347 SourceTrackerInterface* trackers_[net::NetLog::SOURCE_COUNT]; 381 SourceTrackerInterface* trackers_[net::NetLog::SOURCE_COUNT];
348 382
349 // The count of how many events have flowed through this log. Used to set the 383 // The count of how many events have flowed through this log. Used to set the
350 // "order" field on captured events. 384 // "order" field on captured events.
351 uint32 num_events_seen_; 385 uint32 num_events_seen_;
352 386
353 DISALLOW_COPY_AND_ASSIGN(PassiveLogCollector); 387 DISALLOW_COPY_AND_ASSIGN(PassiveLogCollector);
354 }; 388 };
355 389
356 #endif // CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_ 390 #endif // CHROME_BROWSER_NET_PASSIVE_LOG_COLLECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698