[email protected] | ef2bf42 | 2012-05-11 03:27:09 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 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] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 7 | |
8 | #include "base/basictypes.h" | ||||
[email protected] | c38831a1 | 2011-10-28 12:44:49 | [diff] [blame] | 9 | #include "content/browser/browser_thread_impl.h" |
[email protected] | 84c13c03 | 2011-09-23 00:12:22 | [diff] [blame] | 10 | #include "content/common/content_export.h" |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 11 | |
[email protected] | 451fd90 | 2012-10-03 17:14:48 | [diff] [blame^] | 12 | #if defined(OS_WIN) |
13 | namespace base { | ||||
14 | namespace win { | ||||
15 | class ScopedCOMInitializer; | ||||
16 | } | ||||
17 | } | ||||
18 | #endif | ||||
19 | |||||
[email protected] | ad50def5 | 2011-10-19 23:17:07 | [diff] [blame] | 20 | namespace content { |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 21 | class NotificationService; |
[email protected] | ad50def5 | 2011-10-19 23:17:07 | [diff] [blame] | 22 | } |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 23 | |
[email protected] | c38831a1 | 2011-10-28 12:44:49 | [diff] [blame] | 24 | namespace content { |
25 | |||||
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 26 | // ---------------------------------------------------------------------------- |
27 | // BrowserProcessSubThread | ||||
28 | // | ||||
29 | // This simple thread object is used for the specialized threads that the | ||||
30 | // BrowserProcess spins up. | ||||
31 | // | ||||
32 | // Applications must initialize the COM library before they can call | ||||
33 | // COM library functions other than CoGetMalloc and memory allocation | ||||
34 | // functions, so this class initializes COM for those users. | ||||
[email protected] | c38831a1 | 2011-10-28 12:44:49 | [diff] [blame] | 35 | class CONTENT_EXPORT BrowserProcessSubThread : public BrowserThreadImpl { |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 36 | public: |
[email protected] | d04e766 | 2010-10-10 22:24:48 | [diff] [blame] | 37 | explicit BrowserProcessSubThread(BrowserThread::ID identifier); |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 38 | virtual ~BrowserProcessSubThread(); |
39 | |||||
40 | protected: | ||||
[email protected] | edc64de | 2011-11-17 20:07:38 | [diff] [blame] | 41 | virtual void Init() OVERRIDE; |
42 | virtual void CleanUp() OVERRIDE; | ||||
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 43 | |
44 | private: | ||||
[email protected] | af66993 | 2012-01-17 19:26:58 | [diff] [blame] | 45 | // These methods encapsulate cleanup that needs to happen on the IO thread |
[email protected] | ef2bf42 | 2012-05-11 03:27:09 | [diff] [blame] | 46 | // before we call the embedder's CleanUp function. |
[email protected] | af66993 | 2012-01-17 19:26:58 | [diff] [blame] | 47 | void IOThreadPreCleanUp(); |
[email protected] | af66993 | 2012-01-17 19:26:58 | [diff] [blame] | 48 | |
[email protected] | 451fd90 | 2012-10-03 17:14:48 | [diff] [blame^] | 49 | #if defined (OS_WIN) |
50 | scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_; | ||||
51 | #endif | ||||
52 | |||||
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 53 | // Each specialized thread has its own notification service. |
[email protected] | 435756b | 2012-10-01 21:19:36 | [diff] [blame] | 54 | scoped_ptr<NotificationService> notification_service_; |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 55 | |
56 | DISALLOW_COPY_AND_ASSIGN(BrowserProcessSubThread); | ||||
57 | }; | ||||
58 | |||||
[email protected] | c38831a1 | 2011-10-28 12:44:49 | [diff] [blame] | 59 | } // namespace content |
60 | |||||
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 61 | #endif // CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ |