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_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ |
6 #define CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ | 6 #define CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "content/browser/browser_thread_impl.h" | 9 #include "content/browser/browser_thread_impl.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 | 11 |
| 12 #if defined(OS_WIN) |
| 13 namespace base { |
| 14 namespace win { |
| 15 class ScopedCOMInitializer; |
| 16 } |
| 17 } |
| 18 #endif |
| 19 |
12 namespace content { | 20 namespace content { |
13 class NotificationService; | 21 class NotificationService; |
14 } | 22 } |
15 | 23 |
16 namespace content { | 24 namespace content { |
17 | 25 |
18 // ---------------------------------------------------------------------------- | 26 // ---------------------------------------------------------------------------- |
19 // BrowserProcessSubThread | 27 // BrowserProcessSubThread |
20 // | 28 // |
21 // This simple thread object is used for the specialized threads that the | 29 // This simple thread object is used for the specialized threads that the |
22 // BrowserProcess spins up. | 30 // BrowserProcess spins up. |
23 // | 31 // |
24 // Applications must initialize the COM library before they can call | 32 // Applications must initialize the COM library before they can call |
25 // COM library functions other than CoGetMalloc and memory allocation | 33 // COM library functions other than CoGetMalloc and memory allocation |
26 // functions, so this class initializes COM for those users. | 34 // functions, so this class initializes COM for those users. |
27 class CONTENT_EXPORT BrowserProcessSubThread : public BrowserThreadImpl { | 35 class CONTENT_EXPORT BrowserProcessSubThread : public BrowserThreadImpl { |
28 public: | 36 public: |
29 explicit BrowserProcessSubThread(BrowserThread::ID identifier); | 37 explicit BrowserProcessSubThread(BrowserThread::ID identifier); |
30 virtual ~BrowserProcessSubThread(); | 38 virtual ~BrowserProcessSubThread(); |
31 | 39 |
32 protected: | 40 protected: |
33 virtual void Init() OVERRIDE; | 41 virtual void Init() OVERRIDE; |
34 virtual void CleanUp() OVERRIDE; | 42 virtual void CleanUp() OVERRIDE; |
35 | 43 |
36 private: | 44 private: |
37 // These methods encapsulate cleanup that needs to happen on the IO thread | 45 // These methods encapsulate cleanup that needs to happen on the IO thread |
38 // before we call the embedder's CleanUp function. | 46 // before we call the embedder's CleanUp function. |
39 void IOThreadPreCleanUp(); | 47 void IOThreadPreCleanUp(); |
40 | 48 |
| 49 #if defined (OS_WIN) |
| 50 scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_; |
| 51 #endif |
| 52 |
41 // Each specialized thread has its own notification service. | 53 // Each specialized thread has its own notification service. |
42 scoped_ptr<NotificationService> notification_service_; | 54 scoped_ptr<NotificationService> notification_service_; |
43 | 55 |
44 DISALLOW_COPY_AND_ASSIGN(BrowserProcessSubThread); | 56 DISALLOW_COPY_AND_ASSIGN(BrowserProcessSubThread); |
45 }; | 57 }; |
46 | 58 |
47 } // namespace content | 59 } // namespace content |
48 | 60 |
49 #endif // CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ | 61 #endif // CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ |
OLD | NEW |