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_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 #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/gtest_prod_util.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 virtual ~ChromeBrowserMainParts(); | 49 virtual ~ChromeBrowserMainParts(); |
50 | 50 |
51 // Add additional ChromeBrowserMainExtraParts. | 51 // Add additional ChromeBrowserMainExtraParts. |
52 virtual void AddParts(ChromeBrowserMainExtraParts* parts); | 52 virtual void AddParts(ChromeBrowserMainExtraParts* parts); |
53 | 53 |
54 protected: | 54 protected: |
55 explicit ChromeBrowserMainParts( | 55 explicit ChromeBrowserMainParts( |
56 const content::MainFunctionParams& parameters); | 56 const content::MainFunctionParams& parameters); |
57 | 57 |
58 // content::BrowserMainParts overrides. | 58 // content::BrowserMainParts overrides. |
59 // These are called in-order by content::BrowserMainLoop. | |
60 // Each stage calls the same stages in any ChromeBrowserMainExtraParts added | |
61 // with AddParts() from ChromeContentBrowserClient::CreateBrowserMainParts. | |
62 virtual void PreEarlyInitialization() OVERRIDE; | 59 virtual void PreEarlyInitialization() OVERRIDE; |
63 virtual void PostEarlyInitialization() OVERRIDE; | 60 virtual void PostEarlyInitialization() OVERRIDE; |
64 virtual void ToolkitInitialized() OVERRIDE; | 61 virtual void ToolkitInitialized() OVERRIDE; |
65 virtual void PreMainMessageLoopStart() OVERRIDE; | 62 virtual void PreMainMessageLoopStart() OVERRIDE; |
66 virtual void PostMainMessageLoopStart() OVERRIDE; | 63 virtual void PostMainMessageLoopStart() OVERRIDE; |
67 virtual void PreCreateThreads() OVERRIDE; | 64 virtual void PreCreateThreads() OVERRIDE; |
68 virtual void PreStartThread(content::BrowserThread::ID identifier) OVERRIDE; | 65 virtual void PreStartThread(content::BrowserThread::ID identifier) OVERRIDE; |
69 virtual void PostStartThread(content::BrowserThread::ID identifier) OVERRIDE; | 66 virtual void PostStartThread(content::BrowserThread::ID identifier) OVERRIDE; |
70 virtual void PreMainMessageLoopRun() OVERRIDE; | 67 virtual void PreMainMessageLoopRun() OVERRIDE; |
71 virtual bool MainMessageLoopRun(int* result_code) OVERRIDE; | 68 virtual bool MainMessageLoopRun(int* result_code) OVERRIDE; |
72 virtual void PostMainMessageLoopRun() OVERRIDE; | 69 virtual void PostMainMessageLoopRun() OVERRIDE; |
73 virtual void PreStopThread(content::BrowserThread::ID identifier) OVERRIDE; | 70 virtual void PreStopThread(content::BrowserThread::ID identifier) OVERRIDE; |
74 virtual void PostStopThread(content::BrowserThread::ID identifier) OVERRIDE; | 71 virtual void PostStopThread(content::BrowserThread::ID identifier) OVERRIDE; |
75 virtual void PostDestroyThreads() OVERRIDE; | 72 virtual void PostDestroyThreads() OVERRIDE; |
76 | 73 |
77 // Additional stages for ChromeBrowserMainExtraParts. These stages are called | |
78 // in order from PreMainMessageLoopStart(). See implementation for details. | |
79 virtual void PreProfileInit(); | |
80 virtual void PostProfileInit(); | |
81 virtual void PreBrowserStart(); | |
82 virtual void PostBrowserStart(); | |
83 | |
84 // Displays a warning message that we can't find any locale data files. | 74 // Displays a warning message that we can't find any locale data files. |
85 virtual void ShowMissingLocaleMessageBox() = 0; | 75 virtual void ShowMissingLocaleMessageBox() = 0; |
86 | 76 |
87 const content::MainFunctionParams& parameters() const { | 77 const content::MainFunctionParams& parameters() const { |
88 return parameters_; | 78 return parameters_; |
89 } | 79 } |
90 const CommandLine& parsed_command_line() const { | 80 const CommandLine& parsed_command_line() const { |
91 return parsed_command_line_; | 81 return parsed_command_line_; |
92 } | 82 } |
93 | 83 |
94 Profile* profile() { return profile_; } | 84 Profile* profile() { return profile_; } |
95 MetricsService* metrics() { return metrics_; } | |
96 | 85 |
97 private: | 86 private: |
98 // Methods for |EarlyInitialization()| --------------------------------------- | 87 // Methods for |EarlyInitialization()| --------------------------------------- |
99 | 88 |
100 // A/B test for the maximum number of persistent connections per host. | 89 // A/B test for the maximum number of persistent connections per host. |
101 void ConnectionFieldTrial(); | 90 void ConnectionFieldTrial(); |
102 | 91 |
103 // A/B test for determining a value for unused socket timeout. | 92 // A/B test for determining a value for unused socket timeout. |
104 void SocketTimeoutFieldTrial(); | 93 void SocketTimeoutFieldTrial(); |
105 | 94 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // Records the time from our process' startup to the present time in | 209 // Records the time from our process' startup to the present time in |
221 // the UMA histogram |metric_name|. | 210 // the UMA histogram |metric_name|. |
222 void RecordBrowserStartupTime(); | 211 void RecordBrowserStartupTime(); |
223 | 212 |
224 // Records a time value to an UMA histogram in the context of the | 213 // Records a time value to an UMA histogram in the context of the |
225 // PreReadExperiment field-trial. This also reports to the appropriate | 214 // PreReadExperiment field-trial. This also reports to the appropriate |
226 // sub-histogram (_PreRead(Enabled|Disabled)). | 215 // sub-histogram (_PreRead(Enabled|Disabled)). |
227 void RecordPreReadExperimentTime(const char* name, base::TimeDelta time); | 216 void RecordPreReadExperimentTime(const char* name, base::TimeDelta time); |
228 | 217 |
229 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ | 218 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ |
OLD | NEW |