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 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Allows an embedder to do any extra toolkit initialization. | 65 // Allows an embedder to do any extra toolkit initialization. |
66 virtual void ToolkitInitialized() = 0; | 66 virtual void ToolkitInitialized() = 0; |
67 | 67 |
68 // Called just before any child threads owned by the content | 68 // Called just before any child threads owned by the content |
69 // framework are created. | 69 // framework are created. |
70 // | 70 // |
71 // The main message loop has been started at this point (but has not | 71 // The main message loop has been started at this point (but has not |
72 // been run), and the toolkit has been initialized. | 72 // been run), and the toolkit has been initialized. |
73 virtual void PreCreateThreads() = 0; | 73 virtual void PreCreateThreads() = 0; |
74 | 74 |
75 // Called once for each thread owned by the content framework just | |
76 // before and just after the thread object is created and started. | |
77 // This happens in the order of the threads' appearence in the | |
78 // BrowserThread::ID enumeration. Note that there will be no such | |
79 // call for BrowserThread::UI, since it is the main thread of the | |
80 // application. | |
81 virtual void PreStartThread(BrowserThread::ID identifier) = 0; | |
82 virtual void PostStartThread(BrowserThread::ID identifier) = 0; | |
83 | |
84 // This is called just before the main message loop is run. The | 75 // This is called just before the main message loop is run. The |
85 // various browser threads have all been created at this point | 76 // various browser threads have all been created at this point |
86 virtual void PreMainMessageLoopRun() = 0; | 77 virtual void PreMainMessageLoopRun() = 0; |
87 | 78 |
88 // Returns true if the message loop was run, false otherwise. | 79 // Returns true if the message loop was run, false otherwise. |
89 // If this returns false, the default implementation will be run. | 80 // If this returns false, the default implementation will be run. |
90 // May set |result_code|, which will be returned by |BrowserMain()|. | 81 // May set |result_code|, which will be returned by |BrowserMain()|. |
91 virtual bool MainMessageLoopRun(int* result_code) = 0; | 82 virtual bool MainMessageLoopRun(int* result_code) = 0; |
92 | 83 |
93 // This happens after the main message loop has stopped, but before | 84 // This happens after the main message loop has stopped, but before |
94 // threads are stopped. | 85 // threads are stopped. |
95 virtual void PostMainMessageLoopRun() = 0; | 86 virtual void PostMainMessageLoopRun() = 0; |
96 | 87 |
97 // Called once for each thread owned by the content framework just | |
98 // before and just after it is torn down. This is in reverse order | |
99 // of the threads' appearance in the BrowserThread::ID enumeration. | |
100 // Note that you will not receive such a call for BrowserThread::UI, | |
101 // since it is the main thread of the application. | |
102 virtual void PreStopThread(BrowserThread::ID identifier) = 0; | |
103 virtual void PostStopThread(BrowserThread::ID identifier) = 0; | |
104 | |
105 // Called as the very last part of shutdown, after threads have been | 88 // Called as the very last part of shutdown, after threads have been |
106 // stopped and destroyed. | 89 // stopped and destroyed. |
107 virtual void PostDestroyThreads() = 0; | 90 virtual void PostDestroyThreads() = 0; |
108 | 91 |
109 private: | 92 private: |
110 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); | 93 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); |
111 }; | 94 }; |
112 | 95 |
113 } // namespace content | 96 } // namespace content |
114 | 97 |
115 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ | 98 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ |
OLD | NEW |