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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // | 31 // |
32 // This simple thread object is used for the specialized threads that the | 32 // This simple thread object is used for the specialized threads that the |
33 // BrowserProcess spins up. | 33 // BrowserProcess spins up. |
34 // | 34 // |
35 // Applications must initialize the COM library before they can call | 35 // Applications must initialize the COM library before they can call |
36 // COM library functions other than CoGetMalloc and memory allocation | 36 // COM library functions other than CoGetMalloc and memory allocation |
37 // functions, so this class initializes COM for those users. | 37 // functions, so this class initializes COM for those users. |
38 class CONTENT_EXPORT BrowserProcessSubThread : public BrowserThreadImpl { | 38 class CONTENT_EXPORT BrowserProcessSubThread : public BrowserThreadImpl { |
39 public: | 39 public: |
40 explicit BrowserProcessSubThread(BrowserThread::ID identifier); | 40 explicit BrowserProcessSubThread(BrowserThread::ID identifier); |
| 41 BrowserProcessSubThread(BrowserThread::ID identifier, |
| 42 base::MessageLoop* message_loop); |
41 ~BrowserProcessSubThread() override; | 43 ~BrowserProcessSubThread() override; |
42 | 44 |
43 protected: | 45 protected: |
44 void Init() override; | 46 void Init() override; |
45 void CleanUp() override; | 47 void CleanUp() override; |
46 | 48 |
47 private: | 49 private: |
48 // These methods encapsulate cleanup that needs to happen on the IO thread | 50 // These methods encapsulate cleanup that needs to happen on the IO thread |
49 // before we call the embedder's CleanUp function. | 51 // before we call the embedder's CleanUp function. |
50 void IOThreadPreCleanUp(); | 52 void IOThreadPreCleanUp(); |
51 | 53 |
52 #if defined (OS_WIN) | 54 #if defined (OS_WIN) |
53 std::unique_ptr<base::win::ScopedCOMInitializer> com_initializer_; | 55 std::unique_ptr<base::win::ScopedCOMInitializer> com_initializer_; |
54 #endif | 56 #endif |
55 | 57 |
56 // Each specialized thread has its own notification service. | 58 // Each specialized thread has its own notification service. |
57 std::unique_ptr<NotificationService> notification_service_; | 59 std::unique_ptr<NotificationService> notification_service_; |
58 | 60 |
59 DISALLOW_COPY_AND_ASSIGN(BrowserProcessSubThread); | 61 DISALLOW_COPY_AND_ASSIGN(BrowserProcessSubThread); |
60 }; | 62 }; |
61 | 63 |
62 } // namespace content | 64 } // namespace content |
63 | 65 |
64 #endif // CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ | 66 #endif // CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_ |
OLD | NEW |