Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(670)

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 1859213002: Move the thread hop for UMA user actions from content:: to base::. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved call to SetRecordActionTaskRunner. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Set the thread on which to execute RecordAction.
671 base::SetRecordActionTaskRunner(
672 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI));
673
669 // Initialize FieldTrialList to support FieldTrials that use one-time 674 // Initialize FieldTrialList to support FieldTrials that use one-time
670 // randomization. 675 // randomization.
671 metrics::MetricsService* metrics = browser_process_->metrics_service(); 676 metrics::MetricsService* metrics = browser_process_->metrics_service();
672 // TODO(asvitkine): Turn into a DCHECK after http://crbug.com/359406 is fixed. 677 // TODO(asvitkine): Turn into a DCHECK after http://crbug.com/359406 is fixed.
673 CHECK(!field_trial_list_); 678 CHECK(!field_trial_list_);
674 field_trial_list_.reset( 679 field_trial_list_.reset(
675 new base::FieldTrialList(metrics->CreateEntropyProvider().release())); 680 new base::FieldTrialList(metrics->CreateEntropyProvider().release()));
676 681
677 const base::CommandLine* command_line = 682 const base::CommandLine* command_line =
678 base::CommandLine::ForCurrentProcess(); 683 base::CommandLine::ForCurrentProcess();
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1946 chromeos::CrosSettings::Shutdown(); 1951 chromeos::CrosSettings::Shutdown();
1947 #endif // defined(OS_CHROMEOS) 1952 #endif // defined(OS_CHROMEOS)
1948 #endif // defined(OS_ANDROID) 1953 #endif // defined(OS_ANDROID)
1949 } 1954 }
1950 1955
1951 // Public members: 1956 // Public members:
1952 1957
1953 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1958 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1954 chrome_extra_parts_.push_back(parts); 1959 chrome_extra_parts_.push_back(parts);
1955 } 1960 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698