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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/field_trial.h" |
8 #include "content/common/content_switches_internal.h" | 9 #include "content/common/content_switches_internal.h" |
9 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
10 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 11 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
11 #include "ui/native_theme/native_theme_switches.h" | 12 #include "ui/native_theme/native_theme_switches.h" |
12 | 13 |
13 #if defined(OS_ANDROID) | 14 #if defined(OS_ANDROID) |
14 #include <cpu-features.h> | 15 #include <cpu-features.h> |
15 #include "base/android/build_info.h" | 16 #include "base/android/build_info.h" |
16 #include "base/metrics/field_trial.h" | 17 #include "base/metrics/field_trial.h" |
17 #include "media/base/android/media_codec_bridge.h" | 18 #include "media/base/android/media_codec_bridge.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 139 |
139 if (command_line.HasSwitch(switches::kEnableWebMIDI)) | 140 if (command_line.HasSwitch(switches::kEnableWebMIDI)) |
140 WebRuntimeFeatures::enableWebMIDI(true); | 141 WebRuntimeFeatures::enableWebMIDI(true); |
141 | 142 |
142 if (command_line.HasSwitch(switches::kDisableFileSystem)) | 143 if (command_line.HasSwitch(switches::kDisableFileSystem)) |
143 WebRuntimeFeatures::enableFileSystem(false); | 144 WebRuntimeFeatures::enableFileSystem(false); |
144 | 145 |
145 if (command_line.HasSwitch(switches::kEnableExperimentalCanvasFeatures)) | 146 if (command_line.HasSwitch(switches::kEnableExperimentalCanvasFeatures)) |
146 WebRuntimeFeatures::enableExperimentalCanvasFeatures(true); | 147 WebRuntimeFeatures::enableExperimentalCanvasFeatures(true); |
147 | 148 |
148 if (command_line.HasSwitch(switches::kEnableDisplayList2dCanvas)) | 149 if (command_line.HasSwitch(switches::kDisableDisplayList2dCanvas)) { |
| 150 WebRuntimeFeatures::enableDisplayList2dCanvas(false); |
| 151 } else if (command_line.HasSwitch(switches::kEnableDisplayList2dCanvas)) { |
149 WebRuntimeFeatures::enableDisplayList2dCanvas(true); | 152 WebRuntimeFeatures::enableDisplayList2dCanvas(true); |
| 153 } else { |
| 154 WebRuntimeFeatures::enableDisplayList2dCanvas( |
| 155 base::FieldTrialList::FindFullName("DisplayList2dCanvas") == "Enabled" |
| 156 ); |
| 157 } |
150 | 158 |
151 if (command_line.HasSwitch(switches::kEnableWebGLDraftExtensions)) | 159 if (command_line.HasSwitch(switches::kEnableWebGLDraftExtensions)) |
152 WebRuntimeFeatures::enableWebGLDraftExtensions(true); | 160 WebRuntimeFeatures::enableWebGLDraftExtensions(true); |
153 | 161 |
154 if (command_line.HasSwitch(switches::kEnableWebGLImageChromium)) | 162 if (command_line.HasSwitch(switches::kEnableWebGLImageChromium)) |
155 WebRuntimeFeatures::enableWebGLImageChromium(true); | 163 WebRuntimeFeatures::enableWebGLImageChromium(true); |
156 | 164 |
157 if (command_line.HasSwitch(switches::kEnableOverlayFullscreenVideo)) | 165 if (command_line.HasSwitch(switches::kEnableOverlayFullscreenVideo)) |
158 WebRuntimeFeatures::enableOverlayFullscreenVideo(true); | 166 WebRuntimeFeatures::enableOverlayFullscreenVideo(true); |
159 | 167 |
(...skipping 13 matching lines...) Expand all Loading... |
173 WebRuntimeFeatures::enableLayerSquashing(true); | 181 WebRuntimeFeatures::enableLayerSquashing(true); |
174 | 182 |
175 if (command_line.HasSwitch(switches::kEnableNetworkInformation) || | 183 if (command_line.HasSwitch(switches::kEnableNetworkInformation) || |
176 command_line.HasSwitch( | 184 command_line.HasSwitch( |
177 switches::kEnableExperimentalWebPlatformFeatures)) { | 185 switches::kEnableExperimentalWebPlatformFeatures)) { |
178 WebRuntimeFeatures::enableNetworkInformation(true); | 186 WebRuntimeFeatures::enableNetworkInformation(true); |
179 } | 187 } |
180 } | 188 } |
181 | 189 |
182 } // namespace content | 190 } // namespace content |
OLD | NEW |