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 <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> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/at_exit.h" | 14 #include "base/at_exit.h" |
| 15 #include "base/base_switches.h" | 15 #include "base/base_switches.h" |
| 16 #include "base/bind.h" | 16 #include "base/bind.h" |
| 17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
| 18 #include "base/debug/crash_logging.h" | 18 #include "base/debug/crash_logging.h" |
| 19 #include "base/debug/debugger.h" | 19 #include "base/debug/debugger.h" |
| 20 #include "base/feature_list.h" | 20 #include "base/feature_list.h" |
| 21 #include "base/files/file_path.h" | 21 #include "base/files/file_path.h" |
| 22 #include "base/files/file_util.h" | 22 #include "base/files/file_util.h" |
| 23 #include "base/metrics/field_trial.h" | 23 #include "base/metrics/field_trial.h" |
| 24 #include "base/metrics/histogram_macros.h" | 24 #include "base/metrics/histogram_macros.h" |
| 25 #include "base/metrics/user_metrics.h" | |
| 25 #include "base/path_service.h" | 26 #include "base/path_service.h" |
| 26 #include "base/profiler/scoped_profile.h" | 27 #include "base/profiler/scoped_profile.h" |
| 27 #include "base/profiler/scoped_tracker.h" | 28 #include "base/profiler/scoped_tracker.h" |
| 28 #include "base/run_loop.h" | 29 #include "base/run_loop.h" |
| 29 #include "base/strings/string_number_conversions.h" | 30 #include "base/strings/string_number_conversions.h" |
| 30 #include "base/strings/string_piece.h" | 31 #include "base/strings/string_piece.h" |
| 31 #include "base/strings/string_split.h" | 32 #include "base/strings/string_split.h" |
| 32 #include "base/strings/sys_string_conversions.h" | 33 #include "base/strings/sys_string_conversions.h" |
| 33 #include "base/strings/utf_string_conversions.h" | 34 #include "base/strings/utf_string_conversions.h" |
| 34 #include "base/sys_info.h" | 35 #include "base/sys_info.h" |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 659 chrome_extra_parts_.clear(); | 660 chrome_extra_parts_.clear(); |
| 660 } | 661 } |
| 661 | 662 |
| 662 // This will be called after the command-line has been mutated by about:flags | 663 // This will be called after the command-line has been mutated by about:flags |
| 663 void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() { | 664 void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() { |
| 664 TRACE_EVENT0("startup", "ChromeBrowserMainParts::SetupMetricsAndFieldTrials"); | 665 TRACE_EVENT0("startup", "ChromeBrowserMainParts::SetupMetricsAndFieldTrials"); |
| 665 // Must initialize metrics after labs have been converted into switches, | 666 // Must initialize metrics after labs have been converted into switches, |
| 666 // but before field trials are set up (so that client ID is available for | 667 // but before field trials are set up (so that client ID is available for |
| 667 // one-time randomized field trials). | 668 // one-time randomized field trials). |
| 668 | 669 |
| 670 base::SetRecordActionTaskRunner( | |
| 671 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)); | |
|
piman
2016/04/18 21:13:08
Should this be done in content/ ? There are tests
beaudoin
2016/04/19 16:57:27
asvitkine@ for opinions.
My opinion is that other
Alexei Svitkine (slow)
2016/04/19 17:56:41
Yeah, since this only affects cases where AddActio
| |
| 672 | |
| 669 // Initialize FieldTrialList to support FieldTrials that use one-time | 673 // Initialize FieldTrialList to support FieldTrials that use one-time |
| 670 // randomization. | 674 // randomization. |
| 671 metrics::MetricsService* metrics = browser_process_->metrics_service(); | 675 metrics::MetricsService* metrics = browser_process_->metrics_service(); |
| 672 // TODO(asvitkine): Turn into a DCHECK after http://crbug.com/359406 is fixed. | 676 // TODO(asvitkine): Turn into a DCHECK after http://crbug.com/359406 is fixed. |
| 673 CHECK(!field_trial_list_); | 677 CHECK(!field_trial_list_); |
| 674 // TODO(asvitkine): Remove this after http://crbug.com/359406 is fixed. | 678 // TODO(asvitkine): Remove this after http://crbug.com/359406 is fixed. |
| 675 base::FieldTrialList::EnableGlobalStateChecks(); | 679 base::FieldTrialList::EnableGlobalStateChecks(); |
| 676 field_trial_list_.reset( | 680 field_trial_list_.reset( |
| 677 new base::FieldTrialList(metrics->CreateEntropyProvider().release())); | 681 new base::FieldTrialList(metrics->CreateEntropyProvider().release())); |
| 678 | 682 |
| (...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1948 chromeos::CrosSettings::Shutdown(); | 1952 chromeos::CrosSettings::Shutdown(); |
| 1949 #endif // defined(OS_CHROMEOS) | 1953 #endif // defined(OS_CHROMEOS) |
| 1950 #endif // defined(OS_ANDROID) | 1954 #endif // defined(OS_ANDROID) |
| 1951 } | 1955 } |
| 1952 | 1956 |
| 1953 // Public members: | 1957 // Public members: |
| 1954 | 1958 |
| 1955 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1959 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1956 chrome_extra_parts_.push_back(parts); | 1960 chrome_extra_parts_.push_back(parts); |
| 1957 } | 1961 } |
| OLD | NEW |