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

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

Issue 2342993002: Rearrange SetupMetricsAndFieldTrials to SetupFieldTrials and SetupMetrics (Closed)
Patch Set: CR Feedback Created 4 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ 5 #ifndef CHROME_BROWSER_CHROME_BROWSER_MAIN_H_
6 #define CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ 6 #define CHROME_BROWSER_CHROME_BROWSER_MAIN_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 const base::FilePath& user_data_dir() const { 96 const base::FilePath& user_data_dir() const {
97 return user_data_dir_; 97 return user_data_dir_;
98 } 98 }
99 99
100 Profile* profile() { return profile_; } 100 Profile* profile() { return profile_; }
101 101
102 const PrefService* local_state() const { return local_state_; } 102 const PrefService* local_state() const { return local_state_; }
103 103
104 private: 104 private:
105 // Methods for |SetupMetricsAndFieldTrials()| -------------------------------- 105 // Sets up the field trials and related initialization. Call only after
106 // about:flags have been converted to switches.
107 void SetupFieldTrials();
106 108
107 // Constructs metrics service and does related initialization, including 109 // Constructs the metrics service and initializes metrics recording.
108 // creation of field trials. Call only after labs have been converted to 110 void SetupMetrics();
109 // switches.
110 void SetupMetricsAndFieldTrials();
111 111
112 // Starts recording of metrics. This can only be called after we have a file 112 // Starts recording of metrics. This can only be called after we have a file
113 // thread. 113 // thread.
114 void StartMetricsRecording(); 114 void StartMetricsRecording();
115 115
116 // Record time from process startup to present time in an UMA histogram. 116 // Record time from process startup to present time in an UMA histogram.
117 void RecordBrowserStartupTime(); 117 void RecordBrowserStartupTime();
118 118
119 // Reads origin trial policy data from local state and configures command line 119 // Reads origin trial policy data from local state and configures command line
120 // for child processes. 120 // for child processes.
(...skipping 11 matching lines...) Expand all
132 int result_code_; 132 int result_code_;
133 133
134 // Create StartupTimeBomb object for watching jank during startup. 134 // Create StartupTimeBomb object for watching jank during startup.
135 std::unique_ptr<StartupTimeBomb> startup_watcher_; 135 std::unique_ptr<StartupTimeBomb> startup_watcher_;
136 136
137 // Create ShutdownWatcherHelper object for watching jank during shutdown. 137 // Create ShutdownWatcherHelper object for watching jank during shutdown.
138 // Please keep |shutdown_watcher| as the first object constructed, and hence 138 // Please keep |shutdown_watcher| as the first object constructed, and hence
139 // it is destroyed last. 139 // it is destroyed last.
140 std::unique_ptr<ShutdownWatcherHelper> shutdown_watcher_; 140 std::unique_ptr<ShutdownWatcherHelper> shutdown_watcher_;
141 141
142 // Statistical testing infrastructure for the entire browser. NULL until 142 // Statistical testing infrastructure for the entire browser. nullptr until
143 // SetupMetricsAndFieldTrials is called. 143 // |SetupFieldTrials()| is called.
144 std::unique_ptr<base::FieldTrialList> field_trial_list_; 144 std::unique_ptr<base::FieldTrialList> field_trial_list_;
145 145
146 ChromeBrowserFieldTrials browser_field_trials_; 146 ChromeBrowserFieldTrials browser_field_trials_;
147 147
148 #if !defined(OS_ANDROID) && !defined(OS_IOS) 148 #if !defined(OS_ANDROID) && !defined(OS_IOS)
149 // A monitor for attributing power consumption to origins. 149 // A monitor for attributing power consumption to origins.
150 std::unique_ptr<ProcessPowerCollector> process_power_collector_; 150 std::unique_ptr<ProcessPowerCollector> process_power_collector_;
151 151
152 std::unique_ptr<WebUsbDetector> web_usb_detector_; 152 std::unique_ptr<WebUsbDetector> web_usb_detector_;
153 #endif 153 #endif
(...skipping 29 matching lines...) Expand all
183 ProcessSingleton::PROCESS_NONE; 183 ProcessSingleton::PROCESS_NONE;
184 184
185 // Members needed across shutdown methods. 185 // Members needed across shutdown methods.
186 bool restart_last_session_ = false; 186 bool restart_last_session_ = false;
187 #endif 187 #endif
188 188
189 Profile* profile_; 189 Profile* profile_;
190 bool run_message_loop_; 190 bool run_message_loop_;
191 std::unique_ptr<ThreeDAPIObserver> three_d_observer_; 191 std::unique_ptr<ThreeDAPIObserver> three_d_observer_;
192 192
193 // Initialized in SetupMetricsAndFieldTrials. 193 // Initialized in |SetupFieldTrials()|.
194 scoped_refptr<FieldTrialSynchronizer> field_trial_synchronizer_; 194 scoped_refptr<FieldTrialSynchronizer> field_trial_synchronizer_;
195 195
196 // Members initialized in PreMainMessageLoopRun, needed in 196 // Members initialized in PreMainMessageLoopRun, needed in
197 // PreMainMessageLoopRunThreadsCreated. 197 // PreMainMessageLoopRunThreadsCreated.
198 PrefService* local_state_; 198 PrefService* local_state_;
199 base::FilePath user_data_dir_; 199 base::FilePath user_data_dir_;
200 200
201 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainParts); 201 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainParts);
202 }; 202 };
203 203
204 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ 204 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698