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

Side by Side Diff: content/child/runtime_features.cc

Issue 2637763002: Enable ServiceWorkerNavigationPreload by default for Origin-Trial. (Closed)
Patch Set: incorporated kinuko'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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/runtime_features.h" 5 #include "content/child/runtime_features.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 WebRuntimeFeatures::enableSendBeaconThrowForBlobWithNonSimpleType(true); 307 WebRuntimeFeatures::enableSendBeaconThrowForBlobWithNonSimpleType(true);
308 308
309 #if defined(OS_ANDROID) 309 #if defined(OS_ANDROID)
310 if (command_line.HasSwitch(switches::kDisableMediaSessionAPI)) 310 if (command_line.HasSwitch(switches::kDisableMediaSessionAPI))
311 WebRuntimeFeatures::enableMediaSession(false); 311 WebRuntimeFeatures::enableMediaSession(false);
312 312
313 WebRuntimeFeatures::enablePaymentRequest( 313 WebRuntimeFeatures::enablePaymentRequest(
314 base::FeatureList::IsEnabled(features::kWebPayments)); 314 base::FeatureList::IsEnabled(features::kWebPayments));
315 #endif 315 #endif
316 316
317 // We set the RuntimeEnabledFeatures for Navigation Preload feature only when 317 // Sets the RuntimeEnabledFeatures for Navigation Preload feature only when
318 // it is set by "--enable-features" flag. 318 // '--enable-features' command line flag is given. While experimenting this
319 // While we are experimenting this feature using Origin Trial, we enable this 319 // feature using Origin-Trial, this base::Feature is enabled by default in
320 // feature using the field trial mechanism. So FeatureList::IsEnabled() always 320 // content_features.cc. So FeatureList::IsEnabled() always returns true. But,
321 // returns true. But, unless the command line explicitly enabled the feature, 321 // unless the command line explicitly enabled the feature, this feature should
322 // this feature should be available only when a valid origin trial token is 322 // be available only when a valid origin trial token is set. This check is
323 // set. This check is done by the generated code of 323 // done by the generated code of
324 // blink::OriginTrials::serviceWorkerNavigationPreloadEnabled(). See the 324 // blink::OriginTrials::serviceWorkerNavigationPreloadEnabled(). See the
325 // comments in service_worker_version.h for the details. 325 // comments in service_worker_version.h for the details.
326 if (base::FeatureList::GetInstance()->IsFeatureOverriddenFromCommandLine( 326 if (base::FeatureList::GetInstance()->IsFeatureOverriddenFromCommandLine(
327 features::kServiceWorkerNavigationPreload.name, 327 features::kServiceWorkerNavigationPreload.name,
328 base::FeatureList::OVERRIDE_ENABLE_FEATURE)) { 328 base::FeatureList::OVERRIDE_ENABLE_FEATURE)) {
329 WebRuntimeFeatures::enableServiceWorkerNavigationPreload(true); 329 WebRuntimeFeatures::enableServiceWorkerNavigationPreload(true);
330 } 330 }
331 331
332 if (base::FeatureList::IsEnabled(features::kSpeculativeLaunchServiceWorker)) 332 if (base::FeatureList::IsEnabled(features::kSpeculativeLaunchServiceWorker))
333 WebRuntimeFeatures::enableSpeculativeLaunchServiceWorker(true); 333 WebRuntimeFeatures::enableSpeculativeLaunchServiceWorker(true);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { 367 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
368 std::vector<std::string> disabled_features = base::SplitString( 368 std::vector<std::string> disabled_features = base::SplitString(
369 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), 369 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures),
370 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 370 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
371 for (const std::string& feature : disabled_features) 371 for (const std::string& feature : disabled_features)
372 WebRuntimeFeatures::enableFeatureFromString(feature, false); 372 WebRuntimeFeatures::enableFeatureFromString(feature, false);
373 } 373 }
374 } 374 }
375 375
376 } // namespace content 376 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_version.h ('k') | content/public/common/content_features.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698