| OLD | NEW |
| 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/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 if (command_line.HasSwitch(switches::kReducedReferrerGranularity)) | 187 if (command_line.HasSwitch(switches::kReducedReferrerGranularity)) |
| 188 WebRuntimeFeatures::enableReducedReferrerGranularity(true); | 188 WebRuntimeFeatures::enableReducedReferrerGranularity(true); |
| 189 | 189 |
| 190 if (command_line.HasSwitch(switches::kEnablePushMessagePayload)) | 190 if (command_line.HasSwitch(switches::kEnablePushMessagePayload)) |
| 191 WebRuntimeFeatures::enablePushMessagingData(true); | 191 WebRuntimeFeatures::enablePushMessagingData(true); |
| 192 | 192 |
| 193 if (command_line.HasSwitch(switches::kDisablePermissionsAPI)) | 193 if (command_line.HasSwitch(switches::kDisablePermissionsAPI)) |
| 194 WebRuntimeFeatures::enablePermissionsAPI(false); | 194 WebRuntimeFeatures::enablePermissionsAPI(false); |
| 195 | 195 |
| 196 // Delete "StaleWhileRevalidate" line from chrome_browser_field_trials.cc | |
| 197 // when this experiment is done. | |
| 198 if (base::FieldTrialList::FindFullName("StaleWhileRevalidate") == "Enabled" || | |
| 199 command_line.HasSwitch(switches::kEnableStaleWhileRevalidate)) | |
| 200 WebRuntimeFeatures::enableStaleWhileRevalidateCacheControl(true); | |
| 201 | |
| 202 if (command_line.HasSwitch(switches::kDisableV8IdleTasks)) | 196 if (command_line.HasSwitch(switches::kDisableV8IdleTasks)) |
| 203 WebRuntimeFeatures::enableV8IdleTasks(false); | 197 WebRuntimeFeatures::enableV8IdleTasks(false); |
| 204 else | 198 else |
| 205 WebRuntimeFeatures::enableV8IdleTasks(true); | 199 WebRuntimeFeatures::enableV8IdleTasks(true); |
| 206 | 200 |
| 207 if (command_line.HasSwitch(switches::kEnableUnsafeES3APIs)) | 201 if (command_line.HasSwitch(switches::kEnableUnsafeES3APIs)) |
| 208 WebRuntimeFeatures::enableUnsafeES3APIs(true); | 202 WebRuntimeFeatures::enableUnsafeES3APIs(true); |
| 209 | 203 |
| 210 if (command_line.HasSwitch(switches::kEnableWebVR)) { | 204 if (command_line.HasSwitch(switches::kEnableWebVR)) { |
| 211 WebRuntimeFeatures::enableWebVR(true); | 205 WebRuntimeFeatures::enableWebVR(true); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 228 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 222 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 229 std::vector<std::string> disabled_features = base::SplitString( | 223 std::vector<std::string> disabled_features = base::SplitString( |
| 230 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 224 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 231 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 225 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 232 for (const std::string& feature : disabled_features) | 226 for (const std::string& feature : disabled_features) |
| 233 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 227 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
| 234 } | 228 } |
| 235 } | 229 } |
| 236 | 230 |
| 237 } // namespace content | 231 } // namespace content |
| OLD | NEW |