From: uazo Date: Sat, 18 Nov 2023 09:41:28 +0000 Subject: Add cromite flags support Add SET_CROMITE_FEATURE_ENABLED*, SET_CROMITE_FEATURE_DISABLED* and CROMITE_FEATURE macros, logic has been adapted from that found in brave. Allows flags to be defined in separate files. Activates a new cromite tab in chrome://flags with only the flags added and changed. In android added chrome://flags/cromite in the setting ui. Currently in wip Need: bromite-build-utils.patch License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- base/BUILD.gn | 4 +- base/android/feature_map.cc | 8 +- .../base/cached_flags/CachedFlag.java | 8 +- base/feature_list.cc | 78 +++++++++ base/feature_list.h | 72 ++++++++- build/android/gyp/java_cpp_features.py | 17 ++ chrome/android/java/res/values/values.xml | 3 + .../java/res/xml/privacy_preferences.xml | 4 + .../homepage/settings/HomepageSettings.java | 2 +- .../privacy/settings/PrivacySettings.java | 2 +- .../browser/settings/SettingsActivity.java | 36 +++++ chrome/browser/about_flags.cc | 11 ++ chrome/browser/browser_features.cc | 1 + chrome/browser/flags/BUILD.gn | 13 ++ .../flags/android/chrome_feature_list.cc | 1 + .../flags/android/chrome_feature_list.h | 1 + .../browser/flags/ChromeFeatureList.java | 13 +- .../flags/cromite/include_all_directory.java | 1 + .../java_template/CromiteCachedFlag.java.tmpl | 47 ++++++ chrome/browser/settings/BUILD.gn | 1 + .../settings/ChromeBaseSettingsFragment.java | 47 ++++++ .../strings/android_chrome_strings.grd | 1 + .../placeholder.txt | 1 + chrome/browser/ui/ui_features.cc | 1 + chrome/common/chrome_features.cc | 1 + .../android/java/res/values/attrs.xml | 4 + .../settings/ChromeSwitchPreference.java | 20 +++ components/components_strings.grd | 1 + .../content_settings/core/common/features.cc | 1 + .../placeholder.txt | 1 + components/flags_ui/flags_state.cc | 56 ++++++- components/flags_ui/resources/app.html | 42 ++++- components/flags_ui/resources/app.ts | 41 ++++- components/flags_ui/resources/experiment.html | 7 +- components/flags_ui/resources/experiment.ts | 16 ++ .../flags_ui/resources/flags_browser_proxy.ts | 5 + .../core/offline_page_feature.cc | 1 + .../offline_pages/core/offline_page_feature.h | 1 + components/permissions/features.cc | 1 + .../version_ui/version_handler_helper.cc | 2 +- content/common/features.cc | 1 + content/public/common/content_features.cc | 1 + content/public/common/content_features.h | 1 + cromite_flags/BUILD.gn | 150 ++++++++++++++++++ .../browser/about_flags_cc/placeholder.txt | 1 + .../browser_features_cc/placeholder.txt | 1 + .../chrome_feature_list_cc/placeholder.txt | 1 + .../chrome_feature_list_h/placeholder.txt | 1 + .../browser/ui/ui_features_cc/placeholder.txt | 1 + .../common/chrome_features_cc/placeholder.txt | 1 + .../common/chrome_features_h/placeholder.txt | 1 + .../core/common/features_cc/placeholder.txt | 1 + .../offline_page_feature_cc/placeholder.txt | 1 + .../offline_page_feature_h/placeholder.txt | 1 + .../permissions/features_cc/placeholder.txt | 1 + .../common/features_cc/placeholder.txt | 1 + .../content_features_cc/placeholder.txt | 1 + .../common/content_features_h/placeholder.txt | 1 + .../base/media_switches_cc/placeholder.txt | 1 + .../base/media_switches_h/placeholder.txt | 1 + .../net/base/features_cc/placeholder.txt | 1 + .../net/base/features_h/placeholder.txt | 1 + .../public/cpp/features_cc/placeholder.txt | 1 + .../public/cpp/features_h/placeholder.txt | 1 + .../blink/common/features_cc/placeholder.txt | 1 + .../blink/common/features_h/placeholder.txt | 1 + media/base/media_switches.cc | 2 +- media/base/media_switches.h | 2 +- net/base/features.cc | 1 + net/base/features.h | 1 + services/network/public/cpp/features.cc | 1 + services/network/public/cpp/features.h | 1 + third_party/blink/common/features.cc | 1 + third_party/blink/public/common/features.h | 1 + 74 files changed, 738 insertions(+), 20 deletions(-) create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/include_all_directory.java create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/java_template/CromiteCachedFlag.java.tmpl create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/placeholder.txt create mode 100644 components/cromite_components_strings_grd/placeholder.txt create mode 100755 cromite_flags/BUILD.gn create mode 100755 cromite_flags/chrome/browser/about_flags_cc/placeholder.txt create mode 100755 cromite_flags/chrome/browser/browser_features_cc/placeholder.txt create mode 100755 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/placeholder.txt create mode 100755 cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/placeholder.txt create mode 100755 cromite_flags/chrome/browser/ui/ui_features_cc/placeholder.txt create mode 100755 cromite_flags/chrome/common/chrome_features_cc/placeholder.txt create mode 100755 cromite_flags/chrome/common/chrome_features_h/placeholder.txt create mode 100755 cromite_flags/components/content_settings/core/common/features_cc/placeholder.txt create mode 100755 cromite_flags/components/offline_pages/core/offline_page_feature_cc/placeholder.txt create mode 100755 cromite_flags/components/offline_pages/core/offline_page_feature_h/placeholder.txt create mode 100755 cromite_flags/components/permissions/features_cc/placeholder.txt create mode 100755 cromite_flags/content/common/features_cc/placeholder.txt create mode 100755 cromite_flags/content/public/common/content_features_cc/placeholder.txt create mode 100755 cromite_flags/content/public/common/content_features_h/placeholder.txt create mode 100755 cromite_flags/media/base/media_switches_cc/placeholder.txt create mode 100755 cromite_flags/media/base/media_switches_h/placeholder.txt create mode 100755 cromite_flags/net/base/features_cc/placeholder.txt create mode 100755 cromite_flags/net/base/features_h/placeholder.txt create mode 100755 cromite_flags/services/network/public/cpp/features_cc/placeholder.txt create mode 100755 cromite_flags/services/network/public/cpp/features_h/placeholder.txt create mode 100755 cromite_flags/third_party/blink/common/features_cc/placeholder.txt create mode 100755 cromite_flags/third_party/blink/common/features_h/placeholder.txt diff --git a/base/BUILD.gn b/base/BUILD.gn --- a/base/BUILD.gn +++ b/base/BUILD.gn @@ -212,6 +212,8 @@ buildflag_header("message_pump_buildflags") { # This does not include test code (test support and anything in the test # directory) which should use source_set as is recommended for GN targets). component("base") { + deps = [ "//cromite_flags", ] + sources = [ "allocator/allocator_check.cc", "allocator/allocator_check.h", @@ -1055,7 +1057,7 @@ component("base") { "//build/config/compiler:wglobal_constructors", ] - deps = [ + deps += [ ":check_version_internal", ":message_pump_buildflags", "//base/allocator:buildflags", diff --git a/base/android/feature_map.cc b/base/android/feature_map.cc --- a/base/android/feature_map.cc +++ b/base/android/feature_map.cc @@ -45,9 +45,15 @@ static jboolean JNI_FeatureMap_IsEnabled( JNIEnv* env, jlong jfeature_map, const android::JavaParamRef& jfeature_name) { + std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name); + if (base::FeatureList::IsCromiteFlag(feature_name)) { + const base::Feature* cromite_feature = + base::FeatureList::GetCromiteFlag(feature_name); + return base::FeatureList::IsEnabled(*cromite_feature); + } FeatureMap* feature_map = reinterpret_cast(jfeature_map); const base::Feature* feature = feature_map->FindFeatureExposedToJava( - StringPiece(ConvertJavaStringToUTF8(env, jfeature_name))); + StringPiece(feature_name)); return base::FeatureList::IsEnabled(*feature); } diff --git a/base/android/java/src/org/chromium/base/cached_flags/CachedFlag.java b/base/android/java/src/org/chromium/base/cached_flags/CachedFlag.java --- a/base/android/java/src/org/chromium/base/cached_flags/CachedFlag.java +++ b/base/android/java/src/org/chromium/base/cached_flags/CachedFlag.java @@ -125,7 +125,7 @@ public class CachedFlag extends Flag { .writeBoolean(getSharedPreferenceKey(), isEnabledInNative); } - String getSharedPreferenceKey() { + public String getSharedPreferenceKey() { // Create the key only once to avoid String concatenation every flag check. if (mPreferenceKey == null) { mPreferenceKey = CachedFlagsSharedPreferences.FLAGS_CACHED.createKey(mFeatureName); @@ -157,6 +157,12 @@ public class CachedFlag extends Flag { .removeKeysWithPrefix(CachedFlagsSharedPreferences.FLAGS_CACHED); } + public void setValueReturnedOverride(@Nullable Boolean value) { + synchronized (ValuesReturned.sBoolValues) { + ValuesReturned.sBoolValues.put(getSharedPreferenceKey(), value); + } + } + /** Create a Map of feature names -> {@link CachedFlag} from multiple lists of CachedFlags. */ public static Map createCachedFlagMap( List> allCachedFlagsLists) { diff --git a/base/feature_list.cc b/base/feature_list.cc --- a/base/feature_list.cc +++ b/base/feature_list.cc @@ -37,6 +37,31 @@ namespace base { +namespace internal { + +using DefaultStateOverrides = + flat_map; + +constexpr size_t kDefaultStateOverridesReserve = 64 * 4; + +DefaultStateOverrides& GetListOfNewFeatureState() { + static NoDestructor + startup_default_state_overrides([] { + DefaultStateOverrides v; + v.reserve(kDefaultStateOverridesReserve); + return v; + }()); + return *startup_default_state_overrides; +} + +FeatureDefaultStateOverrider::FeatureDefaultStateOverrider( + const Feature& feature, FeatureState state) { + auto& default_state_overrides = GetListOfNewFeatureState(); + default_state_overrides.insert({&feature, state}); +} + +} // namespace internal + namespace { // Pointer to the FeatureList instance singleton that was set via @@ -464,6 +489,48 @@ bool FeatureList::IsEnabled(const Feature& feature) { return g_feature_list_instance->IsFeatureEnabled(feature); } +// static +bool FeatureList::IsCromiteChanged(const Feature& feature) { + for(auto const& [key, value]: internal::GetListOfNewFeatureState()) { + if (key->name == feature.name) { + return true; + } + } + return false; +} + +// static +const base::Feature* FeatureList::GetCromiteFlag(const std::string& feature_name) { + for(auto const& [key, value]: internal::GetListOfNewFeatureState()) { + if (key->name == feature_name && key->is_cromite) { + return key; + } + } + NOTREACHED(); + return nullptr; +} + +// static +bool FeatureList::IsCromiteFlag(const std::string& feature_name) { + for(auto const& [key, value]: internal::GetListOfNewFeatureState()) { + if (key->name == feature_name && key->is_cromite) { + return true; + } + } + return false; +} + +// static +bool FeatureList::GetCromiteChange(const Feature& feature) { + for(auto const& [key, value]: internal::GetListOfNewFeatureState()) { + if (key->name == feature.name) { + return value == base::FEATURE_ENABLED_BY_DEFAULT; + } + } + NOTREACHED(); + return false; +} + // static bool FeatureList::IsValidFeatureOrFieldTrialName(StringPiece name) { return IsStringASCII(name) && name.find_first_of(",<*") == std::string::npos; @@ -710,6 +777,17 @@ void FeatureList::VisitFeaturesAndParams(FeatureVisitor& visitor) { void FeatureList::FinalizeInitialization() { DCHECK(!initialized_); + //LOG(INFO) << "---FinalizeInitialization"; + for(auto const& [key, value]: internal::GetListOfNewFeatureState()) { + // LOG(INFO) << "---key " << key->name + // << " " + // << (value == base::FEATURE_ENABLED_BY_DEFAULT ? "1" : "0"); + RegisterOverride(key->name, + value == base::FEATURE_ENABLED_BY_DEFAULT + ? OverrideState::OVERRIDE_ENABLE_FEATURE + : OverrideState::OVERRIDE_DISABLE_FEATURE, + /* field_trial = */ nullptr); + } // Store the field trial list pointer for DCHECKing. field_trial_list_ = FieldTrialList::GetInstance(); initialized_ = true; diff --git a/base/feature_list.h b/base/feature_list.h --- a/base/feature_list.h +++ b/base/feature_list.h @@ -99,8 +99,10 @@ enum FeatureState { // [1]: // https://crsrc.org/c/docs/speed/binary_size/android_binary_size_trybot.md#Mutable-Constants struct BASE_EXPORT LOGICALLY_CONST Feature { - constexpr Feature(const char* name, FeatureState default_state) - : name(name), default_state(default_state) { + constexpr Feature(const char* name, FeatureState default_state, + bool cromite = false, bool is_new_flag = false) + : name(name), default_state(default_state), + is_cromite(cromite), is_new(is_new_flag) { #if BUILDFLAG(ENABLE_BANNED_BASE_FEATURE_PREFIX) if (StringPiece(name).find(BUILDFLAG(BANNED_BASE_FEATURE_PREFIX)) == 0) { LOG(FATAL) << "Invalid feature name " << name << " starts with " @@ -126,6 +128,9 @@ struct BASE_EXPORT LOGICALLY_CONST Feature { // command line switch. const FeatureState default_state; + const bool is_cromite = false; + const bool is_new = false; + private: friend class FeatureList; @@ -401,6 +406,11 @@ class BASE_EXPORT FeatureList { // instance, which is checked in builds with DCHECKs enabled. static bool IsEnabled(const Feature& feature); + static bool IsCromiteFlag(const std::string& featureName); + static const base::Feature* GetCromiteFlag(const std::string& featureName); + static bool IsCromiteChanged(const Feature& feature); + static bool GetCromiteChange(const Feature& feature); + // Some characters are not allowed to appear in feature names or the // associated field trial names, as they are used as special characters for // command-line serialization. This function checks that the strings are ASCII @@ -665,4 +675,62 @@ class BASE_EXPORT FeatureList { } // namespace base +namespace base { +namespace internal { + +// Perform base::Feature duplicates check and fills overriden states into a +// map that is used at runtime to get an override if available. +class BASE_EXPORT FeatureDefaultStateOverrider { + public: + using FeatureOverrideInfo = + std::pair, FeatureState>; + + FeatureDefaultStateOverrider( + const Feature& feature, FeatureState state); +}; + +} // namespace internal +} // namespace base + +#define CROMITE_FEATURE(feature, name, default_state) \ + constinit const base::Feature feature(name, default_state, true, true); \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") \ + static const ::base::internal::FeatureDefaultStateOverrider \ + g_feature_default_state_overrider_ ##feature {feature, default_state}; \ + _Pragma("clang diagnostic pop") \ + static_assert(true, "") /* for a semicolon requirement */ + +#define SET_CROMITE_FEATURE_ENABLED(feature) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") \ + static const ::base::internal::FeatureDefaultStateOverrider \ + g_feature_default_state_overrider_ ##feature {feature, base::FEATURE_ENABLED_BY_DEFAULT}; \ + _Pragma("clang diagnostic pop") \ + static_assert(true, "") /* for a semicolon requirement */ + +#define SET_CROMITE_FEATURE_DISABLED(feature) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") \ + static const ::base::internal::FeatureDefaultStateOverrider \ + g_feature_default_state_overrider_ ##feature {feature, base::FEATURE_DISABLED_BY_DEFAULT}; \ + _Pragma("clang diagnostic pop") \ + static_assert(true, "") /* for a semicolon requirement */ + +#define SET_CROMITE_FEATURE_ENABLED_W_NAMESPACE(namespace_value, feature) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") \ + static const ::base::internal::FeatureDefaultStateOverrider \ + g_feature_default_state_overrider_ ##feature {namespace_value::feature, base::FEATURE_ENABLED_BY_DEFAULT}; \ + _Pragma("clang diagnostic pop") \ + static_assert(true, "") /* for a semicolon requirement */ + +#define SET_CROMITE_FEATURE_DISABLED_W_NAMESPACE(namespace_value, feature) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") \ + static const ::base::internal::FeatureDefaultStateOverrider \ + g_feature_default_state_overrider_ ##feature {namespace_value::feature, base::FEATURE_DISABLED_BY_DEFAULT}; \ + _Pragma("clang diagnostic pop") \ + static_assert(true, "") /* for a semicolon requirement */ + #endif // BASE_FEATURE_LIST_H_ diff --git a/build/android/gyp/java_cpp_features.py b/build/android/gyp/java_cpp_features.py --- a/build/android/gyp/java_cpp_features.py +++ b/build/android/gyp/java_cpp_features.py @@ -22,10 +22,27 @@ class FeatureParserDelegate(java_cpp_utils.CppConstantParser.Delegate): # ExtractConstantName() -> 'ConstantName' # ExtractValue() -> '"StringNameOfTheFeature"' FEATURE_RE = re.compile(r'BASE_FEATURE\(k([^,]+),') + + FEATURE_RE1 = re.compile(r'CROMITE_FEATURE\(k([^,]+),') + FEATURE_RE2 = re.compile(r'CROMITE_FEATURE_KEEP_DISABLED\(k([^,]+),') + FEATURE_RE3 = re.compile(r'CROMITE_FEATURE_DISABLED\(k([^,]+),') + FEATURE_RE4 = re.compile(r'CROMITE_FEATURE_KEEP_ENABLED\(k([^,]+),') + FEATURE_RE5 = re.compile(r'CROMITE_FEATURE_ENABLED\(k([^,]+),') + VALUE_RE = re.compile(r'\s*("(?:\"|[^"])*")\s*,') def ExtractConstantName(self, line): match = FeatureParserDelegate.FEATURE_RE.match(line) + if match is None: + match = FeatureParserDelegate.FEATURE_RE1.match(line) + if match is None: + match = FeatureParserDelegate.FEATURE_RE2.match(line) + if match is None: + match = FeatureParserDelegate.FEATURE_RE3.match(line) + if match is None: + match = FeatureParserDelegate.FEATURE_RE4.match(line) + if match is None: + match = FeatureParserDelegate.FEATURE_RE5.match(line) return match.group(1) if match else None def ExtractValue(self, line): diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res/values/values.xml --- a/chrome/android/java/res/values/values.xml +++ b/chrome/android/java/res/values/values.xml @@ -9,6 +9,9 @@ found in the LICENSE file. xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation"> + Open Cromite flags list + chrome://flags/cromite + diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/placeholder.txt b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/placeholder.txt new file mode 100644 --- /dev/null +++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/chrome/browser/ui/ui_features.cc b/chrome/browser/ui/ui_features.cc --- a/chrome/browser/ui/ui_features.cc +++ b/chrome/browser/ui/ui_features.cc @@ -450,4 +450,5 @@ BASE_FEATURE(kStopLoadingAnimationForHiddenWindow, "StopLoadingAnimationForHiddenWindow", base::FEATURE_ENABLED_BY_DEFAULT); +#include "cromite_flags/chrome_browser_ui_ui_features_cc.inc" } // namespace features diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc @@ -1735,4 +1735,5 @@ BASE_FEATURE(kSupportsRtcWakeOver24Hours, base::FEATURE_ENABLED_BY_DEFAULT); #endif // BUILDFLAG(IS_CHROMEOS_ASH) +#include "cromite_flags/chrome_common_chrome_features_cc.inc" } // namespace features diff --git a/components/browser_ui/settings/android/java/res/values/attrs.xml b/components/browser_ui/settings/android/java/res/values/attrs.xml --- a/components/browser_ui/settings/android/java/res/values/attrs.xml +++ b/components/browser_ui/settings/android/java/res/values/attrs.xml @@ -12,6 +12,10 @@ found in the LICENSE file. + + + + diff --git a/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/ChromeSwitchPreference.java b/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/ChromeSwitchPreference.java --- a/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/ChromeSwitchPreference.java +++ b/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/ChromeSwitchPreference.java @@ -12,6 +12,9 @@ import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.TextView; +import androidx.annotation.Nullable; +import android.content.res.TypedArray; + import androidx.annotation.ColorRes; import androidx.appcompat.content.res.AppCompatResources; import androidx.preference.PreferenceViewHolder; @@ -30,6 +33,11 @@ public class ChromeSwitchPreference extends SwitchPreferenceCompat { /** Indicates if the preference uses a custom layout. */ private final boolean mHasCustomLayout; + @Nullable + private String mFeatureName; + + private final boolean mNeedRestart; + // TOOD(crbug.com/1451550): This is an interim solution. In the long-term, we should migrate // away from a switch with dynamically changing summaries onto a radio group. /** @@ -46,6 +54,18 @@ public class ChromeSwitchPreference extends SwitchPreferenceCompat { super(context, attrs); mHasCustomLayout = ManagedPreferencesUtils.isCustomLayoutApplied(context, attrs); + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ChromeBasePreference); + mFeatureName = a.getString(R.styleable.ChromeBasePreference_featureName); + mNeedRestart = a.getBoolean(R.styleable.ChromeBasePreference_needRestart, false); + a.recycle(); + } + + public String getFeatureName() { + return mFeatureName; + } + + public boolean needRestart() { + return mNeedRestart; } /** Sets the ManagedPreferenceDelegate which will determine whether this preference is managed. */ diff --git a/components/components_strings.grd b/components/components_strings.grd --- a/components/components_strings.grd +++ b/components/components_strings.grd @@ -338,6 +338,7 @@ + diff --git a/components/content_settings/core/common/features.cc b/components/content_settings/core/common/features.cc --- a/components/content_settings/core/common/features.cc +++ b/components/content_settings/core/common/features.cc @@ -112,5 +112,6 @@ BASE_FEATURE(kIndexedHostContentSettingsMap, "IndexedHostContentSettingsMap", base::FEATURE_DISABLED_BY_DEFAULT); +#include "cromite_flags/components_content_settings_core_common_features_cc.inc" } // namespace features } // namespace content_settings diff --git a/components/cromite_components_strings_grd/placeholder.txt b/components/cromite_components_strings_grd/placeholder.txt new file mode 100644 --- /dev/null +++ b/components/cromite_components_strings_grd/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/components/flags_ui/flags_state.cc b/components/flags_ui/flags_state.cc --- a/components/flags_ui/flags_state.cc +++ b/components/flags_ui/flags_state.cc @@ -359,7 +359,22 @@ void FlagsState::GetSwitchesAndFeaturesFromFlags( for (const std::string& entry_name : enabled_entries) { const auto& entry_it = name_to_switch_map.find(entry_name); - DCHECK(entry_it != name_to_switch_map.end()); + if (entry_it == name_to_switch_map.end()) { + // check if is a cromite feature + std::string::size_type pos = entry_name.find('@'); + if (pos != std::string::npos) { + std::string feature_name = entry_name.substr(0, pos); + if (base::FeatureList::IsCromiteFlag(feature_name)) { + if (entry_name.ends_with("@1")) + features->insert(entry_name + ":enabled"); + else + features->insert(entry_name + ":disabled"); + continue; + } + } + NOTREACHED(); + continue; + } const SwitchEntry& entry = entry_it->second; if (!entry.switch_name.empty()) @@ -668,6 +683,27 @@ void FlagsState::GetFlagFeatureEntries( bool is_default_value = IsDefaultValue(entry, enabled_entries); data.Set("is_default", is_default_value); + if (entry.type == FeatureEntry::FEATURE_VALUE + || entry.type == FeatureEntry::FEATURE_WITH_PARAMS_VALUE) { + DCHECK(entry.feature.feature); + if (base::FeatureList::IsCromiteChanged(*entry.feature.feature)) { + bool is_enabled = base::FeatureList::GetCromiteChange(*entry.feature.feature); + data.Set("is_cromite", true); + data.Set("default_value", + is_enabled ? "enabled" : "disabled"); + } else { + bool is_enabled = entry.feature.feature->default_state == base::FEATURE_ENABLED_BY_DEFAULT; + data.Set("default_value", is_enabled + ? "enabled" : "disabled"); + if (is_enabled) + data.Set("is_default_value_on", true); + } + if (entry.feature.feature->is_cromite) + data.Set("is_cromite", true); + if (entry.feature.feature->is_new) + data.Set("is_new", true); + } + switch (entry.type) { case FeatureEntry::SINGLE_VALUE: case FeatureEntry::SINGLE_DISABLE_VALUE: @@ -796,6 +832,16 @@ void FlagsState::AddSwitchesToCommandLine( for (const std::string& entry_name : enabled_entries) { const auto& entry_it = name_to_switch_map.find(entry_name); if (entry_it == name_to_switch_map.end()) { + // check if is a cromite feature + std::string::size_type pos = entry_name.find('@'); + if (pos != std::string::npos) { + std::string feature_name = entry_name.substr(0, pos); + if (base::FeatureList::IsCromiteFlag(feature_name)) { + feature_switches[feature_name] = + entry_name.ends_with("@1"); + continue; + } + } NOTREACHED(); continue; } @@ -1048,6 +1094,14 @@ const FeatureEntry* FlagsState::FindFeatureEntryByName( bool FlagsState::IsSupportedFeature(const FlagsStorage* storage, const std::string& name, int platform_mask) const { + // check if is a cromite feature + std::string::size_type pos = name.find('@'); + if (pos != std::string::npos) { + std::string feature_name = name.substr(0, pos); + if (base::FeatureList::IsCromiteFlag(feature_name)) { + return true; + } + } for (const auto& entry : feature_entries_) { DCHECK(entry.IsValid()); if (!(entry.supported_platforms & platform_mask)) diff --git a/components/flags_ui/resources/app.html b/components/flags_ui/resources/app.html --- a/components/flags_ui/resources/app.html +++ b/components/flags_ui/resources/app.html @@ -473,7 +473,32 @@ padding-top: 1.5rem; } } + #appcontainer { + overflow-y: scroll; + } + .cromite #header { + display: none; + } + .cromite .blurb-container { + display: none; + } + .cromite #tabs { + display: none; + } + .cromite #tab-content-available { + display: none; + } + .cromite #tab-content-unavailable { + display: none; + } + .cromite #tab-content-cromite { + display: block !important; + } + .cromite .section-header-title { + display: none; + } +
\ No newline at end of file +
+ + diff --git a/components/flags_ui/resources/app.ts b/components/flags_ui/resources/app.ts --- a/components/flags_ui/resources/app.ts +++ b/components/flags_ui/resources/app.ts @@ -194,6 +194,7 @@ export class FlagsAppElement extends CustomElement { return getTemplate(); } + private onlyCromiteFlags: boolean = false; private announceStatusDelayMs: number = 100; private featuresResolver: PromiseResolver = new PromiseResolver(); private flagSearch: FlagSearch = new FlagSearch(this); @@ -205,6 +206,10 @@ export class FlagsAppElement extends CustomElement { //
tabs: Tab[] = [ + { + tabEl: this.getRequiredElement('#tab-cromite')!, + panelEl: this.getRequiredElement('#tab-content-cromite')!, + }, { tabEl: this.getRequiredElement('#tab-available'), panelEl: this.getRequiredElement('#tab-content-available'), @@ -218,6 +223,11 @@ export class FlagsAppElement extends CustomElement { ]; connectedCallback() { + if (location.pathname == '/cromite') { + this.onlyCromiteFlags = true; + this.getRequiredElement("#appcontainer").classList.add('cromite'); + document.title = "Cromite Flags List"; + } // Get and display the data upon loading. this.requestExperimentalFeaturesData(); // There is no restart button on iOS. @@ -278,20 +288,29 @@ export class FlagsAppElement extends CustomElement { const defaultFeatures: Feature[] = []; const nonDefaultFeatures: Feature[] = []; + if (this.onlyCromiteFlags) { + experimentalFeaturesData.supportedFeatures = + experimentalFeaturesData.supportedFeatures.filter(item => item.is_new); + } + experimentalFeaturesData.supportedFeatures.sort( + (a,b) => (a.internal_name.localeCompare(b.internal_name))); experimentalFeaturesData.supportedFeatures.forEach( f => (f.is_default ? defaultFeatures : nonDefaultFeatures).push(f)); this.renderExperiments( nonDefaultFeatures, - this.getRequiredElement('#non-default-experiments')); + this.getRequiredElement('#non-default-experiments'), + this.getRequiredElement('#non-default-cromite-experiments'), false); this.renderExperiments( - defaultFeatures, this.getRequiredElement('#default-experiments')); + defaultFeatures, this.getRequiredElement('#default-experiments'), + this.getRequiredElement('#cromite-experiments'), false); // this.renderExperiments( experimentalFeaturesData.unsupportedFeatures, - this.getRequiredElement('#unavailable-experiments'), true); + this.getRequiredElement('#unavailable-experiments'), + undefined, true); // this.showRestartToast(experimentalFeaturesData.needsRestart); @@ -402,16 +421,23 @@ export class FlagsAppElement extends CustomElement { } private renderExperiments( - features: Feature[], container: HTMLElement, unsupported = false) { + features: Feature[], container: HTMLElement, + cromiteContainer: HTMLElement | undefined, unsupported: boolean = false) { const fragment = document.createDocumentFragment(); + const fragmentCromite = document.createDocumentFragment(); + const show_permalink = !document.body.classList.contains('cromite'); for (const feature of features) { const experiment = document.createElement('flags-experiment'); experiment.toggleAttribute('unsupported', unsupported); + experiment.permalink = show_permalink; experiment.data = feature; experiment.id = feature.internal_name; const select = experiment.getSelect(); + // if (select && feature.is_cromite && !feature.is_new) { + // select.disabled = true; + // } if (select) { experiment.addEventListener('select-change', e => { e.preventDefault(); @@ -435,9 +461,14 @@ export class FlagsAppElement extends CustomElement { this.showRestartToast(true); }); } - fragment.appendChild(experiment); + if (feature.is_cromite) + fragmentCromite.appendChild(experiment); + else + fragment.appendChild(experiment); } container.replaceChildren(fragment); + if (!!cromiteContainer) + cromiteContainer.replaceChildren(fragmentCromite); } /** diff --git a/components/flags_ui/resources/experiment.html b/components/flags_ui/resources/experiment.html --- a/components/flags_ui/resources/experiment.html +++ b/components/flags_ui/resources/experiment.html @@ -119,6 +119,11 @@ color: white; } + .experiment-on select { + background: #dddddd; + color: var(--link-color); + } + .experiment-switched option { background: white; color: var(--link-color); @@ -164,7 +169,6 @@ .experiment .experiment-actions { max-width: 100%; padding-top: 12px; - text-align: left; /* csschecker-disable-line left-right */ width: 100%; } @@ -172,7 +176,6 @@ .body { overflow: hidden; text-overflow: ellipsis; - white-space: nowrap; width: 100%; } diff --git a/components/flags_ui/resources/experiment.ts b/components/flags_ui/resources/experiment.ts --- a/components/flags_ui/resources/experiment.ts +++ b/components/flags_ui/resources/experiment.ts @@ -61,11 +61,16 @@ function resetHighlights(element: HTMLElement) { export class FlagsExperimentElement extends CustomElement { private feature_: Feature|null = null; + private permalink_: boolean = true; static override get template() { return getTemplate(); } + set permalink(visible: boolean) { + this.permalink_ = visible; + } + set data(feature: Feature) { this.feature_ = feature; @@ -77,12 +82,18 @@ export class FlagsExperimentElement extends CustomElement { 'experiment-default', feature.is_default); experimentDefault.classList.toggle( 'experiment-switched', !feature.is_default); + experimentDefault.classList.toggle( + 'cromite', feature.is_cromite && feature.is_new); + experimentDefault.classList.toggle( + 'experiment-on', !!feature.is_default_value_on); const experimentName = this.getRequiredElement('.experiment-name'); experimentName.id = `${feature.internal_name}_name`; experimentName.title = feature.is_default ? '' : loadTimeData.getString('experiment-enabled'); experimentName.textContent = feature.name; + if (feature.is_cromite && feature.is_new) + experimentName.textContent += " (Cromite flag)" const description = this.getRequiredElement('.description'); description.textContent = feature.description; @@ -125,6 +136,7 @@ export class FlagsExperimentElement extends CustomElement { const permalink = this.getRequiredElement('.permalink'); permalink.href = `#${feature.internal_name}`; permalink.textContent = `#${feature.internal_name}`; + if (!this.permalink_) permalink.hidden = true; const smallScreenCheck = window.matchMedia('(max-width: 480px)'); // Toggling of experiment description overflow content on smaller screens. @@ -153,6 +165,10 @@ export class FlagsExperimentElement extends CustomElement { const optionEl = document.createElement('option'); optionEl.selected = option.selected; optionEl.textContent = option.description; + if (option.description == "Default" && + feature.default_value !== undefined) { + optionEl.textContent += " (" + feature.default_value + ")"; + } experimentSelect.appendChild(optionEl); } diff --git a/components/flags_ui/resources/flags_browser_proxy.ts b/components/flags_ui/resources/flags_browser_proxy.ts --- a/components/flags_ui/resources/flags_browser_proxy.ts +++ b/components/flags_ui/resources/flags_browser_proxy.ts @@ -16,6 +16,11 @@ export interface Feature { description: string; enabled: boolean; is_default: boolean; + is_default_value_on: boolean; + default_value: string; + is_cromite: boolean; + is_new: boolean; + permalink: boolean; supported_platforms: string[]; origin_list_value?: string; string_value?: string; diff --git a/components/offline_pages/core/offline_page_feature.cc b/components/offline_pages/core/offline_page_feature.cc --- a/components/offline_pages/core/offline_page_feature.cc +++ b/components/offline_pages/core/offline_page_feature.cc @@ -55,4 +55,5 @@ bool IsOfflinePagesNetworkStateLikelyUnknown() { return base::FeatureList::IsEnabled(kOfflinePagesNetworkStateLikelyUnknown); } +#include "cromite_flags/components_offline_pages_core_offline_page_feature_cc.inc" } // namespace offline_pages diff --git a/components/offline_pages/core/offline_page_feature.h b/components/offline_pages/core/offline_page_feature.h --- a/components/offline_pages/core/offline_page_feature.h +++ b/components/offline_pages/core/offline_page_feature.h @@ -50,6 +50,7 @@ bool IsOnTheFlyMhtmlHashComputationEnabled(); // offline pages to avoid showing them even when the device is online. bool IsOfflinePagesNetworkStateLikelyUnknown(); +#include "cromite_flags/components_offline_pages_core_offline_page_feature_h.inc" } // namespace offline_pages #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_FEATURE_H_ diff --git a/components/permissions/features.cc b/components/permissions/features.cc --- a/components/permissions/features.cc +++ b/components/permissions/features.cc @@ -139,6 +139,7 @@ BASE_FEATURE(kCpssQuietChipTextUpdate, "CpssQuietChipTextUpdate", base::FEATURE_DISABLED_BY_DEFAULT); +#include "cromite_flags/components_permissions_features_cc.inc" } // namespace features namespace feature_params { diff --git a/components/version_ui/version_handler_helper.cc b/components/version_ui/version_handler_helper.cc --- a/components/version_ui/version_handler_helper.cc +++ b/components/version_ui/version_handler_helper.cc @@ -37,7 +37,7 @@ base::Value::List GetVariationsList() { // displayed locally (and is useful for diagnostics purposes). base::FieldTrialListIncludingLowAnonymity::GetActiveFieldTrialGroups( &active_groups); -#if !defined(NDEBUG) +#if true const unsigned char kNonBreakingHyphenUTF8[] = {0xE2, 0x80, 0x91, '\0'}; const std::string kNonBreakingHyphenUTF8String( reinterpret_cast(kNonBreakingHyphenUTF8)); diff --git a/content/common/features.cc b/content/common/features.cc --- a/content/common/features.cc +++ b/content/common/features.cc @@ -596,4 +596,5 @@ BASE_FEATURE(kWindowOpenFileSelectFix, // Please keep features in alphabetical order. +#include "cromite_flags/content_common_features_cc.inc" } // namespace features diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc @@ -1389,4 +1389,5 @@ bool IsVideoCaptureServiceEnabledForBrowserProcess() { VideoCaptureServiceConfiguration::kEnabledForBrowserProcess; } +#include "cromite_flags/content_public_common_content_features_cc.inc" } // namespace features diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h @@ -332,6 +332,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebRtcPipeWireCapturer); CONTENT_EXPORT bool IsVideoCaptureServiceEnabledForOutOfProcess(); CONTENT_EXPORT bool IsVideoCaptureServiceEnabledForBrowserProcess(); +#include "cromite_flags/content_public_common_content_features_h.inc" } // namespace features #endif // CONTENT_PUBLIC_COMMON_CONTENT_FEATURES_H_ diff --git a/cromite_flags/BUILD.gn b/cromite_flags/BUILD.gn new file mode 100755 --- /dev/null +++ b/cromite_flags/BUILD.gn @@ -0,0 +1,150 @@ +# This file is part of Bromite. + +# Bromite is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# Bromite is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with Bromite. If not, see . + +# for placeholder.txt: +# +# this file is intentionally empty +# + +cpp_bromite_include("chrome_browser_about_flags_cc") { + inputs = [ "//cromite_flags/chrome/browser/about_flags_cc/placeholder.txt" ] + output_file = "chrome_browser_about_flags_cc.inc" +} + +cpp_bromite_include("chrome_common_chrome_features_cc") { + inputs = [ "//cromite_flags/chrome/common/chrome_features_cc/placeholder.txt" ] + output_file = "chrome_common_chrome_features_cc.inc" +} + +cpp_bromite_include("content_common_features_cc") { + inputs = [ "//cromite_flags/content/common/features_cc/placeholder.txt" ] + output_file = "content_common_features_cc.inc" +} + +cpp_bromite_include("content_public_common_content_features_h") { + inputs = [ "//cromite_flags/content/public/common/content_features_h/placeholder.txt" ] + output_file = "content_public_common_content_features_h.inc" +} + +cpp_bromite_include("content_public_common_content_features_cc") { + inputs = [ "//cromite_flags/content/public/common/content_features_cc/placeholder.txt" ] + output_file = "content_public_common_content_features_cc.inc" +} + +cpp_bromite_include("third_party_blink_common_features_cc") { + inputs = [ "//cromite_flags/third_party/blink/common/features_cc/placeholder.txt" ] + output_file = "third_party_blink_common_features_cc.inc" +} + +cpp_bromite_include("third_party_blink_common_features_h") { + inputs = [ "//cromite_flags/third_party/blink/common/features_h/placeholder.txt" ] + output_file = "third_party_blink_common_features_h.inc" +} + +cpp_bromite_include("chrome_browser_flags_android_chrome_feature_list_cc") { + inputs = [ "//cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/placeholder.txt" ] + output_file = "chrome_browser_flags_android_chrome_feature_list_cc.inc" +} + +cpp_bromite_include("chrome_browser_flags_android_chrome_feature_list_h") { + inputs = [ "//cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/placeholder.txt" ] + output_file = "chrome_browser_flags_android_chrome_feature_list_h.inc" +} + +cpp_bromite_include("chrome_browser_browser_features_cc") { + inputs = [ "//cromite_flags/chrome/browser/browser_features_cc/placeholder.txt" ] + output_file = "chrome_browser_browser_features_cc.inc" +} + +cpp_bromite_include("chrome_browser_ui_ui_features_cc") { + inputs = [ "//cromite_flags/chrome/browser/ui/ui_features_cc/placeholder.txt" ] + output_file = "chrome_browser_ui_ui_features_cc.inc" +} + +cpp_bromite_include("media_base_media_switches_cc") { + inputs = [ "//cromite_flags/media/base/media_switches_cc/placeholder.txt" ] + output_file = "media_base_media_switches_cc.inc" +} + +cpp_bromite_include("media_base_media_switches_h") { + inputs = [ "//cromite_flags/media/base/media_switches_h/placeholder.txt" ] + output_file = "media_base_media_switches_h.inc" +} + +cpp_bromite_include("components_content_settings_core_common_features_cc") { + inputs = [ "//cromite_flags/components/content_settings/core/common/features_cc/placeholder.txt" ] + output_file = "components_content_settings_core_common_features_cc.inc" +} + +cpp_bromite_include("components_permissions_features_cc") { + inputs = [ "//cromite_flags/components/permissions/features_cc/placeholder.txt" ] + output_file = "components_permissions_features_cc.inc" +} + +cpp_bromite_include("components_offline_pages_core_offline_page_feature_cc") { + inputs = [ "//cromite_flags/components/offline_pages/core/offline_page_feature_cc/placeholder.txt" ] + output_file = "components_offline_pages_core_offline_page_feature_cc.inc" +} + +cpp_bromite_include("components_offline_pages_core_offline_page_feature_h") { + inputs = [ "//cromite_flags/components/offline_pages/core/offline_page_feature_h/placeholder.txt" ] + output_file = "components_offline_pages_core_offline_page_feature_h.inc" +} + +cpp_bromite_include("net_base_features_cc") { + inputs = [ "//cromite_flags/net/base/features_cc/placeholder.txt" ] + output_file = "net_base_features_cc.inc" +} + +cpp_bromite_include("net_base_features_h") { + inputs = [ "//cromite_flags/net/base/features_h/placeholder.txt" ] + output_file = "net_base_features_h.inc" +} + +cpp_bromite_include("services_network_public_cpp_features_cc") { + inputs = [ "//cromite_flags/services/network/public/cpp/features_cc/placeholder.txt" ] + output_file = "services_network_public_cpp_features_cc.inc" +} + +cpp_bromite_include("services_network_public_cpp_features_h") { + inputs = [ "//cromite_flags/services/network/public/cpp/features_h/placeholder.txt" ] + output_file = "services_network_public_cpp_features_h.inc" +} + +component("cromite_flags") { + deps = [ + ":content_common_features_cc", + ":content_public_common_content_features_cc", + ":content_public_common_content_features_h", + ":components_content_settings_core_common_features_cc", + ":components_permissions_features_cc", + ":components_offline_pages_core_offline_page_feature_cc", + ":components_offline_pages_core_offline_page_feature_h", + ":media_base_media_switches_cc", + ":media_base_media_switches_h", + ":net_base_features_cc", + ":net_base_features_h", + ":chrome_common_chrome_features_cc", + ":chrome_browser_about_flags_cc", + ":chrome_browser_flags_android_chrome_feature_list_cc", + ":chrome_browser_flags_android_chrome_feature_list_h", + ":chrome_browser_ui_ui_features_cc", + ":chrome_browser_browser_features_cc", + ":services_network_public_cpp_features_cc", + ":services_network_public_cpp_features_h", + ":third_party_blink_common_features_cc", + ":third_party_blink_common_features_h", + ] +} diff --git a/cromite_flags/chrome/browser/about_flags_cc/placeholder.txt b/cromite_flags/chrome/browser/about_flags_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/chrome/browser/about_flags_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/chrome/browser/browser_features_cc/placeholder.txt b/cromite_flags/chrome/browser/browser_features_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/chrome/browser/browser_features_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/placeholder.txt b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/placeholder.txt b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/chrome/browser/ui/ui_features_cc/placeholder.txt b/cromite_flags/chrome/browser/ui/ui_features_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/chrome/browser/ui/ui_features_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/chrome/common/chrome_features_cc/placeholder.txt b/cromite_flags/chrome/common/chrome_features_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/chrome/common/chrome_features_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/chrome/common/chrome_features_h/placeholder.txt b/cromite_flags/chrome/common/chrome_features_h/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/chrome/common/chrome_features_h/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/components/content_settings/core/common/features_cc/placeholder.txt b/cromite_flags/components/content_settings/core/common/features_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/components/content_settings/core/common/features_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/components/offline_pages/core/offline_page_feature_cc/placeholder.txt b/cromite_flags/components/offline_pages/core/offline_page_feature_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/components/offline_pages/core/offline_page_feature_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/components/offline_pages/core/offline_page_feature_h/placeholder.txt b/cromite_flags/components/offline_pages/core/offline_page_feature_h/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/components/offline_pages/core/offline_page_feature_h/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/components/permissions/features_cc/placeholder.txt b/cromite_flags/components/permissions/features_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/components/permissions/features_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/content/common/features_cc/placeholder.txt b/cromite_flags/content/common/features_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/content/common/features_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/content/public/common/content_features_cc/placeholder.txt b/cromite_flags/content/public/common/content_features_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/content/public/common/content_features_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/content/public/common/content_features_h/placeholder.txt b/cromite_flags/content/public/common/content_features_h/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/content/public/common/content_features_h/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/media/base/media_switches_cc/placeholder.txt b/cromite_flags/media/base/media_switches_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/media/base/media_switches_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/media/base/media_switches_h/placeholder.txt b/cromite_flags/media/base/media_switches_h/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/media/base/media_switches_h/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/net/base/features_cc/placeholder.txt b/cromite_flags/net/base/features_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/net/base/features_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/net/base/features_h/placeholder.txt b/cromite_flags/net/base/features_h/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/net/base/features_h/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/services/network/public/cpp/features_cc/placeholder.txt b/cromite_flags/services/network/public/cpp/features_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/services/network/public/cpp/features_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/services/network/public/cpp/features_h/placeholder.txt b/cromite_flags/services/network/public/cpp/features_h/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/services/network/public/cpp/features_h/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/third_party/blink/common/features_cc/placeholder.txt b/cromite_flags/third_party/blink/common/features_cc/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/third_party/blink/common/features_cc/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/cromite_flags/third_party/blink/common/features_h/placeholder.txt b/cromite_flags/third_party/blink/common/features_h/placeholder.txt new file mode 100755 --- /dev/null +++ b/cromite_flags/third_party/blink/common/features_h/placeholder.txt @@ -0,0 +1 @@ +this file is intentionally empty diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc @@ -1860,5 +1860,5 @@ uint32_t GetPassthroughAudioFormats() { return 0; #endif // BUILDFLAG(ENABLE_PASSTHROUGH_AUDIO_CODECS) } - +#include "cromite_flags/media_base_media_switches_cc.inc" } // namespace media diff --git a/media/base/media_switches.h b/media/base/media_switches.h --- a/media/base/media_switches.h +++ b/media/base/media_switches.h @@ -547,5 +547,5 @@ MEDIA_EXPORT bool IsOutOfProcessVideoDecodingEnabled(); MEDIA_EXPORT uint32_t GetPassthroughAudioFormats(); } // namespace media - +#include "cromite_flags/media_base_media_switches_h.inc" #endif // MEDIA_BASE_MEDIA_SWITCHES_H_ diff --git a/net/base/features.cc b/net/base/features.cc --- a/net/base/features.cc +++ b/net/base/features.cc @@ -535,4 +535,5 @@ BASE_FEATURE(kTruncateBodyToContentLength, "TruncateBodyToContentLength", base::FEATURE_ENABLED_BY_DEFAULT); +#include "cromite_flags/net_base_features_cc.inc" } // namespace net::features diff --git a/net/base/features.h b/net/base/features.h --- a/net/base/features.h +++ b/net/base/features.h @@ -523,6 +523,7 @@ NET_EXPORT BASE_DECLARE_FEATURE(kTreatHTTPExpiresHeaderValueZeroAsExpired); // Enables truncating the response body to the content length. NET_EXPORT BASE_DECLARE_FEATURE(kTruncateBodyToContentLength); +#include "cromite_flags/net_base_features_h.inc" } // namespace net::features #endif // NET_BASE_FEATURES_H_ diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc --- a/services/network/public/cpp/features.cc +++ b/services/network/public/cpp/features.cc @@ -467,4 +467,5 @@ const base::FeatureParam kSkipTpcdMitigationsForAdsTopLevelTrial{ /*name=*/"SkipTpcdMitigationsForAdsTopLevelTrial", /*default_value=*/false}; +#include "cromite_flags/services_network_public_cpp_features_cc.inc" } // namespace network::features diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h --- a/services/network/public/cpp/features.h +++ b/services/network/public/cpp/features.h @@ -187,6 +187,7 @@ extern const base::FeatureParam kSkipTpcdMitigationsForAdsTrial; COMPONENT_EXPORT(NETWORK_CPP) extern const base::FeatureParam kSkipTpcdMitigationsForAdsTopLevelTrial; +#include "cromite_flags/services_network_public_cpp_features_h.inc" } // namespace features } // namespace network diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc @@ -2546,5 +2546,6 @@ BASE_FEATURE(kSimplifyLoadingTransparentPlaceholderImage, "SimplifyLoadingTransparentPlaceholderImage", base::FEATURE_DISABLED_BY_DEFAULT); +#include "cromite_flags/third_party_blink_common_features_cc.inc" } // namespace features } // namespace blink diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h --- a/third_party/blink/public/common/features.h +++ b/third_party/blink/public/common/features.h @@ -1638,6 +1638,7 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kInteractiveDetectorIgnoreFcp); BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( kSimplifyLoadingTransparentPlaceholderImage); +#include "cromite_flags/third_party_blink_common_features_h.inc" } // namespace features } // namespace blink --