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

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

Issue 3073008: BrowserMain() refactoring, part 2.1. (Closed)
Patch Set: build fix Created 10 years, 4 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/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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/field_trial.h" 10 #include "base/field_trial.h"
(...skipping 30 matching lines...) Expand all
41 // 41 //
42 // Parts: 42 // Parts:
43 // - EarlyInitialization: things which should be done as soon as possible on 43 // - EarlyInitialization: things which should be done as soon as possible on
44 // program start (such as setting up signal handlers) and things to be done 44 // program start (such as setting up signal handlers) and things to be done
45 // at some generic time before the start of the main message loop. 45 // at some generic time before the start of the main message loop.
46 // - MainMessageLoopStart: things beginning with the start of the main message 46 // - MainMessageLoopStart: things beginning with the start of the main message
47 // loop and ending with initialization of the main thread; platform-specific 47 // loop and ending with initialization of the main thread; platform-specific
48 // things which should be done immediately before the start of the main 48 // things which should be done immediately before the start of the main
49 // message loop should go in |PreMainMessageLoopStart()|. 49 // message loop should go in |PreMainMessageLoopStart()|.
50 // - (more to come) 50 // - (more to come)
51 //
52 // How to add stuff (to existing parts):
53 // - Figure out when your new code should be executed. What must happen
54 // before/after your code is executed? Are there performance reasons for
55 // running your code at a particular time? Document these things!
56 // - Split out any platform-specific bits. Please avoid #ifdefs it at all
57 // possible. You have two choices for platform-specific code: (1) Execute it
58 // from one of the platform-specific |Pre/Post...()| methods; do this if the
59 // code is unique to a platform type. Or (2) execute it from one of the
60 // "parts" (e.g., |EarlyInitialization()|) and provide platform-specific
61 // implementations of your code (in a virtual method); do this if you need to
62 // provide different implementations across most/all platforms.
63 // - Unless your new code is just one or two lines, put it into a separate
64 // method with a well-defined purpose. (Likewise, if you're adding to an
65 // existing chunk which makes it longer than one or two lines, please move
66 // the code out into a separate method.)
51 class BrowserMainParts { 67 class BrowserMainParts {
52 public: 68 public:
53 // This static method is to be implemented by each platform and should 69 // This static method is to be implemented by each platform and should
54 // instantiate the appropriate subclass. 70 // instantiate the appropriate subclass.
55 static BrowserMainParts* CreateBrowserMainParts( 71 static BrowserMainParts* CreateBrowserMainParts(
56 const MainFunctionParams& parameters); 72 const MainFunctionParams& parameters);
57 73
58 virtual ~BrowserMainParts(); 74 virtual ~BrowserMainParts();
59 75
60 // Parts to be called by |BrowserMain()|. 76 // Parts to be called by |BrowserMain()|.
(...skipping 27 matching lines...) Expand all
88 // A/B test for the maximum number of persistent connections per host. 104 // A/B test for the maximum number of persistent connections per host.
89 void ConnectionFieldTrial(); 105 void ConnectionFieldTrial();
90 106
91 // A/B test for determining a value for unused socket timeout. 107 // A/B test for determining a value for unused socket timeout.
92 void SocketTimeoutFieldTrial(); 108 void SocketTimeoutFieldTrial();
93 109
94 // A/B test for spdy when --use-spdy not set. 110 // A/B test for spdy when --use-spdy not set.
95 void SpdyFieldTrial(); 111 void SpdyFieldTrial();
96 112
97 // Used to initialize NSPR where appropriate. 113 // Used to initialize NSPR where appropriate.
98 void InitializeSSL(); 114 virtual void InitializeSSL() = 0;
99 115
100 // Methods for |MainMessageLoopStart()| -------------------------------------- 116 // Methods for |MainMessageLoopStart()| --------------------------------------
101 117
102 void InitializeMainThread(); 118 void InitializeMainThread();
103 119
104 // Members initialized on construction --------------------------------------- 120 // Members initialized on construction ---------------------------------------
105 121
106 const MainFunctionParams& parameters_; 122 const MainFunctionParams& parameters_;
107 const CommandLine& parsed_command_line_; 123 const CommandLine& parsed_command_line_;
108 124
(...skipping 26 matching lines...) Expand all
135 // sending crash reports. The presence of a Breakpad handler (after 151 // sending crash reports. The presence of a Breakpad handler (after
136 // attempting to initialize crash reporting) and the presence of a debugger 152 // attempting to initialize crash reporting) and the presence of a debugger
137 // are registered with the UMA metrics service. 153 // are registered with the UMA metrics service.
138 void RecordBreakpadStatusUMA(MetricsService* metrics); 154 void RecordBreakpadStatusUMA(MetricsService* metrics);
139 155
140 // Displays a warning message if some minimum level of OS support is not 156 // Displays a warning message if some minimum level of OS support is not
141 // present on the current platform. 157 // present on the current platform.
142 void WarnAboutMinimumSystemRequirements(); 158 void WarnAboutMinimumSystemRequirements();
143 159
144 #endif // CHROME_BROWSER_BROWSER_MAIN_H_ 160 #endif // CHROME_BROWSER_BROWSER_MAIN_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698