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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 // This will be called after the command-line has been mutated by about:flags | 664 // This will be called after the command-line has been mutated by about:flags |
665 void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() { | 665 void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() { |
666 TRACE_EVENT0("startup", "ChromeBrowserMainParts::SetupMetricsAndFieldTrials"); | 666 TRACE_EVENT0("startup", "ChromeBrowserMainParts::SetupMetricsAndFieldTrials"); |
667 // Must initialize metrics after labs have been converted into switches, | 667 // Must initialize metrics after labs have been converted into switches, |
668 // but before field trials are set up (so that client ID is available for | 668 // but before field trials are set up (so that client ID is available for |
669 // one-time randomized field trials). | 669 // one-time randomized field trials). |
670 | 670 |
671 // Initialize FieldTrialList to support FieldTrials that use one-time | 671 // Initialize FieldTrialList to support FieldTrials that use one-time |
672 // randomization. | 672 // randomization. |
673 metrics::MetricsService* metrics = browser_process_->metrics_service(); | 673 metrics::MetricsService* metrics = browser_process_->metrics_service(); |
674 // TODO(asvitkine): Turn into a DCHECK after http://crbug.com/359406 is fixed. | 674 |
675 CHECK(!field_trial_list_); | 675 DCHECK(!field_trial_list_); |
676 // TODO(asvitkine): Remove this after http://crbug.com/359406 is fixed. | |
677 base::FieldTrialList::EnableGlobalStateChecks(); | |
678 field_trial_list_.reset( | 676 field_trial_list_.reset( |
679 new base::FieldTrialList(metrics->CreateEntropyProvider().release())); | 677 new base::FieldTrialList(metrics->CreateEntropyProvider().release())); |
680 | 678 |
681 const base::CommandLine* command_line = | 679 const base::CommandLine* command_line = |
682 base::CommandLine::ForCurrentProcess(); | 680 base::CommandLine::ForCurrentProcess(); |
683 if (command_line->HasSwitch(switches::kEnableBenchmarking) || | 681 if (command_line->HasSwitch(switches::kEnableBenchmarking) || |
684 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)) { | 682 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)) { |
685 base::FieldTrial::EnableBenchmarking(); | 683 base::FieldTrial::EnableBenchmarking(); |
686 } | 684 } |
687 | 685 |
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1995 chromeos::CrosSettings::Shutdown(); | 1993 chromeos::CrosSettings::Shutdown(); |
1996 #endif // defined(OS_CHROMEOS) | 1994 #endif // defined(OS_CHROMEOS) |
1997 #endif // defined(OS_ANDROID) | 1995 #endif // defined(OS_ANDROID) |
1998 } | 1996 } |
1999 | 1997 |
2000 // Public members: | 1998 // Public members: |
2001 | 1999 |
2002 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2000 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
2003 chrome_extra_parts_.push_back(parts); | 2001 chrome_extra_parts_.push_back(parts); |
2004 } | 2002 } |
OLD | NEW |