[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame^] | 5 | #ifndef CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ |
6 | #define CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ | ||||
[email protected] | 32b76ef | 2010-07-26 23:08:24 | [diff] [blame] | 7 | #pragma once |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 8 | |
9 | #include "base/basictypes.h" | ||||
[email protected] | 1625ffd | 2011-03-01 17:51:50 | [diff] [blame] | 10 | #include "content/browser/browser_thread.h" |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 11 | |
12 | class NotificationService; | ||||
13 | |||||
14 | // ---------------------------------------------------------------------------- | ||||
15 | // BrowserProcessSubThread | ||||
16 | // | ||||
17 | // This simple thread object is used for the specialized threads that the | ||||
18 | // BrowserProcess spins up. | ||||
19 | // | ||||
20 | // Applications must initialize the COM library before they can call | ||||
21 | // COM library functions other than CoGetMalloc and memory allocation | ||||
22 | // functions, so this class initializes COM for those users. | ||||
[email protected] | d04e766 | 2010-10-10 22:24:48 | [diff] [blame] | 23 | class BrowserProcessSubThread : public BrowserThread { |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 24 | public: |
[email protected] | d04e766 | 2010-10-10 22:24:48 | [diff] [blame] | 25 | explicit BrowserProcessSubThread(BrowserThread::ID identifier); |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 26 | virtual ~BrowserProcessSubThread(); |
27 | |||||
28 | protected: | ||||
29 | virtual void Init(); | ||||
[email protected] | 569c760 | 2011-03-03 20:40:32 | [diff] [blame] | 30 | virtual void CleanUp(); |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 31 | |
32 | private: | ||||
33 | // Each specialized thread has its own notification service. | ||||
34 | // Note: We don't use scoped_ptr because the destructor runs on the wrong | ||||
35 | // thread. | ||||
36 | NotificationService* notification_service_; | ||||
37 | |||||
38 | DISALLOW_COPY_AND_ASSIGN(BrowserProcessSubThread); | ||||
39 | }; | ||||
40 | |||||
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame^] | 41 | #endif // CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ |