| OLD | NEW |
| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 const char kDefaultPrerenderServiceURLPrefix[] = | 68 const char kDefaultPrerenderServiceURLPrefix[] = |
| 69 "https://clients4.google.com/prerenderservice/?q="; | 69 "https://clients4.google.com/prerenderservice/?q="; |
| 70 const int kMinPrerenderServiceTimeoutMs = 1; | 70 const int kMinPrerenderServiceTimeoutMs = 1; |
| 71 const int kMaxPrerenderServiceTimeoutMs = 10000; | 71 const int kMaxPrerenderServiceTimeoutMs = 10000; |
| 72 const int kDefaultPrerenderServiceTimeoutMs = 1000; | 72 const int kDefaultPrerenderServiceTimeoutMs = 1000; |
| 73 const char kSkipPrerenderLocalCanadidates[] = "SkipPrerenderLocalCandidates"; | 73 const char kSkipPrerenderLocalCanadidates[] = "SkipPrerenderLocalCandidates"; |
| 74 const char kSkipPrerenderServiceCanadidates[] = | 74 const char kSkipPrerenderServiceCanadidates[] = |
| 75 "SkipPrerenderServiceCandidates"; | 75 "SkipPrerenderServiceCandidates"; |
| 76 const char kDisableSessionStorageNamespaceMerging[] = | 76 const char kDisableSessionStorageNamespaceMerging[] = |
| 77 "DisableSessionStorageNamespaceMerging"; | 77 "DisableSessionStorageNamespaceMerging"; |
| 78 const char kPrerenderCookieStore[] = "PrerenderCookieStore"; |
| 78 | 79 |
| 79 void SetupPrerenderFieldTrial() { | 80 void SetupPrerenderFieldTrial() { |
| 80 const FieldTrial::Probability divisor = 1000; | 81 const FieldTrial::Probability divisor = 1000; |
| 81 | 82 |
| 82 FieldTrial::Probability control_probability; | 83 FieldTrial::Probability control_probability; |
| 83 FieldTrial::Probability experiment_multi_prerender_probability; | 84 FieldTrial::Probability experiment_multi_prerender_probability; |
| 84 FieldTrial::Probability experiment_15min_ttl_probability; | 85 FieldTrial::Probability experiment_15min_ttl_probability; |
| 85 FieldTrial::Probability experiment_no_use_probability; | 86 FieldTrial::Probability experiment_no_use_probability; |
| 86 | 87 |
| 87 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 88 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 bool SkipLocalPredictorServiceCandidates() { | 428 bool SkipLocalPredictorServiceCandidates() { |
| 428 return GetLocalPredictorSpecValue(kSkipPrerenderServiceCanadidates) == | 429 return GetLocalPredictorSpecValue(kSkipPrerenderServiceCanadidates) == |
| 429 kEnabledGroup; | 430 kEnabledGroup; |
| 430 } | 431 } |
| 431 | 432 |
| 432 bool ShouldMergeSessionStorageNamespaces() { | 433 bool ShouldMergeSessionStorageNamespaces() { |
| 433 return GetLocalPredictorSpecValue(kDisableSessionStorageNamespaceMerging) != | 434 return GetLocalPredictorSpecValue(kDisableSessionStorageNamespaceMerging) != |
| 434 kDisabledGroup; | 435 kDisabledGroup; |
| 435 } | 436 } |
| 436 | 437 |
| 438 bool IsPrerenderCookieStoreEnabled() { |
| 439 return GetLocalPredictorSpecValue(kPrerenderCookieStore) != kDisabledGroup && |
| 440 FieldTrialList::FindFullName(kPrerenderCookieStore) != kDisabledGroup; |
| 441 } |
| 442 |
| 437 } // namespace prerender | 443 } // namespace prerender |
| OLD | NEW |