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

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

Issue 7517016: Add prerender to ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add prerender_condition.h and OVERRIDE Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 29 matching lines...) Expand all
40 } else if (switch_value == switches::kPrerenderSwitchValuePrefetchOnly) { 40 } else if (switch_value == switches::kPrerenderSwitchValuePrefetchOnly) {
41 prerender_option = PRERENDER_OPTION_PREFETCH_ONLY; 41 prerender_option = PRERENDER_OPTION_PREFETCH_ONLY;
42 } else { 42 } else {
43 prerender_option = PRERENDER_OPTION_DISABLED; 43 prerender_option = PRERENDER_OPTION_DISABLED;
44 LOG(ERROR) << "Invalid --prerender option received on command line: " 44 LOG(ERROR) << "Invalid --prerender option received on command line: "
45 << switch_value; 45 << switch_value;
46 LOG(ERROR) << "Disabling prerendering!"; 46 LOG(ERROR) << "Disabling prerendering!";
47 } 47 }
48 } 48 }
49 49
50 #if defined(OS_CHROMEOS)
51 // Prerender is not enabled on CrOS by default..
52 // http://crosbug.com/12483
53 if (prerender_option == PRERENDER_OPTION_AUTO)
54 prerender_option = PRERENDER_OPTION_DISABLED;
55 #endif
56
57 switch (prerender_option) { 50 switch (prerender_option) {
58 case PRERENDER_OPTION_AUTO: { 51 case PRERENDER_OPTION_AUTO: {
59 const base::FieldTrial::Probability kPrefetchDivisor = 1000; 52 const base::FieldTrial::Probability kPrefetchDivisor = 1000;
60 const base::FieldTrial::Probability kYesPrefetchProbability = 0; 53 const base::FieldTrial::Probability kYesPrefetchProbability = 0;
61 const base::FieldTrial::Probability kPrerenderExp1Probability = 400; 54 const base::FieldTrial::Probability kPrerenderExp1Probability = 400;
62 const base::FieldTrial::Probability kPrerenderControl1Probability = 100; 55 const base::FieldTrial::Probability kPrerenderControl1Probability = 100;
63 const base::FieldTrial::Probability kPrerenderExp2Probability = 400; 56 const base::FieldTrial::Probability kPrerenderExp2Probability = 400;
64 const base::FieldTrial::Probability kPrerenderControl2Probability = 100; 57 const base::FieldTrial::Probability kPrerenderControl2Probability = 100;
65 58
66 scoped_refptr<base::FieldTrial> trial( 59 scoped_refptr<base::FieldTrial> trial(
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 default: 113 default:
121 NOTREACHED(); 114 NOTREACHED();
122 } 115 }
123 116
124 UMA_HISTOGRAM_ENUMERATION("Prerender.Sessions", 117 UMA_HISTOGRAM_ENUMERATION("Prerender.Sessions",
125 PrerenderManager::GetMode(), 118 PrerenderManager::GetMode(),
126 PrerenderManager::PRERENDER_MODE_MAX); 119 PrerenderManager::PRERENDER_MODE_MAX);
127 } 120 }
128 121
129 } // namespace prerender 122 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698