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

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

Issue 2779603002: Enable blocking of subresource requests whose URLs include credentials. (Closed)
Patch Set: Tests. Created 3 years, 9 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 359
360 // Enable features which VrShell depends on. 360 // Enable features which VrShell depends on.
361 if (base::FeatureList::IsEnabled(features::kVrShell)) { 361 if (base::FeatureList::IsEnabled(features::kVrShell)) {
362 WebRuntimeFeatures::enableGamepadExtensions(true); 362 WebRuntimeFeatures::enableGamepadExtensions(true);
363 WebRuntimeFeatures::enableWebVR(true); 363 WebRuntimeFeatures::enableWebVR(true);
364 } 364 }
365 365
366 if (base::FeatureList::IsEnabled(features::kLoadingWithMojo)) 366 if (base::FeatureList::IsEnabled(features::kLoadingWithMojo))
367 WebRuntimeFeatures::enableLoadingWithMojo(true); 367 WebRuntimeFeatures::enableLoadingWithMojo(true);
368 368
369 if (!base::FeatureList::IsEnabled(features::kBlockCredentialedSubresources)) {
370 WebRuntimeFeatures::enableFeatureFromString("BlockCredentialedSubresources",
371 false);
372 }
373
369 // Enable explicitly enabled features, and then disable explicitly disabled 374 // Enable explicitly enabled features, and then disable explicitly disabled
370 // ones. 375 // ones.
371 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { 376 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) {
372 std::vector<std::string> enabled_features = base::SplitString( 377 std::vector<std::string> enabled_features = base::SplitString(
373 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), 378 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures),
374 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 379 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
375 for (const std::string& feature : enabled_features) 380 for (const std::string& feature : enabled_features)
376 WebRuntimeFeatures::enableFeatureFromString(feature, true); 381 WebRuntimeFeatures::enableFeatureFromString(feature, true);
377 } 382 }
378 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { 383 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
379 std::vector<std::string> disabled_features = base::SplitString( 384 std::vector<std::string> disabled_features = base::SplitString(
380 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), 385 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures),
381 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 386 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
382 for (const std::string& feature : disabled_features) 387 for (const std::string& feature : disabled_features)
383 WebRuntimeFeatures::enableFeatureFromString(feature, false); 388 WebRuntimeFeatures::enableFeatureFromString(feature, false);
384 } 389 }
385 } 390 }
386 391
387 } // namespace content 392 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698