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

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

Issue 2810833002: Add memory ablation experiment. (Closed)
Patch Set: Rebase Created 3 years, 8 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/BUILD.gn ('k') | chrome/browser/chrome_browser_main.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>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/feature_list.h" 15 #include "base/feature_list.h"
16 #include "base/i18n/base_i18n_switches.h" 16 #include "base/i18n/base_i18n_switches.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/memory/singleton.h" 18 #include "base/memory/singleton.h"
19 #include "base/metrics/histogram_macros.h" 19 #include "base/metrics/histogram_macros.h"
20 #include "base/metrics/metrics_hashes.h" 20 #include "base/metrics/metrics_hashes.h"
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/flag_descriptions.h" 30 #include "chrome/browser/flag_descriptions.h"
30 #include "chrome/browser/ntp_snippets/ntp_snippets_features.h" 31 #include "chrome/browser/ntp_snippets/ntp_snippets_features.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"
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 {"(force test doodle 5)", kUseNewDoodleApiTest5, 833 {"(force test doodle 5)", kUseNewDoodleApiTest5,
833 arraysize(kUseNewDoodleApiTest5), nullptr}, 834 arraysize(kUseNewDoodleApiTest5), nullptr},
834 {"(force test doodle 6)", kUseNewDoodleApiTest6, 835 {"(force test doodle 6)", kUseNewDoodleApiTest6,
835 arraysize(kUseNewDoodleApiTest6), nullptr}, 836 arraysize(kUseNewDoodleApiTest6), nullptr},
836 {"(force test doodle 7)", kUseNewDoodleApiTest7, 837 {"(force test doodle 7)", kUseNewDoodleApiTest7,
837 arraysize(kUseNewDoodleApiTest7), nullptr}, 838 arraysize(kUseNewDoodleApiTest7), nullptr},
838 {"(force test doodle 8)", kUseNewDoodleApiTest8, 839 {"(force test doodle 8)", kUseNewDoodleApiTest8,
839 arraysize(kUseNewDoodleApiTest8), nullptr}}; 840 arraysize(kUseNewDoodleApiTest8), nullptr}};
840 #endif // OS_ANDROID 841 #endif // OS_ANDROID
841 842
843 const FeatureEntry::FeatureParam kMemoryAblation1MiB[] = {
844 {kMemoryAblationFeatureSizeParam, "1048576"}};
845 const FeatureEntry::FeatureParam kMemoryAblation5MiB[] = {
846 {kMemoryAblationFeatureSizeParam, "5242880"}};
847 const FeatureEntry::FeatureParam kMemoryAblation10MiB[] = {
848 {kMemoryAblationFeatureSizeParam, "10485760"}};
849 const FeatureEntry::FeatureParam kMemoryAblation50MiB[] = {
850 {kMemoryAblationFeatureSizeParam, "52428800"}};
851
852 const FeatureEntry::FeatureVariation kMemoryAblationFeatureVariations[] = {
853 {"1 MiB", kMemoryAblation1MiB, arraysize(kMemoryAblation1MiB), nullptr},
854 {"5 MiB", kMemoryAblation5MiB, arraysize(kMemoryAblation5MiB), nullptr},
855 {"10 MiB", kMemoryAblation10MiB, arraysize(kMemoryAblation10MiB), nullptr},
856 {"50 MiB", kMemoryAblation50MiB, arraysize(kMemoryAblation50MiB), nullptr}};
857
842 #if defined(OS_ANDROID) 858 #if defined(OS_ANDROID)
843 const FeatureEntry::FeatureParam kPersistentMenuItemEnabled[] = { 859 const FeatureEntry::FeatureParam kPersistentMenuItemEnabled[] = {
844 {"persistent_menu_item_enabled", "true"}}; 860 {"persistent_menu_item_enabled", "true"}};
845 861
846 const FeatureEntry::FeatureVariation kDataReductionMainMenuFeatureVariations[] = 862 const FeatureEntry::FeatureVariation kDataReductionMainMenuFeatureVariations[] =
847 {{"(persistent)", kPersistentMenuItemEnabled, 863 {{"(persistent)", kPersistentMenuItemEnabled,
848 arraysize(kPersistentMenuItemEnabled), nullptr}}; 864 arraysize(kPersistentMenuItemEnabled), nullptr}};
849 #endif // OS_ANDROID 865 #endif // OS_ANDROID
850 866
851 // RECORDING USER METRICS FOR FLAGS: 867 // RECORDING USER METRICS FOR FLAGS:
(...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 #endif // OS_CHROMEOS 2616 #endif // OS_CHROMEOS
2601 2617
2602 #if defined(OS_ANDROID) 2618 #if defined(OS_ANDROID)
2603 {"use-new-doodle-api", flag_descriptions::kUseNewDoodleApiName, 2619 {"use-new-doodle-api", flag_descriptions::kUseNewDoodleApiName,
2604 flag_descriptions::kUseNewDoodleApiDescription, kOsAndroid, 2620 flag_descriptions::kUseNewDoodleApiDescription, kOsAndroid,
2605 FEATURE_WITH_PARAMS_VALUE_TYPE(chrome::android::kUseNewDoodleApi, 2621 FEATURE_WITH_PARAMS_VALUE_TYPE(chrome::android::kUseNewDoodleApi,
2606 kUseNewDoodleApiVariations, 2622 kUseNewDoodleApiVariations,
2607 chrome::android::kUseNewDoodleApi.name)}, 2623 chrome::android::kUseNewDoodleApi.name)},
2608 #endif // OS_ANDROID 2624 #endif // OS_ANDROID
2609 2625
2626 {"memory-ablation", flag_descriptions::kMemoryAblationName,
2627 flag_descriptions::kMemoryAblationDescription, kOsAll,
2628 FEATURE_WITH_PARAMS_VALUE_TYPE(kMemoryAblationFeature,
2629 kMemoryAblationFeatureVariations,
2630 "MemoryAblation")},
2631
2610 #if defined(OS_ANDROID) 2632 #if defined(OS_ANDROID)
2611 {"enable-custom-context-menu", 2633 {"enable-custom-context-menu",
2612 flag_descriptions::kEnableCustomContextMenuName, 2634 flag_descriptions::kEnableCustomContextMenuName,
2613 flag_descriptions::kEnableCustomContextMenuDescription, kOsAndroid, 2635 flag_descriptions::kEnableCustomContextMenuDescription, kOsAndroid,
2614 FEATURE_VALUE_TYPE(chrome::android::kCustomContextMenu)}, 2636 FEATURE_VALUE_TYPE(chrome::android::kCustomContextMenu)},
2615 #endif // OS_ANDROID 2637 #endif // OS_ANDROID
2616 2638
2617 #if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_MACOSX) || \ 2639 #if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_MACOSX) || \
2618 defined(OS_WIN) 2640 defined(OS_WIN)
2619 {pausetabs::kFeatureName, flag_descriptions::kPauseBackgroundTabsName, 2641 {pausetabs::kFeatureName, flag_descriptions::kPauseBackgroundTabsName,
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
2852 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 2874 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2853 2875
2854 const FeatureEntry* GetFeatureEntries(size_t* count) { 2876 const FeatureEntry* GetFeatureEntries(size_t* count) {
2855 *count = arraysize(kFeatureEntries); 2877 *count = arraysize(kFeatureEntries);
2856 return kFeatureEntries; 2878 return kFeatureEntries;
2857 } 2879 }
2858 2880
2859 } // namespace testing 2881 } // namespace testing
2860 2882
2861 } // namespace about_flags 2883 } // namespace about_flags
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698