diff options
author | agayev@chromium.org <agayev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-21 02:12:25 +0000 |
---|---|---|
committer | agayev@chromium.org <agayev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-21 02:12:25 +0000 |
commit | bae82aea7dc5fcf74e4832e0bfb9e365fd3cce3f (patch) | |
tree | c9137042423acee6e67b684f5bd2f480b2af8570 /chrome/browser/net/passive_log_collector.cc | |
parent | 5a138d8dab2da903a653760c375f0e7dbd2fedfd (diff) | |
download | chromium_src-bae82aea7dc5fcf74e4832e0bfb9e365fd3cce3f.zip chromium_src-bae82aea7dc5fcf74e4832e0bfb9e365fd3cce3f.tar.gz chromium_src-bae82aea7dc5fcf74e4832e0bfb9e365fd3cce3f.tar.bz2 |
Implemented AsyncHostResolver -- asynchronous HostResolver.
BUG=60149
TEST=net_unittests --gtest_filter="AsyncHostResolver*"
Review URL: http://codereview.chromium.org/7466011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93313 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/passive_log_collector.cc')
-rw-r--r-- | chrome/browser/net/passive_log_collector.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/chrome/browser/net/passive_log_collector.cc b/chrome/browser/net/passive_log_collector.cc index 6e522a7..ca321dd 100644 --- a/chrome/browser/net/passive_log_collector.cc +++ b/chrome/browser/net/passive_log_collector.cc @@ -78,6 +78,8 @@ PassiveLogCollector::PassiveLogCollector() trackers_[net::NetLog::SOURCE_EXPONENTIAL_BACKOFF_THROTTLING] = &exponential_backoff_throttling_tracker_; trackers_[net::NetLog::SOURCE_DNS_TRANSACTION] = &dns_transaction_tracker_; + trackers_[net::NetLog::SOURCE_ASYNC_HOST_RESOLVER_REQUEST] = + &async_host_resolver_request_tracker_; // Make sure our mapping is up-to-date. for (size_t i = 0; i < arraysize(trackers_); ++i) DCHECK(trackers_[i]) << "Unhandled SourceType: " << i; @@ -695,3 +697,30 @@ PassiveLogCollector::DnsTransactionTracker::DoAddEntry( } return ACTION_NONE; } + +//---------------------------------------------------------------------------- +// AsyncHostResolverRequestTracker +//---------------------------------------------------------------------------- + +const size_t +PassiveLogCollector::AsyncHostResolverRequestTracker::kMaxNumSources = 100; + +const size_t +PassiveLogCollector::AsyncHostResolverRequestTracker::kMaxGraveyardSize = 15; + +PassiveLogCollector:: + AsyncHostResolverRequestTracker::AsyncHostResolverRequestTracker() + : SourceTracker(kMaxNumSources, kMaxGraveyardSize, NULL) { +} + +PassiveLogCollector::SourceTracker::Action +PassiveLogCollector::AsyncHostResolverRequestTracker::DoAddEntry( + const ChromeNetLog::Entry& entry, + SourceInfo* out_info) { + AddEntryToSourceInfo(entry, out_info); + if (entry.type == net::NetLog::TYPE_ASYNC_HOST_RESOLVER_REQUEST && + entry.phase == net::NetLog::PHASE_END) { + return ACTION_MOVE_TO_GRAVEYARD; + } + return ACTION_NONE; +} |