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

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

Issue 9288084: Added Net logging to FileStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed copyright issue. Created 8 years, 10 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/net/passive_log_collector.h" 5 #include "chrome/browser/net/passive_log_collector.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 trackers_[net::NetLog::SOURCE_EXPONENTIAL_BACKOFF_THROTTLING] = 80 trackers_[net::NetLog::SOURCE_EXPONENTIAL_BACKOFF_THROTTLING] =
81 &exponential_backoff_throttling_tracker_; 81 &exponential_backoff_throttling_tracker_;
82 trackers_[net::NetLog::SOURCE_DNS_TRANSACTION] = &dns_transaction_tracker_; 82 trackers_[net::NetLog::SOURCE_DNS_TRANSACTION] = &dns_transaction_tracker_;
83 trackers_[net::NetLog::SOURCE_ASYNC_HOST_RESOLVER_REQUEST] = 83 trackers_[net::NetLog::SOURCE_ASYNC_HOST_RESOLVER_REQUEST] =
84 &async_host_resolver_request_tracker_; 84 &async_host_resolver_request_tracker_;
85 trackers_[net::NetLog::SOURCE_UDP_SOCKET] = &udp_socket_tracker_; 85 trackers_[net::NetLog::SOURCE_UDP_SOCKET] = &udp_socket_tracker_;
86 trackers_[net::NetLog::SOURCE_CERT_VERIFIER_JOB] = 86 trackers_[net::NetLog::SOURCE_CERT_VERIFIER_JOB] =
87 &cert_verifier_job_tracker_; 87 &cert_verifier_job_tracker_;
88 trackers_[net::NetLog::SOURCE_HTTP_PIPELINED_CONNECTION] = 88 trackers_[net::NetLog::SOURCE_HTTP_PIPELINED_CONNECTION] =
89 &http_pipelined_connection_tracker_; 89 &http_pipelined_connection_tracker_;
90 trackers_[net::NetLog::SOURCE_FILESTREAM] =
91 &file_stream_tracker_;
90 // Make sure our mapping is up-to-date. 92 // Make sure our mapping is up-to-date.
91 for (size_t i = 0; i < arraysize(trackers_); ++i) 93 for (size_t i = 0; i < arraysize(trackers_); ++i)
92 DCHECK(trackers_[i]) << "Unhandled SourceType: " << i; 94 DCHECK(trackers_[i]) << "Unhandled SourceType: " << i;
93 } 95 }
94 96
95 PassiveLogCollector::~PassiveLogCollector() { 97 PassiveLogCollector::~PassiveLogCollector() {
96 } 98 }
97 99
98 void PassiveLogCollector::OnAddEntry( 100 void PassiveLogCollector::OnAddEntry(
99 net::NetLog::EventType type, 101 net::NetLog::EventType type,
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 PassiveLogCollector::HttpPipelinedConnectionTracker::DoAddEntry( 839 PassiveLogCollector::HttpPipelinedConnectionTracker::DoAddEntry(
838 const ChromeNetLog::Entry& entry, 840 const ChromeNetLog::Entry& entry,
839 SourceInfo* out_info) { 841 SourceInfo* out_info) {
840 AddEntryToSourceInfo(entry, out_info); 842 AddEntryToSourceInfo(entry, out_info);
841 if (entry.type == net::NetLog::TYPE_HTTP_PIPELINED_CONNECTION && 843 if (entry.type == net::NetLog::TYPE_HTTP_PIPELINED_CONNECTION &&
842 entry.phase == net::NetLog::PHASE_END) { 844 entry.phase == net::NetLog::PHASE_END) {
843 return ACTION_MOVE_TO_GRAVEYARD; 845 return ACTION_MOVE_TO_GRAVEYARD;
844 } 846 }
845 return ACTION_NONE; 847 return ACTION_NONE;
846 } 848 }
849
850 //----------------------------------------------------------------------------
851 // FileStreamTracker
852 //----------------------------------------------------------------------------
853
854 const size_t
855 PassiveLogCollector::FileStreamTracker::kMaxNumSources = 100;
856
857 const size_t
858 PassiveLogCollector::FileStreamTracker::kMaxGraveyardSize = 25;
859
860 PassiveLogCollector::
861 FileStreamTracker::FileStreamTracker()
862 : SourceTracker(kMaxNumSources, kMaxGraveyardSize, NULL) {
863 }
864
865 PassiveLogCollector::SourceTracker::Action
866 PassiveLogCollector::FileStreamTracker::DoAddEntry(
867 const ChromeNetLog::Entry& entry,
868 SourceInfo* out_info) {
869 AddEntryToSourceInfo(entry, out_info);
870 if (entry.type == net::NetLog::TYPE_FILE_STREAM_ALIVE &&
871 entry.phase == net::NetLog::PHASE_END) {
872 return ACTION_MOVE_TO_GRAVEYARD;
873 }
874 return ACTION_NONE;
875 }
OLDNEW
« no previous file with comments | « chrome/browser/net/passive_log_collector.h ('k') | chrome/browser/resources/net_internals/events_view.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698