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