OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ |
6 #define CHROME_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ | 6 #define CHROME_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
11 | 11 |
12 class NotificationService; | 12 class NotificationService; |
13 | 13 |
14 // ---------------------------------------------------------------------------- | 14 // ---------------------------------------------------------------------------- |
15 // BrowserProcessSubThread | 15 // BrowserProcessSubThread |
16 // | 16 // |
17 // This simple thread object is used for the specialized threads that the | 17 // This simple thread object is used for the specialized threads that the |
18 // BrowserProcess spins up. | 18 // BrowserProcess spins up. |
19 // | 19 // |
20 // Applications must initialize the COM library before they can call | 20 // Applications must initialize the COM library before they can call |
21 // COM library functions other than CoGetMalloc and memory allocation | 21 // COM library functions other than CoGetMalloc and memory allocation |
22 // functions, so this class initializes COM for those users. | 22 // functions, so this class initializes COM for those users. |
23 class BrowserProcessSubThread : public BrowserThread { | 23 class BrowserProcessSubThread : public BrowserThread { |
24 public: | 24 public: |
25 explicit BrowserProcessSubThread(BrowserThread::ID identifier); | 25 explicit BrowserProcessSubThread(BrowserThread::ID identifier); |
26 virtual ~BrowserProcessSubThread(); | 26 virtual ~BrowserProcessSubThread(); |
27 | 27 |
28 protected: | 28 protected: |
29 virtual void Init(); | 29 virtual void Init(); |
30 virtual void CleanUpAfterMessageLoopDestruction(); | 30 virtual void CleanUp(); |
31 | 31 |
32 private: | 32 private: |
33 // Each specialized thread has its own notification service. | 33 // Each specialized thread has its own notification service. |
34 // Note: We don't use scoped_ptr because the destructor runs on the wrong | 34 // Note: We don't use scoped_ptr because the destructor runs on the wrong |
35 // thread. | 35 // thread. |
36 NotificationService* notification_service_; | 36 NotificationService* notification_service_; |
37 | 37 |
38 DISALLOW_COPY_AND_ASSIGN(BrowserProcessSubThread); | 38 DISALLOW_COPY_AND_ASSIGN(BrowserProcessSubThread); |
39 }; | 39 }; |
40 | 40 |
41 #endif // CHROME_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ | 41 #endif // CHROME_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ |
OLD | NEW |