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

Unified Diff: chrome/browser/net/passive_log_collector.cc

Issue 8200011: Add NetLog support to UDP sockets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: ??? Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/passive_log_collector.cc
===================================================================
--- chrome/browser/net/passive_log_collector.cc (revision 106059)
+++ chrome/browser/net/passive_log_collector.cc (working copy)
@@ -80,6 +80,7 @@
trackers_[net::NetLog::SOURCE_DNS_TRANSACTION] = &dns_transaction_tracker_;
trackers_[net::NetLog::SOURCE_ASYNC_HOST_RESOLVER_REQUEST] =
&async_host_resolver_request_tracker_;
+ trackers_[net::NetLog::SOURCE_UDP_SOCKET] = &udp_socket_tracker_;
// Make sure our mapping is up-to-date.
for (size_t i = 0; i < arraysize(trackers_); ++i)
DCHECK(trackers_[i]) << "Unhandled SourceType: " << i;
@@ -724,3 +725,33 @@
}
return ACTION_NONE;
}
+
+//----------------------------------------------------------------------------
+// UDPSocketTracker
+//----------------------------------------------------------------------------
+
+const size_t PassiveLogCollector::UDPSocketTracker::kMaxNumSources = 200;
+const size_t PassiveLogCollector::UDPSocketTracker::kMaxGraveyardSize = 15;
+
+PassiveLogCollector::UDPSocketTracker::UDPSocketTracker()
+ : SourceTracker(kMaxNumSources, kMaxGraveyardSize, NULL) {
+}
+
+PassiveLogCollector::UDPSocketTracker::Action
+PassiveLogCollector::UDPSocketTracker::DoAddEntry(
+ const ChromeNetLog::Entry& entry,
+ SourceInfo* out_info) {
+ if (entry.type == net::NetLog::TYPE_UDP_BYTES_SENT ||
+ entry.type == net::NetLog::TYPE_UDP_BYTES_RECEIVED) {
+ return ACTION_NONE;
+ }
+
+ AddEntryToSourceInfo(entry, out_info);
+
+ if (entry.type == net::NetLog::TYPE_SOCKET_ALIVE &&
+ entry.phase == net::NetLog::PHASE_END) {
+ return ACTION_MOVE_TO_GRAVEYARD;
+ }
+
+ return ACTION_NONE;
+}
« 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