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

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

Issue 2850003002: Add flag to override Effective Connection Type (Closed)
Patch Set: Rebased Created 3 years, 7 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/flag_descriptions.h » ('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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 #include "device/base/features.h" 78 #include "device/base/features.h"
79 #include "device/vr/features/features.h" 79 #include "device/vr/features/features.h"
80 #include "extensions/features/features.h" 80 #include "extensions/features/features.h"
81 #include "gin/public/gin_features.h" 81 #include "gin/public/gin_features.h"
82 #include "gpu/config/gpu_switches.h" 82 #include "gpu/config/gpu_switches.h"
83 #include "media/audio/audio_features.h" 83 #include "media/audio/audio_features.h"
84 #include "media/base/media_switches.h" 84 #include "media/base/media_switches.h"
85 #include "media/media_features.h" 85 #include "media/media_features.h"
86 #include "media/midi/midi_switches.h" 86 #include "media/midi/midi_switches.h"
87 #include "net/cert/cert_verify_proc_android.h" 87 #include "net/cert/cert_verify_proc_android.h"
88 #include "net/nqe/effective_connection_type.h"
88 #include "ppapi/features/features.h" 89 #include "ppapi/features/features.h"
89 #include "printing/features/features.h" 90 #include "printing/features/features.h"
90 #include "services/device/public/cpp/device_features.h" 91 #include "services/device/public/cpp/device_features.h"
91 #include "ui/base/ui_base_switches.h" 92 #include "ui/base/ui_base_switches.h"
92 #include "ui/compositor/compositor_switches.h" 93 #include "ui/compositor/compositor_switches.h"
93 #include "ui/display/display_switches.h" 94 #include "ui/display/display_switches.h"
94 #include "ui/events/event_switches.h" 95 #include "ui/events/event_switches.h"
95 #include "ui/gfx/switches.h" 96 #include "ui/gfx/switches.h"
96 #include "ui/gl/gl_features.h" 97 #include "ui/gl/gl_features.h"
97 #include "ui/gl/gl_switches.h" 98 #include "ui/gl/gl_switches.h"
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 #if defined(OS_ANDROID) 709 #if defined(OS_ANDROID)
709 {flag_descriptions::kAutoplayPolicyUserGestureRequired, 710 {flag_descriptions::kAutoplayPolicyUserGestureRequired,
710 switches::kAutoplayPolicy, switches::autoplay::kUserGestureRequiredPolicy}, 711 switches::kAutoplayPolicy, switches::autoplay::kUserGestureRequiredPolicy},
711 #else 712 #else
712 {flag_descriptions::kAutoplayPolicyCrossOriginUserGestureRequired, 713 {flag_descriptions::kAutoplayPolicyCrossOriginUserGestureRequired,
713 switches::kAutoplayPolicy, 714 switches::kAutoplayPolicy,
714 switches::autoplay::kCrossOriginUserGestureRequiredPolicy}, 715 switches::autoplay::kCrossOriginUserGestureRequiredPolicy},
715 #endif 716 #endif
716 }; 717 };
717 718
719 const FeatureEntry::Choice kForceEffectiveConnectionTypeChoices[] = {
720 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
721 {flag_descriptions::kEffectiveConnectionTypeUnknownDescription,
722 switches::kForceEffectiveConnectionType,
723 net::kEffectiveConnectionTypeUnknown},
724 {flag_descriptions::kEffectiveConnectionTypeOfflineDescription,
725 switches::kForceEffectiveConnectionType,
726 net::kEffectiveConnectionTypeOffline},
727 {flag_descriptions::kEffectiveConnectionTypeSlow2GDescription,
728 switches::kForceEffectiveConnectionType,
729 net::kEffectiveConnectionTypeSlow2G},
730 {flag_descriptions::kEffectiveConnectionType2GDescription,
731 switches::kForceEffectiveConnectionType, net::kEffectiveConnectionType2G},
732 {flag_descriptions::kEffectiveConnectionType3GDescription,
733 switches::kForceEffectiveConnectionType, net::kEffectiveConnectionType3G},
734 {flag_descriptions::kEffectiveConnectionType4GDescription,
735 switches::kForceEffectiveConnectionType, net::kEffectiveConnectionType4G},
736 };
737
738 // Ensure that all effective connection types returned by Network Quality
739 // Estimator (NQE) are also exposed via flags.
740 static_assert(net::EFFECTIVE_CONNECTION_TYPE_LAST + 1 ==
741 arraysize(kForceEffectiveConnectionTypeChoices),
742 "ECT enum value is not handled.");
743 static_assert(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN == 0,
744 "ECT enum value is not handled.");
745 static_assert(net::EFFECTIVE_CONNECTION_TYPE_4G + 1 ==
746 net::EFFECTIVE_CONNECTION_TYPE_LAST,
747 "ECT enum value is not handled.");
748
718 const FeatureEntry::FeatureParam kNoStatePrefetchEnabled[] = { 749 const FeatureEntry::FeatureParam kNoStatePrefetchEnabled[] = {
719 {prerender::kNoStatePrefetchFeatureModeParameterName, 750 {prerender::kNoStatePrefetchFeatureModeParameterName,
720 prerender::kNoStatePrefetchFeatureModeParameterPrefetch}}; 751 prerender::kNoStatePrefetchFeatureModeParameterPrefetch}};
721 752
722 const FeatureEntry::FeatureParam kNoStatePrefetchPrerender[] = { 753 const FeatureEntry::FeatureParam kNoStatePrefetchPrerender[] = {
723 {prerender::kNoStatePrefetchFeatureModeParameterName, 754 {prerender::kNoStatePrefetchFeatureModeParameterName,
724 prerender::kNoStatePrefetchFeatureModeParameterPrerender}}; 755 prerender::kNoStatePrefetchFeatureModeParameterPrerender}};
725 756
726 const FeatureEntry::FeatureParam kNoStatePrefetchSimpleLoad[] = { 757 const FeatureEntry::FeatureParam kNoStatePrefetchSimpleLoad[] = {
727 {prerender::kNoStatePrefetchFeatureModeParameterName, 758 {prerender::kNoStatePrefetchFeatureModeParameterName,
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
2775 {"enable-clipboard-provider", 2806 {"enable-clipboard-provider",
2776 flag_descriptions::kEnableOmniboxClipboardProviderName, 2807 flag_descriptions::kEnableOmniboxClipboardProviderName,
2777 flag_descriptions::kEnableOmniboxClipboardProviderDescription, kOsAndroid, 2808 flag_descriptions::kEnableOmniboxClipboardProviderDescription, kOsAndroid,
2778 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProvider)}, 2809 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProvider)},
2779 #endif 2810 #endif
2780 2811
2781 {"autoplay-policy", flag_descriptions::kAutoplayPolicyName, 2812 {"autoplay-policy", flag_descriptions::kAutoplayPolicyName,
2782 flag_descriptions::kAutoplayPolicyDescription, kOsAll, 2813 flag_descriptions::kAutoplayPolicyDescription, kOsAll,
2783 MULTI_VALUE_TYPE(kAutoplayPolicyChoices)}, 2814 MULTI_VALUE_TYPE(kAutoplayPolicyChoices)},
2784 2815
2816 {"force-effective-connection-type",
2817 flag_descriptions::kForceEffectiveConnectionTypeName,
2818 flag_descriptions::kForceEffectiveConnectionTypeDescription, kOsAll,
2819 MULTI_VALUE_TYPE(kForceEffectiveConnectionTypeChoices)},
2820
2785 {"enable-heap-profiling", flag_descriptions::kEnableHeapProfilingName, 2821 {"enable-heap-profiling", flag_descriptions::kEnableHeapProfilingName,
2786 flag_descriptions::kEnableHeapProfilingDescription, kOsAll, 2822 flag_descriptions::kEnableHeapProfilingDescription, kOsAll,
2787 MULTI_VALUE_TYPE(kEnableHeapProfilingChoices)}, 2823 MULTI_VALUE_TYPE(kEnableHeapProfilingChoices)},
2788 2824
2789 #if defined(TOOLKIT_VIEWS) || (defined(OS_MACOSX) && !defined(OS_IOS)) 2825 #if defined(TOOLKIT_VIEWS) || (defined(OS_MACOSX) && !defined(OS_IOS))
2790 {"show-cert-link", flag_descriptions::kShowCertLinkOnPageInfoName, 2826 {"show-cert-link", flag_descriptions::kShowCertLinkOnPageInfoName,
2791 flag_descriptions::kShowCertLinkOnPageInfoDescription, kOsDesktop, 2827 flag_descriptions::kShowCertLinkOnPageInfoDescription, kOsDesktop,
2792 SINGLE_VALUE_TYPE(switches::kShowCertLink)}, 2828 SINGLE_VALUE_TYPE(switches::kShowCertLink)},
2793 #endif 2829 #endif
2794 2830
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
3010 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 3046 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
3011 3047
3012 const FeatureEntry* GetFeatureEntries(size_t* count) { 3048 const FeatureEntry* GetFeatureEntries(size_t* count) {
3013 *count = arraysize(kFeatureEntries); 3049 *count = arraysize(kFeatureEntries);
3014 return kFeatureEntries; 3050 return kFeatureEntries;
3015 } 3051 }
3016 3052
3017 } // namespace testing 3053 } // namespace testing
3018 3054
3019 } // namespace about_flags 3055 } // namespace about_flags
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/flag_descriptions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698