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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 1230133005: Fix Resource Priorities and Scheduling (Chrome Side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comment Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
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");
mmenke 2015/08/11 17:57:23 Is the code to implement these landed yet?
Pat Meenan 2015/08/12 16:20:59 Not yet. Currently under review: https://coderevi
+ }
+
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.

Powered by Google App Engine
This is Rietveld 408576698