| Index: chrome/browser/chrome_content_browser_client.cc
|
| diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
|
| index 1e4392e3f943535bc79a97015283acdd12ce6494..331a597ea2104070dc72b334e85dad1ee29aca1d 100644
|
| --- a/chrome/browser/chrome_content_browser_client.cc
|
| +++ b/chrome/browser/chrome_content_browser_client.cc
|
| @@ -1218,13 +1218,48 @@ void MaybeAppendBlinkSettingsSwitchForFieldTrial(
|
| }
|
| }
|
| }
|
| +
|
| + // Flags for the ResourcePriorities field trial. The settings are
|
| + // encoded in the field trial group name instead of as variations
|
| + // because the variations code is not accessible from the loader.
|
| + //
|
| + // The group name encoding looks like this:
|
| + // <descriptiveName>_ABCDE_E2_F_G
|
| + // A - fetchDeferLateScripts (1 for true, 0 for false)
|
| + // B - fetchIncreaseFontPriority (1 for true, 0 for false)
|
| + // C - fetchIncreaseAsyncScriptPriority (1 for true, 0 for false)
|
| + // D - fetchIncreasePriorities (1 for true, 0 for false)
|
| + // E - fetchEnableLayoutBlockingThreshold (1 for true, 0 for false)
|
| + // E2 - fetchLayoutBlockingThreshold (Numeric)
|
| + // F - fetchMaxNumDelayableWhileLayoutBlocking (Numeric)
|
| + // G - fetchMaxNumDelayableRequests (Numeric)
|
| + //
|
| + // Only A-D are relevant to blink and exposed as settings
|
| + // Any group names (Control, Default, etc) will not match the pattern or
|
| + // flags and will get the default settings which is the expected behavior.
|
| + std::string resource_priorities_trial_group =
|
| + base::FieldTrialList::FindFullName("ResourcePriorities");
|
| + std::vector<std::string> split_group(
|
| + base::SplitString(resource_priorities_trial_group, "_",
|
| + base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL));
|
| + if (split_group.size() == 5 && split_group[1].length() == 5) {
|
| + if (split_group[1].at(0) == '1')
|
| + blink_settings.push_back("fetchDeferLateScripts=true");
|
| + if (split_group[1].at(1) == '1')
|
| + blink_settings.push_back("fetchIncreaseFontPriority=true");
|
| + if (split_group[1].at(2) == '1')
|
| + blink_settings.push_back("fetchIncreaseAsyncScriptPriority=true");
|
| + if (split_group[1].at(3) == '1')
|
| + blink_settings.push_back("fetchIncreasePriorities=true");
|
| + }
|
| +
|
| if (blink_settings.empty()) {
|
| return;
|
| }
|
|
|
| if (browser_command_line.HasSwitch(switches::kBlinkSettings) ||
|
| command_line->HasSwitch(switches::kBlinkSettings)) {
|
| - // The field trial is configured to force users that specify the
|
| + // The field trials should be configured to force users that specify the
|
| // blink-settings flag into a group with no params, and we return
|
| // above if no params were specified, so it's an error if we reach
|
| // this point.
|
|
|