| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_MAIN_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_MAIN_H_ |
| 6 #define CHROME_BROWSER_BROWSER_MAIN_H_ | 6 #define CHROME_BROWSER_BROWSER_MAIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/gtest_prod_util.h" | |
| 11 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
| 13 #include "base/tracked_objects.h" | 12 #include "base/tracked_objects.h" |
| 14 | 13 |
| 15 class BrowserThread; | 14 class BrowserThread; |
| 16 class CommandLine; | 15 class CommandLine; |
| 17 class FieldTrialSynchronizer; | 16 class FieldTrialSynchronizer; |
| 18 class HighResolutionTimerManager; | 17 class HighResolutionTimerManager; |
| 19 struct MainFunctionParams; | 18 struct MainFunctionParams; |
| 20 class MessageLoop; | 19 class MessageLoop; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // A/B test for the maximum number of connections per proxy server. | 122 // A/B test for the maximum number of connections per proxy server. |
| 124 void ProxyConnectionsFieldTrial(); | 123 void ProxyConnectionsFieldTrial(); |
| 125 | 124 |
| 126 // A/B test for spdy when --use-spdy not set. | 125 // A/B test for spdy when --use-spdy not set. |
| 127 void SpdyFieldTrial(); | 126 void SpdyFieldTrial(); |
| 128 | 127 |
| 129 // A/B test for automatically establishing a backup TCP connection when a | 128 // A/B test for automatically establishing a backup TCP connection when a |
| 130 // specified timeout value is reached. | 129 // specified timeout value is reached. |
| 131 void ConnectBackupJobsFieldTrial(); | 130 void ConnectBackupJobsFieldTrial(); |
| 132 | 131 |
| 133 // A/B test for warmest socket vs. most recently used socket. | |
| 134 void WarmConnectionFieldTrial(); | |
| 135 | |
| 136 // Used to initialize NSPR where appropriate. | 132 // Used to initialize NSPR where appropriate. |
| 137 virtual void InitializeSSL() = 0; | 133 virtual void InitializeSSL() = 0; |
| 138 | 134 |
| 139 // Methods for |MainMessageLoopStart()| -------------------------------------- | 135 // Methods for |MainMessageLoopStart()| -------------------------------------- |
| 140 | 136 |
| 141 void InitializeMainThread(); | 137 void InitializeMainThread(); |
| 142 | 138 |
| 143 // Methods for |SetupMetricsAndFieldTrials()| -------------------------------- | 139 // Methods for |SetupMetricsAndFieldTrials()| -------------------------------- |
| 144 | 140 |
| 145 static MetricsService* InitializeMetrics( | 141 static MetricsService* InitializeMetrics( |
| (...skipping 22 matching lines...) Expand all Loading... |
| 168 // Members initialized in |MainMessageLoopStart()| --------------------------- | 164 // Members initialized in |MainMessageLoopStart()| --------------------------- |
| 169 scoped_ptr<MessageLoop> main_message_loop_; | 165 scoped_ptr<MessageLoop> main_message_loop_; |
| 170 scoped_ptr<base::SystemMonitor> system_monitor_; | 166 scoped_ptr<base::SystemMonitor> system_monitor_; |
| 171 scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; | 167 scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; |
| 172 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 168 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
| 173 scoped_ptr<BrowserThread> main_thread_; | 169 scoped_ptr<BrowserThread> main_thread_; |
| 174 | 170 |
| 175 // Initialized in SetupMetricsAndFieldTrials. | 171 // Initialized in SetupMetricsAndFieldTrials. |
| 176 scoped_refptr<FieldTrialSynchronizer> field_trial_synchronizer_; | 172 scoped_refptr<FieldTrialSynchronizer> field_trial_synchronizer_; |
| 177 | 173 |
| 178 FRIEND_TEST(BrowserMainTest, WarmConnectionFieldTrial_WarmestSocket); | |
| 179 FRIEND_TEST(BrowserMainTest, WarmConnectionFieldTrial_Random); | |
| 180 FRIEND_TEST(BrowserMainTest, WarmConnectionFieldTrial_Invalid); | |
| 181 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); | 174 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); |
| 182 }; | 175 }; |
| 183 | 176 |
| 184 | 177 |
| 185 // Perform platform-specific work that needs to be done after the main event | 178 // Perform platform-specific work that needs to be done after the main event |
| 186 // loop has ended. | 179 // loop has ended. |
| 187 void DidEndMainMessageLoop(); | 180 void DidEndMainMessageLoop(); |
| 188 | 181 |
| 189 // Records the conditions that can prevent Breakpad from generating and | 182 // Records the conditions that can prevent Breakpad from generating and |
| 190 // sending crash reports. The presence of a Breakpad handler (after | 183 // sending crash reports. The presence of a Breakpad handler (after |
| 191 // attempting to initialize crash reporting) and the presence of a debugger | 184 // attempting to initialize crash reporting) and the presence of a debugger |
| 192 // are registered with the UMA metrics service. | 185 // are registered with the UMA metrics service. |
| 193 void RecordBreakpadStatusUMA(MetricsService* metrics); | 186 void RecordBreakpadStatusUMA(MetricsService* metrics); |
| 194 | 187 |
| 195 // Displays a warning message if some minimum level of OS support is not | 188 // Displays a warning message if some minimum level of OS support is not |
| 196 // present on the current platform. | 189 // present on the current platform. |
| 197 void WarnAboutMinimumSystemRequirements(); | 190 void WarnAboutMinimumSystemRequirements(); |
| 198 | 191 |
| 199 // Records the time from our process' startup to the present time in | 192 // Records the time from our process' startup to the present time in |
| 200 // the UMA histogram |metric_name|. | 193 // the UMA histogram |metric_name|. |
| 201 void RecordBrowserStartupTime(); | 194 void RecordBrowserStartupTime(); |
| 202 | 195 |
| 203 #endif // CHROME_BROWSER_BROWSER_MAIN_H_ | 196 #endif // CHROME_BROWSER_BROWSER_MAIN_H_ |
| OLD | NEW |