What determines 'Default' value in chrome://flags

4,317 views
Skip to first unread message

Suzuki

unread,
Mar 11, 2016, 5:14:27 PM3/11/16
to Chromium-dev
Hi all.

There are combo-boxes consist of 'Default', 'Enabled' and 'Disabled' in chrome://flags. My questions are:
  • What determines 'Default' value. (.gyp or source code?)
  • Why the default value is different between developer build and official build.
  • How can I set default values in my chromium build.
Before these questions, I have found that the default value is apparently difference between Chrome and Chromium. For example, 'Experimental QUIC protocol' is enabled by default in Chrome, but looked disabled by default in Chromium. The flag may have a type of  ENABLE_DISABLE_VALUE_TYPE in about_flags.cc, but I can't understand what determines the default value. https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/about_flags.cc

I really hope I can make developer build to have same default values as official build. Any idea?

Peter Kasting

unread,
Mar 11, 2016, 5:27:02 PM3/11/16
to taro.su...@gmail.com, Chromium-dev
On Fri, Mar 11, 2016 at 2:14 PM, Suzuki <taro.su...@gmail.com> wrote:
There are combo-boxes consist of 'Default', 'Enabled' and 'Disabled' in chrome://flags. My questions are:
  • What determines 'Default' value. (.gyp or source code?)
"Default" has a default value set by source code but in many cases can be overridden dynamically by the field trial code.  Selecting one of the other values forces that value and prevents field trials from toggling it.

This also means local tests of what "Default" equates to are unreliable, as one of your builds may wind up in a different field trial than another.

PK

Suzuki

unread,
Mar 11, 2016, 6:22:42 PM3/11/16
to Chromium-dev, taro.su...@gmail.com
Thanks, Peter.

It looks like for me that official build doesn't use the field trial code because it describes below in common.gypi:
      # Set to 1 to make a build that disables activation of field trial tests
      # specified in testing/variations/fieldtrial_testing_config_*.json.
      # Note: this setting is ignored if branding=="Chrome".
      'fieldtrial_testing_like_official_build%': 0,
 I did set fieldtrial_testing_like_official_build=1 in GYP_DEFINES before building chromium, but the default value set seemed to be different as official build. What source code make the difference? That would help me.

2016年3月12日土曜日 7時27分02秒 UTC+9 Peter Kasting:

Alexei Svitkine

unread,
Mar 14, 2016, 11:17:57 AM3/14/16
to taro.su...@gmail.com, Chromium-dev
Here's the relevant code:


Official builds behave like official chrome - i.e. they use VariationsService to fetch field trial configs from the server.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Suzuki

unread,
Mar 14, 2016, 11:19:39 PM3/14/16
to Chromium-dev, taro.su...@gmail.com
That's the answer I found. My question becomes clear though I guess that a developer build cannot behave same as a official one unless fetching field trial configs. Thank you.


2016年3月15日火曜日 0時17分57秒 UTC+9 Alexei Svitkine:

Igor Ianishevskyi

unread,
Dec 16, 2016, 7:32:53 AM12/16/16
to Chromium-dev, taro.su...@gmail.com
Hi, guys

I'm waking up the thread because it is still unclear for me how to change the default value of a specific flag.

I'm trying to change the default value of "kDisableGestureRequirementForMediaPlayback" at the moment and have no luck with that. 
In about_flags.cc it is displaying with SINGLE_DISABLE_VALUE_TYPE macros, however changing the macros to SINGLE_VALUE_TYPE does not help, and I'm assuming its because it does not modify or set the value but just managing the way the value is displayed.

Getting more deep, I've tried to apply the switch later with 
base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableGestureRequirementForPresentation);
in ChromeMainDelegate::BasicStartupComplete. Didn't work.

So I'm basically wondering where those values are applied and how can I modify their default values? 
Thanks

пятница, 11 марта 2016 г., 23:27:02 UTC+1 пользователь Peter Kasting написал:

Greg Thompson

unread,
Dec 16, 2016, 10:32:07 AM12/16/16
to igorian...@gmail.com, Chromium-dev, taro.su...@gmail.com
Since this is a command line switch, look for calls to CommandLine::HasSwitch(switches::kDisableGestureRequirementForMediaPlayback).

--

Ian Clelland

unread,
Dec 16, 2016, 10:35:35 AM12/16/16
to igorian...@gmail.com, Chromium-dev, taro.su...@gmail.com
On Fri, Dec 16, 2016 at 7:32 AM, Igor Ianishevskyi <igorian...@gmail.com> wrote:
Hi, guys

I'm waking up the thread because it is still unclear for me how to change the default value of a specific flag.

I'm trying to change the default value of "kDisableGestureRequirementForMediaPlayback" at the moment and have no luck with that. 
In about_flags.cc it is displaying with SINGLE_DISABLE_VALUE_TYPE macros, however changing the macros to SINGLE_VALUE_TYPE does not help, and I'm assuming its because it does not modify or set the value but just managing the way the value is displayed.

Getting more deep, I've tried to apply the switch later with 
base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableGestureRequirementForPresentation);
in ChromeMainDelegate::BasicStartupComplete. Didn't work.

I think that should be sufficient on Android -- you're adding the command line switch in the browser process, and doing it early enough that it will be propagated to the renderer, where it actually has some effect.

On desktop platforms, though, it looks like that behaviour is actually controlled through the Feature kCrossOriginMediaPlaybackRequiresUserGesture (see content_features.cc), and you may need to override that instead (or as well, I haven't read through all of the code around it).

So I'm basically wondering where those values are applied and how can I modify their default values? 
Thanks

пятница, 11 марта 2016 г., 23:27:02 UTC+1 пользователь Peter Kasting написал:
On Fri, Mar 11, 2016 at 2:14 PM, Suzuki <taro.su...@gmail.com> wrote:
There are combo-boxes consist of 'Default', 'Enabled' and 'Disabled' in chrome://flags. My questions are:
  • What determines 'Default' value. (.gyp or source code?)
"Default" has a default value set by source code but in many cases can be overridden dynamically by the field trial code.  Selecting one of the other values forces that value and prevents field trials from toggling it.

This also means local tests of what "Default" equates to are unreliable, as one of your builds may wind up in a different field trial than another.

PK

--

Igor Ianishevskyi

unread,
Jan 3, 2017, 9:06:28 AM1/3/17
to Ian Clelland, Chromium-dev, taro.su...@gmail.com
Thanks a lot, guys!

I couldn't disable the feature, however we've made a workaround

пт, 16 дек. 2016 г. в 16:34, Ian Clelland <icle...@chromium.org>:
Reply all
Reply to author
Forward
0 new messages