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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2338623004: Add Blink setting to block doc.written scripts on 2g-like networks (Closed)
Patch Set: Update test results after rebase 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
« no previous file with comments | « no previous file | components/test_runner/test_runner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 } 1373 }
1374 1374
1375 void MaybeAppendBlinkSettingsSwitchForFieldTrial( 1375 void MaybeAppendBlinkSettingsSwitchForFieldTrial(
1376 const base::CommandLine& browser_command_line, 1376 const base::CommandLine& browser_command_line,
1377 base::CommandLine* command_line) { 1377 base::CommandLine* command_line) {
1378 // List of field trials that modify the blink-settings command line flag. No 1378 // List of field trials that modify the blink-settings command line flag. No
1379 // two field trials in the list should specify the same keys, otherwise one 1379 // two field trials in the list should specify the same keys, otherwise one
1380 // field trial may overwrite another. See Source/core/frame/Settings.in in 1380 // field trial may overwrite another. See Source/core/frame/Settings.in in
1381 // Blink for the list of valid keys. 1381 // Blink for the list of valid keys.
1382 static const char* const kBlinkSettingsFieldTrials[] = { 1382 static const char* const kBlinkSettingsFieldTrials[] = {
1383 // Keys: backgroundHtmlParserOutstandingTokenLimit 1383 // Keys: backgroundHtmlParserOutstandingTokenLimit
1384 // backgroundHtmlParserPendingTokenLimit 1384 // backgroundHtmlParserPendingTokenLimit
1385 "BackgroundHtmlParserTokenLimits", 1385 "BackgroundHtmlParserTokenLimits",
1386 1386
1387 // Keys: doHtmlPreloadScanning 1387 // Keys: doHtmlPreloadScanning
1388 "HtmlPreloadScanning", 1388 "HtmlPreloadScanning",
1389 1389
1390 // Keys: lowPriorityIframes 1390 // Keys: lowPriorityIframes
1391 "LowPriorityIFrames", 1391 "LowPriorityIFrames",
1392 1392
1393 // Keys: disallowFetchForDocWrittenScriptsInMainFrame 1393 // Keys: disallowFetchForDocWrittenScriptsInMainFrame
1394 "DisallowFetchForDocWrittenScriptsInMainFrame", 1394 // disallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections
1395 // disallowFetchForDocWrittenScriptsInMainFrameIfEffectively2G
1396 "DisallowFetchForDocWrittenScriptsInMainFrame",
1395 1397
1396 // Keys: parseHTMLOnMainThreadSyncTokenize 1398 // Keys: parseHTMLOnMainThreadSyncTokenize
1397 // parseHTMLOnMainThreadCoalesceChunks 1399 // parseHTMLOnMainThreadCoalesceChunks
1398 "ParseHTMLOnMainThread", 1400 "ParseHTMLOnMainThread",
1399 1401
1400 // Keys: cssExternalScannerNoPreload 1402 // Keys: cssExternalScannerNoPreload
1401 // cssExternalScannerPreload 1403 // cssExternalScannerPreload
1402 "CSSExternalScanner", 1404 "CSSExternalScanner",
1403 }; 1405 };
1404 1406
1405 std::vector<std::string> blink_settings; 1407 std::vector<std::string> blink_settings;
1406 for (const char* field_trial_name : kBlinkSettingsFieldTrials) { 1408 for (const char* field_trial_name : kBlinkSettingsFieldTrials) {
1407 // Each blink-settings field trial should include a forcing_flag group, 1409 // Each blink-settings field trial should include a forcing_flag group,
1408 // to make sure that clients that specify the blink-settings flag on the 1410 // to make sure that clients that specify the blink-settings flag on the
1409 // command line are excluded from the experiment groups. To make 1411 // command line are excluded from the experiment groups. To make
1410 // sure we assign clients that specify this flag to the forcing_flag 1412 // sure we assign clients that specify this flag to the forcing_flag
1411 // group, we must call GetVariationParams for each field trial first 1413 // group, we must call GetVariationParams for each field trial first
1412 // (for example, before checking HasSwitch() and returning), since 1414 // (for example, before checking HasSwitch() and returning), since
(...skipping 1766 matching lines...) Expand 10 before | Expand all | Expand 10 after
3179 if (channel <= kMaxDisableEncryptionChannel) { 3181 if (channel <= kMaxDisableEncryptionChannel) {
3180 static const char* const kWebRtcDevSwitchNames[] = { 3182 static const char* const kWebRtcDevSwitchNames[] = {
3181 switches::kDisableWebRtcEncryption, 3183 switches::kDisableWebRtcEncryption,
3182 }; 3184 };
3183 to_command_line->CopySwitchesFrom(from_command_line, 3185 to_command_line->CopySwitchesFrom(from_command_line,
3184 kWebRtcDevSwitchNames, 3186 kWebRtcDevSwitchNames,
3185 arraysize(kWebRtcDevSwitchNames)); 3187 arraysize(kWebRtcDevSwitchNames));
3186 } 3188 }
3187 } 3189 }
3188 #endif // defined(ENABLE_WEBRTC) 3190 #endif // defined(ENABLE_WEBRTC)
OLDNEW
« no previous file with comments | « no previous file | components/test_runner/test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698