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