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

Unified Diff: content/child/runtime_features.cc

Issue 2627023002: Introduce Origin-Trial for Service Worker Navigation Preload (Closed)
Patch Set: incorporated falken's comment Created 3 years, 11 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: content/child/runtime_features.cc
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
index 9ebda8a1510057cc5a987ba87f8391b812573113..cfa60de66779d3e0fe9b05b71a193864fb7f1251 100644
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -314,8 +314,19 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
base::FeatureList::IsEnabled(features::kWebPayments));
#endif
- if (base::FeatureList::IsEnabled(features::kServiceWorkerNavigationPreload))
+ // We set the RuntimeEnabledFeatures for Navigation Preload feature only when
+ // it is set by "--enable-features" flag.
+ // While we are experimenting this feature using Origin-Trial, we enable this
+ // feature using the field trial mechanism. So FeatureList::IsEnabled() always
+ // returns true. But this feature should be availabe only when an valid origin
falken 2017/01/13 09:13:21 nit: available
horo 2017/01/13 09:27:57 Done.
+ // trial token is set. This check is done by the generated code of
falken 2017/01/13 09:13:21 maybe clearer to say: "But, unless the command lin
horo 2017/01/13 09:27:57 Done.
+ // blink::OriginTrials::serviceWorkerNavigationPreloadEnabled(). See the
+ // comments in service_worker_version.h for the details.
+ if (base::FeatureList::GetInstance()->IsFeatureOverriddenFromCommandLine(
+ features::kServiceWorkerNavigationPreload.name,
+ base::FeatureList::OVERRIDE_ENABLE_FEATURE)) {
WebRuntimeFeatures::enableServiceWorkerNavigationPreload(true);
+ }
if (base::FeatureList::IsEnabled(features::kSpeculativeLaunchServiceWorker))
WebRuntimeFeatures::enableSpeculativeLaunchServiceWorker(true);

Powered by Google App Engine
This is Rietveld 408576698