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

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

Issue 2279543004: [DocWriteBlocking] Add feature to block doc.written scripts if 2g-like network (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added helper method: isConnectionEffectively2G Created 4 years, 3 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // Note that it might already by true for OS_ANDROID, above. This is for 233 // Note that it might already by true for OS_ANDROID, above. This is for
234 // non-android versions. 234 // non-android versions.
235 if (base::FeatureList::IsEnabled(features::kNewMediaPlaybackUi)) 235 if (base::FeatureList::IsEnabled(features::kNewMediaPlaybackUi))
236 WebRuntimeFeatures::enableNewMediaPlaybackUi(true); 236 WebRuntimeFeatures::enableNewMediaPlaybackUi(true);
237 237
238 if (base::FeatureList::IsEnabled( 238 if (base::FeatureList::IsEnabled(
239 features::kNonValidatingReloadOnNormalReload)) { 239 features::kNonValidatingReloadOnNormalReload)) {
240 WebRuntimeFeatures::enableReloadwithoutSubResourceCacheRevalidation(true); 240 WebRuntimeFeatures::enableReloadwithoutSubResourceCacheRevalidation(true);
241 } 241 }
242 242
243 if (base::FeatureList::IsEnabled(features::kBlockDocWriteIfEffectively2G)) {
244 WebRuntimeFeatures::enableBlockDocWriteIfEffectively2G(true);
245 }
246
243 if (base::FeatureList::IsEnabled(features::kDocumentWriteEvaluator)) 247 if (base::FeatureList::IsEnabled(features::kDocumentWriteEvaluator))
244 WebRuntimeFeatures::enableDocumentWriteEvaluator(true); 248 WebRuntimeFeatures::enableDocumentWriteEvaluator(true);
245 249
246 WebRuntimeFeatures::enableMediaDocumentDownloadButton( 250 WebRuntimeFeatures::enableMediaDocumentDownloadButton(
247 base::FeatureList::IsEnabled(features::kMediaDocumentDownloadButton)); 251 base::FeatureList::IsEnabled(features::kMediaDocumentDownloadButton));
248 252
249 if (base::FeatureList::IsEnabled(features::kPointerEvents)) 253 if (base::FeatureList::IsEnabled(features::kPointerEvents))
250 WebRuntimeFeatures::enablePointerEvent(true); 254 WebRuntimeFeatures::enablePointerEvent(true);
251 255
252 if (base::FeatureList::IsEnabled(features::kPointerEventV1SpecCapturing)) 256 if (base::FeatureList::IsEnabled(features::kPointerEventV1SpecCapturing))
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { 305 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
302 std::vector<std::string> disabled_features = base::SplitString( 306 std::vector<std::string> disabled_features = base::SplitString(
303 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), 307 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures),
304 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 308 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
305 for (const std::string& feature : disabled_features) 309 for (const std::string& feature : disabled_features)
306 WebRuntimeFeatures::enableFeatureFromString(feature, false); 310 WebRuntimeFeatures::enableFeatureFromString(feature, false);
307 } 311 }
308 } 312 }
309 313
310 } // namespace content 314 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/public/common/content_features.h » ('j') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('J')

Powered by Google App Engine
This is Rietveld 408576698