OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // This interface is for managing the global services of the application. Each | 5 // This interface is for managing the global services of the application. Each |
6 // service is lazily created when requested the first time. The service getters | 6 // service is lazily created when requested the first time. The service getters |
7 // will return NULL if the service is not available, so callers must check for | 7 // will return NULL if the service is not available, so callers must check for |
8 // this condition. | 8 // this condition. |
9 | 9 |
10 #ifndef CHROME_BROWSER_BROWSER_PROCESS_H_ | 10 #ifndef CHROME_BROWSER_BROWSER_PROCESS_H_ |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 virtual MetricsService* metrics_service() = 0; | 65 virtual MetricsService* metrics_service() = 0; |
66 virtual ProfileManager* profile_manager() = 0; | 66 virtual ProfileManager* profile_manager() = 0; |
67 virtual PrefService* local_state() = 0; | 67 virtual PrefService* local_state() = 0; |
68 virtual DebuggerWrapper* debugger_wrapper() = 0; | 68 virtual DebuggerWrapper* debugger_wrapper() = 0; |
69 virtual DevToolsManager* devtools_manager() = 0; | 69 virtual DevToolsManager* devtools_manager() = 0; |
70 virtual Clipboard* clipboard() = 0; | 70 virtual Clipboard* clipboard() = 0; |
71 | 71 |
72 // Returns the thread that we perform I/O coordination on (network requests, | 72 // Returns the thread that we perform I/O coordination on (network requests, |
73 // communication with renderers, etc. | 73 // communication with renderers, etc. |
74 // NOTE: need to check the return value for NULL. | 74 // NOTE: You should ONLY use this to pass to IPC or other objects which must |
| 75 // need a MessageLoop*. If you just want to post a task, use |
| 76 // ChromeThread::PostTask (or other variants) as they take care of checking |
| 77 // that a thread is still alive, race conditions, lifetime differences etc. |
| 78 // If you still must use this, need to check the return value for NULL. |
75 virtual base::Thread* io_thread() = 0; | 79 virtual base::Thread* io_thread() = 0; |
76 | 80 |
77 // Returns the thread that we perform random file operations on. For code | 81 // Returns the thread that we perform random file operations on. For code |
78 // that wants to do I/O operations (not network requests or even file: URL | 82 // that wants to do I/O operations (not network requests or even file: URL |
79 // requests), this is the thread to use to avoid blocking the UI thread. | 83 // requests), this is the thread to use to avoid blocking the UI thread. |
80 // It might be nicer to have a thread pool for this kind of thing. | 84 // It might be nicer to have a thread pool for this kind of thing. |
81 virtual base::Thread* file_thread() = 0; | 85 virtual base::Thread* file_thread() = 0; |
82 | 86 |
83 // Returns the thread that is used for database operations such as the web | 87 // Returns the thread that is used for database operations such as the web |
84 // database. History has its own thread since it has much higher traffic. | 88 // database. History has its own thread since it has much higher traffic. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 private: | 151 private: |
148 // User-data-dir based profiles. | 152 // User-data-dir based profiles. |
149 std::vector<std::wstring> user_data_dir_profiles_; | 153 std::vector<std::wstring> user_data_dir_profiles_; |
150 | 154 |
151 DISALLOW_COPY_AND_ASSIGN(BrowserProcess); | 155 DISALLOW_COPY_AND_ASSIGN(BrowserProcess); |
152 }; | 156 }; |
153 | 157 |
154 extern BrowserProcess* g_browser_process; | 158 extern BrowserProcess* g_browser_process; |
155 | 159 |
156 #endif // CHROME_BROWSER_BROWSER_PROCESS_H_ | 160 #endif // CHROME_BROWSER_BROWSER_PROCESS_H_ |
OLD | NEW |