Chromium Code Reviews| 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 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 #include "base/strings/string_number_conversions.h" | 30 #include "base/strings/string_number_conversions.h" |
| 31 #include "base/strings/string_piece.h" | 31 #include "base/strings/string_piece.h" |
| 32 #include "base/strings/string_split.h" | 32 #include "base/strings/string_split.h" |
| 33 #include "base/strings/sys_string_conversions.h" | 33 #include "base/strings/sys_string_conversions.h" |
| 34 #include "base/strings/utf_string_conversions.h" | 34 #include "base/strings/utf_string_conversions.h" |
| 35 #include "base/sys_info.h" | 35 #include "base/sys_info.h" |
| 36 #include "base/threading/platform_thread.h" | 36 #include "base/threading/platform_thread.h" |
| 37 #include "base/time/time.h" | 37 #include "base/time/time.h" |
| 38 #include "base/values.h" | 38 #include "base/values.h" |
| 39 #include "build/build_config.h" | 39 #include "build/build_config.h" |
| 40 #include "cc/base/switches.h" | |
| 40 #include "chrome/browser/about_flags.h" | 41 #include "chrome/browser/about_flags.h" |
| 41 #include "chrome/browser/browser_process.h" | 42 #include "chrome/browser/browser_process.h" |
| 42 #include "chrome/browser/browser_process_impl.h" | 43 #include "chrome/browser/browser_process_impl.h" |
| 43 #include "chrome/browser/browser_process_platform_part.h" | 44 #include "chrome/browser/browser_process_platform_part.h" |
| 44 #include "chrome/browser/browser_shutdown.h" | 45 #include "chrome/browser/browser_shutdown.h" |
| 45 #include "chrome/browser/chrome_browser_main_extra_parts.h" | 46 #include "chrome/browser/chrome_browser_main_extra_parts.h" |
| 46 #include "chrome/browser/component_updater/cld_component_installer.h" | 47 #include "chrome/browser/component_updater/cld_component_installer.h" |
| 47 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" | 48 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" |
| 48 #include "chrome/browser/component_updater/flash_component_installer.h" | 49 #include "chrome/browser/component_updater/flash_component_installer.h" |
| 49 #include "chrome/browser/component_updater/recovery_component_installer.h" | 50 #include "chrome/browser/component_updater/recovery_component_installer.h" |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 594 // but before field trials are set up (so that client ID is available for | 595 // but before field trials are set up (so that client ID is available for |
| 595 // one-time randomized field trials). | 596 // one-time randomized field trials). |
| 596 | 597 |
| 597 // Initialize FieldTrialList to support FieldTrials that use one-time | 598 // Initialize FieldTrialList to support FieldTrials that use one-time |
| 598 // randomization. | 599 // randomization. |
| 599 metrics::MetricsService* metrics = browser_process_->metrics_service(); | 600 metrics::MetricsService* metrics = browser_process_->metrics_service(); |
| 600 field_trial_list_.reset( | 601 field_trial_list_.reset( |
| 601 new base::FieldTrialList(metrics->CreateEntropyProvider().release())); | 602 new base::FieldTrialList(metrics->CreateEntropyProvider().release())); |
| 602 | 603 |
| 603 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 604 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 604 if (command_line->HasSwitch(switches::kEnableBenchmarking)) | 605 if (command_line->HasSwitch(switches::kEnableBenchmarking) || |
| 606 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)) | |
|
Alexei Svitkine (slow)
2014/11/20 18:21:56
Nit: {}'s
oystein (OOO til 10th of July)
2014/11/20 22:55:45
Done.
| |
| 605 base::FieldTrial::EnableBenchmarking(); | 607 base::FieldTrial::EnableBenchmarking(); |
| 606 | 608 |
| 607 // Ensure any field trials specified on the command line are initialized. | 609 // Ensure any field trials specified on the command line are initialized. |
| 608 if (command_line->HasSwitch(switches::kForceFieldTrials)) { | 610 if (command_line->HasSwitch(switches::kForceFieldTrials)) { |
| 609 std::set<std::string> unforceable_field_trials; | 611 std::set<std::string> unforceable_field_trials; |
| 610 #if defined(OFFICIAL_BUILD) | 612 #if defined(OFFICIAL_BUILD) |
| 611 unforceable_field_trials.insert("SettingsEnforcement"); | 613 unforceable_field_trials.insert("SettingsEnforcement"); |
| 612 #endif // defined(OFFICIAL_BUILD) | 614 #endif // defined(OFFICIAL_BUILD) |
| 613 | 615 |
| 614 // Create field trials without activating them, so that this behaves in a | 616 // Create field trials without activating them, so that this behaves in a |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1716 chromeos::CrosSettings::Shutdown(); | 1718 chromeos::CrosSettings::Shutdown(); |
| 1717 #endif | 1719 #endif |
| 1718 #endif | 1720 #endif |
| 1719 } | 1721 } |
| 1720 | 1722 |
| 1721 // Public members: | 1723 // Public members: |
| 1722 | 1724 |
| 1723 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1725 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1724 chrome_extra_parts_.push_back(parts); | 1726 chrome_extra_parts_.push_back(parts); |
| 1725 } | 1727 } |
| OLD | NEW |