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

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

Issue 1967663002: Effectively disable the predictor's DNS queue for an experiment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add android test config (trybots previous) Created 4 years, 7 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 | « no previous file | testing/variations/fieldtrial_testing_config_android.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/predictor.cc
diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc
index a04cb13cd0e618c6fdce079eb0e0241cef61166c..08b0e4019d4be84b43b2ee137b8d3cb420d150e3 100644
--- a/chrome/browser/net/predictor.cc
+++ b/chrome/browser/net/predictor.cc
@@ -12,6 +12,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/containers/mru_cache.h"
+#include "base/feature_list.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
@@ -56,6 +57,11 @@ using content::BrowserThread;
namespace chrome_browser_net {
+namespace {
+ const base::Feature kDisablePredictorDNSQueue {
+ "DisablePredictorDNSQueue", base::FEATURE_DISABLED_BY_DEFAULT};
Alexei Svitkine (slow) 2016/05/10 19:23:04 I think this is confusing because you have a featu
Charlie Harrison 2016/05/10 20:42:14 Thanks for the suggestion. Done.
+}
+
// static
const int Predictor::kPredictorReferrerVersion = 2;
const double Predictor::kPreconnectWorthyExpectedValue = 0.8;
@@ -426,7 +432,8 @@ void Predictor::DiscardAllResults() {
assignees[url] = *info;
}
}
- DCHECK_LE(assignees.size(), max_concurrent_dns_lookups_);
+ DCHECK(base::FeatureList::IsEnabled(kDisablePredictorDNSQueue) ||
+ assignees.size() <= max_concurrent_dns_lookups_);
results_.clear();
// Put back in the names being worked on.
for (Results::iterator it = assignees.begin(); assignees.end() != it; ++it) {
@@ -1055,6 +1062,7 @@ UrlInfo* Predictor::AppendToResolutionQueue(
bool Predictor::CongestionControlPerformed(UrlInfo* info) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ DCHECK(!base::FeatureList::IsEnabled(kDisablePredictorDNSQueue));
// Note: queue_duration is ONLY valid after we go to assigned state.
if (info->queue_duration() < max_dns_queue_delay_)
return false;
@@ -1074,14 +1082,17 @@ bool Predictor::CongestionControlPerformed(UrlInfo* info) {
void Predictor::StartSomeQueuedResolutions() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ // If the queue is disabled, just make LookupRequests for all entries.
+ bool disable_queue = base::FeatureList::IsEnabled(kDisablePredictorDNSQueue);
while (!work_queue_.IsEmpty() &&
- pending_lookups_.size() < max_concurrent_dns_lookups_) {
+ (disable_queue ||
+ pending_lookups_.size() < max_concurrent_dns_lookups_)) {
const GURL url(work_queue_.Pop());
UrlInfo* info = &results_[url];
DCHECK(info->HasUrl(url));
info->SetAssignedState();
- if (CongestionControlPerformed(info)) {
+ if (!disable_queue && CongestionControlPerformed(info)) {
DCHECK(work_queue_.IsEmpty());
return;
}
« no previous file with comments | « no previous file | testing/variations/fieldtrial_testing_config_android.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698