Chromium Code Reviews| Index: content/child/runtime_features.cc |
| diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc |
| index 9ebda8a1510057cc5a987ba87f8391b812573113..5c130a98a85129727d69e31d1ce607d61290534c 100644 |
| --- a/content/child/runtime_features.cc |
| +++ b/content/child/runtime_features.cc |
| @@ -314,8 +314,20 @@ 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, unless the command line explicitly enabled the feature, |
| + // this feature should be available only when an valid origin trial token is |
|
clamy
2017/01/13 17:44:09
nit: s/an/a
horo
2017/01/13 23:01:24
Done.
|
| + // set. This check is done by the generated code of |
| + // 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); |