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 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 TRACE_EVENT0("startup", "ChromeBrowserMainParts::SetupMetricsAndFieldTrials"); | 663 TRACE_EVENT0("startup", "ChromeBrowserMainParts::SetupMetricsAndFieldTrials"); |
664 // Must initialize metrics after labs have been converted into switches, | 664 // Must initialize metrics after labs have been converted into switches, |
665 // but before field trials are set up (so that client ID is available for | 665 // but before field trials are set up (so that client ID is available for |
666 // one-time randomized field trials). | 666 // one-time randomized field trials). |
667 | 667 |
668 // Initialize FieldTrialList to support FieldTrials that use one-time | 668 // Initialize FieldTrialList to support FieldTrials that use one-time |
669 // randomization. | 669 // randomization. |
670 metrics::MetricsService* metrics = browser_process_->metrics_service(); | 670 metrics::MetricsService* metrics = browser_process_->metrics_service(); |
671 // TODO(asvitkine): Turn into a DCHECK after http://crbug.com/359406 is fixed. | 671 // TODO(asvitkine): Turn into a DCHECK after http://crbug.com/359406 is fixed. |
672 CHECK(!field_trial_list_); | 672 CHECK(!field_trial_list_); |
| 673 // TODO(asvitkine): Remove this after http://crbug.com/359406 is fixed. |
| 674 base::FieldTrialList::EnableGlobalStateChecks(); |
673 field_trial_list_.reset( | 675 field_trial_list_.reset( |
674 new base::FieldTrialList(metrics->CreateEntropyProvider().release())); | 676 new base::FieldTrialList(metrics->CreateEntropyProvider().release())); |
675 | 677 |
676 const base::CommandLine* command_line = | 678 const base::CommandLine* command_line = |
677 base::CommandLine::ForCurrentProcess(); | 679 base::CommandLine::ForCurrentProcess(); |
678 if (command_line->HasSwitch(switches::kEnableBenchmarking) || | 680 if (command_line->HasSwitch(switches::kEnableBenchmarking) || |
679 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)) { | 681 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)) { |
680 base::FieldTrial::EnableBenchmarking(); | 682 base::FieldTrial::EnableBenchmarking(); |
681 } | 683 } |
682 | 684 |
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1943 chromeos::CrosSettings::Shutdown(); | 1945 chromeos::CrosSettings::Shutdown(); |
1944 #endif // defined(OS_CHROMEOS) | 1946 #endif // defined(OS_CHROMEOS) |
1945 #endif // defined(OS_ANDROID) | 1947 #endif // defined(OS_ANDROID) |
1946 } | 1948 } |
1947 | 1949 |
1948 // Public members: | 1950 // Public members: |
1949 | 1951 |
1950 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1952 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1951 chrome_extra_parts_.push_back(parts); | 1953 chrome_extra_parts_.push_back(parts); |
1952 } | 1954 } |
OLD | NEW |