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

Side by Side Diff: chrome/browser/prerender/prerender_field_trial.cc

Issue 10900037: Adding more histograms to ResourcePrefetchPredictor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: ResourcePrefetchPredictor can only be enabled at startup. Created 8 years, 3 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/prerender/prerender_field_trial.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/prerender/prerender_field_trial.h" 5 #include "chrome/browser/prerender/prerender_field_trial.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 kSpeculativePrefetchingLearningTrialName, 267 kSpeculativePrefetchingLearningTrialName,
268 kDivisor, 268 kDivisor,
269 "SpeculativePrefetchingLearningEnabled", 269 "SpeculativePrefetchingLearningEnabled",
270 2012, 12, 30, 270 2012, 12, 30,
271 &g_speculative_prefetching_learning_default_group_number)); 271 &g_speculative_prefetching_learning_default_group_number));
272 speculative_prefetching_learning_trial->AppendGroup( 272 speculative_prefetching_learning_trial->AppendGroup(
273 "SpeculativePrefetchingDisabled", 273 "SpeculativePrefetchingDisabled",
274 kDisabledProbability); 274 kDisabledProbability);
275 } 275 }
276 276
277 bool IsSpeculativeResourcePrefetchingLearningEnabled(Profile* profile) { 277 bool IsSpeculativeResourcePrefetchingLearningEnabled() {
278 if (!profile)
dominich 2012/08/30 18:25:23 this might mean that tests with NULL profiles will
Shishir 2012/08/30 18:48:09 Digging a little deeper, I need to disable this wh
279 return false;
280
281 // Override any field trial groups if the user has set a command line flag. 278 // Override any field trial groups if the user has set a command line flag.
282 if (CommandLine::ForCurrentProcess()->HasSwitch( 279 if (CommandLine::ForCurrentProcess()->HasSwitch(
283 switches::kSpeculativeResourcePrefetching)) { 280 switches::kSpeculativeResourcePrefetching)) {
284 const std::string switch_value = 281 const std::string switch_value =
285 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 282 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
286 switches::kSpeculativeResourcePrefetching); 283 switches::kSpeculativeResourcePrefetching);
287 284
288 return switch_value == switches::kSpeculativeResourcePrefetchingLearning; 285 return switch_value == switches::kSpeculativeResourcePrefetchingLearning;
289 } 286 }
290 287
291 const int group = FieldTrialList::FindValue( 288 const int group = FieldTrialList::FindValue(
292 kSpeculativePrefetchingLearningTrialName); 289 kSpeculativePrefetchingLearningTrialName);
293 return group == g_speculative_prefetching_learning_default_group_number; 290 return group == g_speculative_prefetching_learning_default_group_number;
294 } 291 }
295 292
296 } // namespace prerender 293 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_field_trial.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698