| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 if (command_line.HasSwitch(switches::kReducedReferrerGranularity)) | 183 if (command_line.HasSwitch(switches::kReducedReferrerGranularity)) |
| 184 WebRuntimeFeatures::enableReducedReferrerGranularity(true); | 184 WebRuntimeFeatures::enableReducedReferrerGranularity(true); |
| 185 | 185 |
| 186 if (command_line.HasSwitch(switches::kEnablePushMessagePayload)) | 186 if (command_line.HasSwitch(switches::kEnablePushMessagePayload)) |
| 187 WebRuntimeFeatures::enablePushMessagingData(true); | 187 WebRuntimeFeatures::enablePushMessagingData(true); |
| 188 | 188 |
| 189 if (command_line.HasSwitch(switches::kDisablePermissionsAPI)) | 189 if (command_line.HasSwitch(switches::kDisablePermissionsAPI)) |
| 190 WebRuntimeFeatures::enablePermissionsAPI(false); | 190 WebRuntimeFeatures::enablePermissionsAPI(false); |
| 191 | 191 |
| 192 // Delete "StaleWhileRevalidate" line from chrome_browser_field_trials.cc | |
| 193 // when this experiment is done. | |
| 194 if (base::FieldTrialList::FindFullName("StaleWhileRevalidate") == "Enabled" || | |
| 195 command_line.HasSwitch(switches::kEnableStaleWhileRevalidate)) | |
| 196 WebRuntimeFeatures::enableStaleWhileRevalidateCacheControl(true); | |
| 197 | |
| 198 if (command_line.HasSwitch(switches::kDisableV8IdleTasks)) | 192 if (command_line.HasSwitch(switches::kDisableV8IdleTasks)) |
| 199 WebRuntimeFeatures::enableV8IdleTasks(false); | 193 WebRuntimeFeatures::enableV8IdleTasks(false); |
| 200 else | 194 else |
| 201 WebRuntimeFeatures::enableV8IdleTasks(true); | 195 WebRuntimeFeatures::enableV8IdleTasks(true); |
| 202 | 196 |
| 203 if (command_line.HasSwitch(switches::kEnableUnsafeES3APIs)) | 197 if (command_line.HasSwitch(switches::kEnableUnsafeES3APIs)) |
| 204 WebRuntimeFeatures::enableUnsafeES3APIs(true); | 198 WebRuntimeFeatures::enableUnsafeES3APIs(true); |
| 205 | 199 |
| 206 // Enable explicitly enabled features, and then disable explicitly disabled | 200 // Enable explicitly enabled features, and then disable explicitly disabled |
| 207 // ones. | 201 // ones. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 221 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',', | 215 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',', |
| 222 &disabled_features); | 216 &disabled_features); |
| 223 for (const std::string& feature : disabled_features) { | 217 for (const std::string& feature : disabled_features) { |
| 224 WebRuntimeFeatures::enableFeatureFromString( | 218 WebRuntimeFeatures::enableFeatureFromString( |
| 225 blink::WebString::fromLatin1(feature), false); | 219 blink::WebString::fromLatin1(feature), false); |
| 226 } | 220 } |
| 227 } | 221 } |
| 228 } | 222 } |
| 229 | 223 |
| 230 } // namespace content | 224 } // namespace content |
| OLD | NEW |