| OLD | NEW |
| 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_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
| 6 | 6 |
| 7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 GoogleSearchCounter::RegisterForNotifications(); | 1395 GoogleSearchCounter::RegisterForNotifications(); |
| 1396 | 1396 |
| 1397 // Disable SDCH filtering if switches::kEnableSdch is 0. | 1397 // Disable SDCH filtering if switches::kEnableSdch is 0. |
| 1398 int sdch_enabled = 1; | 1398 int sdch_enabled = 1; |
| 1399 if (parsed_command_line().HasSwitch(switches::kEnableSdch)) { | 1399 if (parsed_command_line().HasSwitch(switches::kEnableSdch)) { |
| 1400 base::StringToInt(parsed_command_line().GetSwitchValueASCII( | 1400 base::StringToInt(parsed_command_line().GetSwitchValueASCII( |
| 1401 switches::kEnableSdch), &sdch_enabled); | 1401 switches::kEnableSdch), &sdch_enabled); |
| 1402 if (!sdch_enabled) | 1402 if (!sdch_enabled) |
| 1403 net::SdchManager::EnableSdchSupport(false); | 1403 net::SdchManager::EnableSdchSupport(false); |
| 1404 } | 1404 } |
| 1405 if (sdch_enabled) { | |
| 1406 // Perform A/B test to measure global impact of SDCH support. | |
| 1407 // Set up a field trial to see what disabling SDCH does to latency of page | |
| 1408 // layout globally. | |
| 1409 base::FieldTrial::Probability kSDCH_DIVISOR = 1000; | |
| 1410 base::FieldTrial::Probability kSDCH_DISABLE_PROBABILITY = 1; // 0.1% prob. | |
| 1411 // After March 31, 2012 builds, it will always be in default group. | |
| 1412 int sdch_enabled_group = -1; | |
| 1413 scoped_refptr<base::FieldTrial> sdch_trial( | |
| 1414 base::FieldTrialList::FactoryGetFieldTrial( | |
| 1415 "GlobalSdch", kSDCH_DIVISOR, "global_enable_sdch", 2012, 3, 31, | |
| 1416 &sdch_enabled_group)); | |
| 1417 | |
| 1418 sdch_trial->AppendGroup("global_disable_sdch", | |
| 1419 kSDCH_DISABLE_PROBABILITY); | |
| 1420 if (sdch_enabled_group != sdch_trial->group()) | |
| 1421 net::SdchManager::EnableSdchSupport(false); | |
| 1422 } | |
| 1423 | 1405 |
| 1424 if (parsed_command_line().HasSwitch(switches::kEnableWatchdog)) | 1406 if (parsed_command_line().HasSwitch(switches::kEnableWatchdog)) |
| 1425 InstallJankometer(parsed_command_line()); | 1407 InstallJankometer(parsed_command_line()); |
| 1426 | 1408 |
| 1427 #if defined(OS_WIN) && !defined(GOOGLE_CHROME_BUILD) | 1409 #if defined(OS_WIN) && !defined(GOOGLE_CHROME_BUILD) |
| 1428 if (parsed_command_line().HasSwitch(switches::kDebugPrint)) { | 1410 if (parsed_command_line().HasSwitch(switches::kDebugPrint)) { |
| 1429 base::FilePath path = | 1411 base::FilePath path = |
| 1430 parsed_command_line().GetSwitchValuePath(switches::kDebugPrint); | 1412 parsed_command_line().GetSwitchValuePath(switches::kDebugPrint); |
| 1431 printing::PrintedDocument::set_debug_dump_path(path); | 1413 printing::PrintedDocument::set_debug_dump_path(path); |
| 1432 } | 1414 } |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1792 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1774 if (base::win::GetVersion() <= base::win::VERSION_XP) |
| 1793 uma_name += "_XP"; | 1775 uma_name += "_XP"; |
| 1794 | 1776 |
| 1795 uma_name += "_PreRead_"; | 1777 uma_name += "_PreRead_"; |
| 1796 uma_name += pre_read_percentage; | 1778 uma_name += pre_read_percentage; |
| 1797 AddPreReadHistogramTime(uma_name.c_str(), time); | 1779 AddPreReadHistogramTime(uma_name.c_str(), time); |
| 1798 } | 1780 } |
| 1799 #endif | 1781 #endif |
| 1800 #endif | 1782 #endif |
| 1801 } | 1783 } |
| OLD | NEW |