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 13 matching lines...) Expand all Loading... |
225 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 219 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
226 std::vector<std::string> disabled_features = base::SplitString( | 220 std::vector<std::string> disabled_features = base::SplitString( |
227 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 221 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
228 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 222 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
229 for (const std::string& feature : disabled_features) | 223 for (const std::string& feature : disabled_features) |
230 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 224 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
231 } | 225 } |
232 } | 226 } |
233 | 227 |
234 } // namespace content | 228 } // namespace content |
OLD | NEW |