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