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

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

Issue 147215: Refactor DNS A/B experient, and add test of congestion time limits... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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/dns_master.h ('k') | chrome/browser/net/dns_master_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/dns_master.cc
===================================================================
--- chrome/browser/net/dns_master.cc (revision 19463)
+++ chrome/browser/net/dns_master.cc (working copy)
@@ -20,6 +20,8 @@
#include "net/base/host_resolver.h"
#include "net/base/net_errors.h"
+using base::TimeDelta;
+
namespace chrome_browser_net {
class DnsMaster::LookupRequest {
@@ -68,10 +70,12 @@
DnsMaster::DnsMaster(net::HostResolver* host_resolver,
MessageLoop* host_resolver_loop,
+ TimeDelta max_queue_delay,
size_t max_concurrent)
: peak_pending_lookups_(0),
shutdown_(false),
max_concurrent_lookups_(max_concurrent),
+ max_queue_delay_(max_queue_delay),
host_resolver_(host_resolver),
host_resolver_loop_(host_resolver_loop) {
}
@@ -350,7 +354,7 @@
}
if (!it->second.was_found())
continue; // Still being processed.
- if (base::TimeDelta() != it->second.benefits_remaining()) {
+ if (TimeDelta() != it->second.benefits_remaining()) {
network_hits.push_back(it->second); // With no benefit yet.
continue;
}
@@ -385,7 +389,7 @@
const std::string& hostname,
DnsHostInfo::ResolutionMotivation motivation) {
// DCHECK(We have the lock);
- DCHECK(0 != hostname.length());
+ DCHECK_NE(0u, hostname.length());
if (shutdown_)
return NULL;
@@ -444,9 +448,7 @@
bool DnsMaster::PreLockedCongestionControlPerformed(DnsHostInfo* info) {
// Note: queue_duration is ONLY valid after we go to assigned state.
- // TODO(jar): Tune selection of arbitrary 1 second constant. Add plumbing so
- // that this can be set as part of an A/B experiment.
- if (info->queue_duration() < base::TimeDelta::FromSeconds(1))
+ if (info->queue_duration() < max_queue_delay_)
return false;
// We need to discard all entries in our queue, as we're keeping them waiting
// too long. By doing this, we'll have a chance to quickly service urgent
« no previous file with comments | « chrome/browser/net/dns_master.h ('k') | chrome/browser/net/dns_master_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698