Fix nativeShouldRun to return true for control.
Fix PrecacheLauncher::ShouldRun() to return true if the client is in the
experiment group or the control group. This allows TopHosts to run in the
control group, so that TopHosts-based metrics such as
History.TopHostsVisitsByRank and Precache.Latency.NonPrefetch.TopHosts will be
available for the control group as well as for the experiment group.
Also, rename the PrecacheManager methods to have more sensible names.
ShouldRun -> IsInExperimentGroup, WouldRun -> IsPrecachingAllowed, and
introducing IsInControlGroup.
BUG=499532
Review URL: https://codereview.chromium.org/1306733005
Cr-Commit-Position: refs/heads/master@{#346159}
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index 58254a8d8..bed47f7 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -121,7 +121,7 @@
precache::PrecacheManager* precache_manager =
precache::PrecacheManagerFactory::GetForBrowserContext(profile);
// |precache_manager| could be NULL if the profile is off the record.
- if (!precache_manager || !precache_manager->WouldRun())
+ if (!precache_manager || !precache_manager->IsPrecachingAllowed())
return;
precache_manager->RecordStatsForFetch(url, referrer, latency, fetch_time,