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

Side by Side Diff: chrome/browser/about_flags.cc

Issue 2916533002: Introduce chrome://flags/#network-prediction-options-for-service-worker
Patch Set: use StartServiceWorkerForNavigationHint Created 3 years, 5 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 | « no previous file | chrome/browser/chrome_service_worker_browsertest.cc » ('j') | 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/about_flags.h" 5 #include "chrome/browser/about_flags.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 10 matching lines...) Expand all
21 #include "base/stl_util.h" 21 #include "base/stl_util.h"
22 #include "base/strings/string_number_conversions.h" 22 #include "base/strings/string_number_conversions.h"
23 #include "base/strings/string_util.h" 23 #include "base/strings/string_util.h"
24 #include "base/strings/utf_string_conversions.h" 24 #include "base/strings/utf_string_conversions.h"
25 #include "base/task_scheduler/switches.h" 25 #include "base/task_scheduler/switches.h"
26 #include "base/values.h" 26 #include "base/values.h"
27 #include "build/build_config.h" 27 #include "build/build_config.h"
28 #include "cc/base/switches.h" 28 #include "cc/base/switches.h"
29 #include "chrome/browser/experiments/memory_ablation_experiment.h" 29 #include "chrome/browser/experiments/memory_ablation_experiment.h"
30 #include "chrome/browser/flag_descriptions.h" 30 #include "chrome/browser/flag_descriptions.h"
31 #include "chrome/browser/net/prediction_options.h"
31 #include "chrome/browser/predictors/resource_prefetch_common.h" 32 #include "chrome/browser/predictors/resource_prefetch_common.h"
32 #include "chrome/browser/prerender/prerender_field_trial.h" 33 #include "chrome/browser/prerender/prerender_field_trial.h"
33 #include "chrome/common/channel_info.h" 34 #include "chrome/common/channel_info.h"
34 #include "chrome/common/chrome_content_client.h" 35 #include "chrome/common/chrome_content_client.h"
35 #include "chrome/common/chrome_features.h" 36 #include "chrome/common/chrome_features.h"
36 #include "chrome/common/chrome_switches.h" 37 #include "chrome/common/chrome_switches.h"
37 #include "chrome/common/features.h" 38 #include "chrome/common/features.h"
38 #include "chrome/common/pause_tabs_field_trial.h" 39 #include "chrome/common/pause_tabs_field_trial.h"
39 #include "components/autofill/core/browser/autofill_experiments.h" 40 #include "components/autofill/core/browser/autofill_experiments.h"
40 #include "components/autofill/core/common/autofill_switches.h" 41 #include "components/autofill/core/common/autofill_switches.h"
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 const FeatureEntry::FeatureParam kSpeculativeResourcePrefetchingLearning[] = { 854 const FeatureEntry::FeatureParam kSpeculativeResourcePrefetchingLearning[] = {
854 {predictors::kModeParamName, predictors::kLearningMode}}; 855 {predictors::kModeParamName, predictors::kLearningMode}};
855 856
856 const FeatureEntry::FeatureVariation 857 const FeatureEntry::FeatureVariation
857 kSpeculativeResourcePrefetchingFeatureVariations[] = { 858 kSpeculativeResourcePrefetchingFeatureVariations[] = {
858 {"Prefetching", kSpeculativeResourcePrefetchingPrefetching, 859 {"Prefetching", kSpeculativeResourcePrefetchingPrefetching,
859 arraysize(kSpeculativeResourcePrefetchingPrefetching), nullptr}, 860 arraysize(kSpeculativeResourcePrefetchingPrefetching), nullptr},
860 {"Learning", kSpeculativeResourcePrefetchingLearning, 861 {"Learning", kSpeculativeResourcePrefetchingLearning,
861 arraysize(kSpeculativeResourcePrefetchingLearning), nullptr}}; 862 arraysize(kSpeculativeResourcePrefetchingLearning), nullptr}};
862 863
864 const FeatureEntry::Choice kNetworkPredictionOptionsForServiceWorkerChoices[] =
865 {
866 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
867 {chrome_browser_net::kPreconnectOnly,
868 switches::kNetworkPredictionOptionsForServiceWorker,
869 chrome_browser_net::kPreconnectOnly},
870 {chrome_browser_net::kStartServiceWorkerAndPreconnect,
871 switches::kNetworkPredictionOptionsForServiceWorker,
872 chrome_browser_net::kStartServiceWorkerAndPreconnect},
873 {chrome_browser_net::kStartServiceWorkerAndDeferPreconnect,
874 switches::kNetworkPredictionOptionsForServiceWorker,
875 chrome_browser_net::kStartServiceWorkerAndDeferPreconnect},
876 {chrome_browser_net::kStartServiceWorkerOnly,
877 switches::kNetworkPredictionOptionsForServiceWorker,
878 chrome_browser_net::kStartServiceWorkerOnly},
879 };
880
863 #if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_MACOSX) || \ 881 #if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_MACOSX) || \
864 defined(OS_WIN) 882 defined(OS_WIN)
865 const FeatureEntry::FeatureParam kPauseBackgroundTabsMinimalEngagment[] = { 883 const FeatureEntry::FeatureParam kPauseBackgroundTabsMinimalEngagment[] = {
866 {pausetabs::kFeatureName, pausetabs::kModeParamMinimal}}; 884 {pausetabs::kFeatureName, pausetabs::kModeParamMinimal}};
867 885
868 const FeatureEntry::FeatureParam kPauseBackgroundTabsLowEngagment[] = { 886 const FeatureEntry::FeatureParam kPauseBackgroundTabsLowEngagment[] = {
869 {pausetabs::kFeatureName, pausetabs::kModeParamLow}}; 887 {pausetabs::kFeatureName, pausetabs::kModeParamLow}};
870 888
871 const FeatureEntry::FeatureParam kPauseBackgroundTabsMediumEngagment[] = { 889 const FeatureEntry::FeatureParam kPauseBackgroundTabsMediumEngagment[] = {
872 {pausetabs::kFeatureName, pausetabs::kModeParamMedium}}; 890 {pausetabs::kFeatureName, pausetabs::kModeParamMedium}};
(...skipping 1994 matching lines...) Expand 10 before | Expand all | Expand 10 after
2867 FEATURE_VALUE_TYPE(chrome::android::kCustomFeedbackUi)}, 2885 FEATURE_VALUE_TYPE(chrome::android::kCustomFeedbackUi)},
2868 #endif // OS_ANDROID 2886 #endif // OS_ANDROID
2869 2887
2870 {"enable-resource-prefetch", flag_descriptions::kSpeculativePrefetchName, 2888 {"enable-resource-prefetch", flag_descriptions::kSpeculativePrefetchName,
2871 flag_descriptions::kSpeculativePrefetchDescription, kOsAll, 2889 flag_descriptions::kSpeculativePrefetchDescription, kOsAll,
2872 FEATURE_WITH_PARAMS_VALUE_TYPE( 2890 FEATURE_WITH_PARAMS_VALUE_TYPE(
2873 predictors::kSpeculativeResourcePrefetchingFeature, 2891 predictors::kSpeculativeResourcePrefetchingFeature,
2874 kSpeculativeResourcePrefetchingFeatureVariations, 2892 kSpeculativeResourcePrefetchingFeatureVariations,
2875 "SpeculativeResourcePrefetchingValidation")}, 2893 "SpeculativeResourcePrefetchingValidation")},
2876 2894
2895 {"network-prediction-options-for-service-worker",
2896 flag_descriptions::kNetworkPredictionOptionsForServiceWorkerName,
2897 flag_descriptions::kNetworkPredictionOptionsForServiceWorkerDescription,
2898 kOsAll,
2899 MULTI_VALUE_TYPE(kNetworkPredictionOptionsForServiceWorkerChoices)},
2900
2877 {"enable-off-main-thread-fetch", flag_descriptions::kOffMainThreadFetchName, 2901 {"enable-off-main-thread-fetch", flag_descriptions::kOffMainThreadFetchName,
2878 flag_descriptions::kOffMainThreadFetchDescription, kOsAll, 2902 flag_descriptions::kOffMainThreadFetchDescription, kOsAll,
2879 FEATURE_VALUE_TYPE(features::kOffMainThreadFetch)}, 2903 FEATURE_VALUE_TYPE(features::kOffMainThreadFetch)},
2880 2904
2881 #if defined(OS_MACOSX) 2905 #if defined(OS_MACOSX)
2882 {"tab-strip-keyboard-focus", flag_descriptions::kTabStripKeyboardFocusName, 2906 {"tab-strip-keyboard-focus", flag_descriptions::kTabStripKeyboardFocusName,
2883 flag_descriptions::kTabStripKeyboardFocusDescription, kOsMac, 2907 flag_descriptions::kTabStripKeyboardFocusDescription, kOsMac,
2884 FEATURE_VALUE_TYPE(features::kTabStripKeyboardFocus)}, 2908 FEATURE_VALUE_TYPE(features::kTabStripKeyboardFocus)},
2885 #endif 2909 #endif
2886 2910
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
3326 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 3350 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
3327 3351
3328 const FeatureEntry* GetFeatureEntries(size_t* count) { 3352 const FeatureEntry* GetFeatureEntries(size_t* count) {
3329 *count = arraysize(kFeatureEntries); 3353 *count = arraysize(kFeatureEntries);
3330 return kFeatureEntries; 3354 return kFeatureEntries;
3331 } 3355 }
3332 3356
3333 } // namespace testing 3357 } // namespace testing
3334 3358
3335 } // namespace about_flags 3359 } // namespace about_flags
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_service_worker_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698