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

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

Issue 2349593002: Wire WebFonts intervention v2 for ECT of 3G (Closed)
Patch Set: 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 WebRuntimeFeatures::enableWebVR(true); 195 WebRuntimeFeatures::enableWebVR(true);
196 196
197 if (command_line.HasSwitch(switches::kDisablePresentationAPI)) 197 if (command_line.HasSwitch(switches::kDisablePresentationAPI))
198 WebRuntimeFeatures::enablePresentationAPI(false); 198 WebRuntimeFeatures::enablePresentationAPI(false);
199 199
200 const std::string webfonts_intervention_v2_group_name = 200 const std::string webfonts_intervention_v2_group_name =
201 base::FieldTrialList::FindFullName("WebFontsInterventionV2"); 201 base::FieldTrialList::FindFullName("WebFontsInterventionV2");
202 const std::string webfonts_intervention_v2_about_flag = 202 const std::string webfonts_intervention_v2_about_flag =
203 command_line.GetSwitchValueASCII(switches::kEnableWebFontsInterventionV2); 203 command_line.GetSwitchValueASCII(switches::kEnableWebFontsInterventionV2);
204 if (!webfonts_intervention_v2_about_flag.empty()) { 204 if (!webfonts_intervention_v2_about_flag.empty()) {
205 WebRuntimeFeatures::enableWebFontsInterventionV2With3G(
206 webfonts_intervention_v2_about_flag.compare(
207 switches::kEnableWebFontsInterventionV2SwitchValueEnabledWith3G) ==
208 0);
205 WebRuntimeFeatures::enableWebFontsInterventionV2With2G( 209 WebRuntimeFeatures::enableWebFontsInterventionV2With2G(
206 webfonts_intervention_v2_about_flag.compare( 210 webfonts_intervention_v2_about_flag.compare(
207 switches::kEnableWebFontsInterventionV2SwitchValueEnabledWith2G) == 211 switches::kEnableWebFontsInterventionV2SwitchValueEnabledWith2G) ==
208 0); 212 0);
209 WebRuntimeFeatures::enableWebFontsInterventionV2WithSlow2G( 213 WebRuntimeFeatures::enableWebFontsInterventionV2WithSlow2G(
210 webfonts_intervention_v2_about_flag.compare( 214 webfonts_intervention_v2_about_flag.compare(
211 switches:: 215 switches::
212 kEnableWebFontsInterventionV2SwitchValueEnabledWithSlow2G) == 216 kEnableWebFontsInterventionV2SwitchValueEnabledWithSlow2G) ==
213 0); 217 0);
214 } else { 218 } else {
219 WebRuntimeFeatures::enableWebFontsInterventionV2With3G(base::StartsWith(
220 webfonts_intervention_v2_group_name,
221 switches::kEnableWebFontsInterventionV2SwitchValueEnabledWith3G,
222 base::CompareCase::INSENSITIVE_ASCII));
215 WebRuntimeFeatures::enableWebFontsInterventionV2With2G(base::StartsWith( 223 WebRuntimeFeatures::enableWebFontsInterventionV2With2G(base::StartsWith(
216 webfonts_intervention_v2_group_name, 224 webfonts_intervention_v2_group_name,
217 switches::kEnableWebFontsInterventionV2SwitchValueEnabledWith2G, 225 switches::kEnableWebFontsInterventionV2SwitchValueEnabledWith2G,
218 base::CompareCase::INSENSITIVE_ASCII)); 226 base::CompareCase::INSENSITIVE_ASCII));
219 WebRuntimeFeatures::enableWebFontsInterventionV2WithSlow2G(base::StartsWith( 227 WebRuntimeFeatures::enableWebFontsInterventionV2WithSlow2G(base::StartsWith(
220 webfonts_intervention_v2_group_name, 228 webfonts_intervention_v2_group_name,
221 switches::kEnableWebFontsInterventionV2SwitchValueEnabledWithSlow2G, 229 switches::kEnableWebFontsInterventionV2SwitchValueEnabledWithSlow2G,
222 base::CompareCase::INSENSITIVE_ASCII)); 230 base::CompareCase::INSENSITIVE_ASCII));
223 } 231 }
224 if (command_line.HasSwitch(switches::kEnableWebFontsInterventionTrigger)) 232 if (command_line.HasSwitch(switches::kEnableWebFontsInterventionTrigger))
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { 314 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
307 std::vector<std::string> disabled_features = base::SplitString( 315 std::vector<std::string> disabled_features = base::SplitString(
308 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), 316 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures),
309 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 317 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
310 for (const std::string& feature : disabled_features) 318 for (const std::string& feature : disabled_features)
311 WebRuntimeFeatures::enableFeatureFromString(feature, false); 319 WebRuntimeFeatures::enableFeatureFromString(feature, false);
312 } 320 }
313 } 321 }
314 322
315 } // namespace content 323 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698