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

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

Issue 11262018: Move AsyncDns field trial to server-side control. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/async_dns_field_trial.cc
diff --git a/chrome/browser/net/async_dns_field_trial.cc b/chrome/browser/net/async_dns_field_trial.cc
index 95ce472b48897f292f4db492b635c02d788dc9b0..5bb45cf1e217d550f30084cb19babe449a28f819 100644
--- a/chrome/browser/net/async_dns_field_trial.cc
+++ b/chrome/browser/net/async_dns_field_trial.cc
@@ -5,8 +5,8 @@
#include "chrome/browser/net/async_dns_field_trial.h"
#include "base/metrics/field_trial.h"
+#include "base/memory/ref_counted.h"
SteveT 2012/10/25 03:00:27 nit: Header out of order?
szym 2012/10/25 17:17:45 Done.
#include "build/build_config.h"
-#include "chrome/common/chrome_version_info.h"
namespace chrome_browser_net {
SteveT 2012/10/25 03:00:27 check: BTW the header comment is still applies in
szym 2012/10/25 03:03:13 Thanks for catching that. The header comment is 2
szym 2012/10/25 17:17:45 Done.
@@ -15,18 +15,14 @@ bool ConfigureAsyncDnsFieldTrial() {
// There is no DnsConfigService on those platforms so disable the field trial.
return false;
#endif
- const base::FieldTrial::Probability kAsyncDnsDivisor = 100;
- base::FieldTrial::Probability enabled_probability = 0;
+ scoped_refptr<base::FieldTrial> trial(base::FieldTrialList::Find("AsyncDns"));
Alexei Svitkine (slow) 2012/10/25 14:37:46 You could simplify all of this by just getting the
szym 2012/10/25 17:17:45 Done.
- if (chrome::VersionInfo::GetChannel() <= chrome::VersionInfo::CHANNEL_DEV)
- enabled_probability = 50;
+ if (!trial.get())
+ return false;
SteveT 2012/10/25 03:00:27 nit: Maybe have a comment here on how the two choi
szym 2012/10/25 17:17:45 Done.
- scoped_refptr<base::FieldTrial> trial(
- base::FieldTrialList::FactoryGetFieldTrial(
- "AsyncDns", kAsyncDnsDivisor, "disabled", 2012, 10, 30, NULL));
-
- int enabled_group = trial->AppendGroup("enabled", enabled_probability);
- return trial->group() == enabled_group;
+ const std::string kAsyncDnsPrefix("AsyncDns");
+ return trial->group_name().compare(0, kAsyncDnsPrefix.length(),
+ kAsyncDnsPrefix) == 0;
}
} // namespace chrome_browser_net
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698