OLD | NEW |
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 CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ |
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 class MojoShellConnection; | 12 class ServiceManagerConnection; |
13 | 13 |
14 // This class contains different "stages" to be executed by |BrowserMain()|, | 14 // This class contains different "stages" to be executed by |BrowserMain()|, |
15 // Each stage is represented by a single BrowserMainParts method, called from | 15 // Each stage is represented by a single BrowserMainParts method, called from |
16 // the corresponding method in |BrowserMainLoop| (e.g., EarlyInitialization()) | 16 // the corresponding method in |BrowserMainLoop| (e.g., EarlyInitialization()) |
17 // which does the following: | 17 // which does the following: |
18 // - calls a method (e.g., "PreEarlyInitialization()") which implements | 18 // - calls a method (e.g., "PreEarlyInitialization()") which implements |
19 // platform / tookit specific code for that stage. | 19 // platform / tookit specific code for that stage. |
20 // - calls various methods for things common to all platforms (for that stage). | 20 // - calls various methods for things common to all platforms (for that stage). |
21 // - calls a method (e.g., "PostEarlyInitialization()") for platform-specific | 21 // - calls a method (e.g., "PostEarlyInitialization()") for platform-specific |
22 // code to be called after the common code. | 22 // code to be called after the common code. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 virtual void ToolkitInitialized() {} | 65 virtual void ToolkitInitialized() {} |
66 | 66 |
67 // Called just before any child threads owned by the content | 67 // Called just before any child threads owned by the content |
68 // framework are created. | 68 // framework are created. |
69 // | 69 // |
70 // The main message loop has been started at this point (but has not | 70 // The main message loop has been started at this point (but has not |
71 // been run), and the toolkit has been initialized. Returns the error code | 71 // been run), and the toolkit has been initialized. Returns the error code |
72 // (or 0 if no error). | 72 // (or 0 if no error). |
73 virtual int PreCreateThreads(); | 73 virtual int PreCreateThreads(); |
74 | 74 |
75 virtual void MojoShellConnectionStarted(MojoShellConnection* connection) {} | 75 virtual void ServiceManagerConnectionStarted( |
| 76 ServiceManagerConnection* connection) {} |
76 | 77 |
77 // This is called just before the main message loop is run. The | 78 // This is called just before the main message loop is run. The |
78 // various browser threads have all been created at this point | 79 // various browser threads have all been created at this point |
79 virtual void PreMainMessageLoopRun() {} | 80 virtual void PreMainMessageLoopRun() {} |
80 | 81 |
81 // Returns true if the message loop was run, false otherwise. | 82 // Returns true if the message loop was run, false otherwise. |
82 // If this returns false, the default implementation will be run. | 83 // If this returns false, the default implementation will be run. |
83 // May set |result_code|, which will be returned by |BrowserMain()|. | 84 // May set |result_code|, which will be returned by |BrowserMain()|. |
84 virtual bool MainMessageLoopRun(int* result_code); | 85 virtual bool MainMessageLoopRun(int* result_code); |
85 | 86 |
86 // This happens after the main message loop has stopped, but before | 87 // This happens after the main message loop has stopped, but before |
87 // threads are stopped. | 88 // threads are stopped. |
88 virtual void PostMainMessageLoopRun() {} | 89 virtual void PostMainMessageLoopRun() {} |
89 | 90 |
90 // Called as the very last part of shutdown, after threads have been | 91 // Called as the very last part of shutdown, after threads have been |
91 // stopped and destroyed. | 92 // stopped and destroyed. |
92 virtual void PostDestroyThreads() {} | 93 virtual void PostDestroyThreads() {} |
93 }; | 94 }; |
94 | 95 |
95 } // namespace content | 96 } // namespace content |
96 | 97 |
97 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ | 98 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ |
OLD | NEW |