Supervised user import: Listen for profile creation/deletion
[chromium-blink-merge.git] / content / browser / browser_process_sub_thread.h
blob5899fa319065abbcc87f83753c8dd45a0c980f03
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_
6 #define CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_
8 #include "base/basictypes.h"
9 #include "content/browser/browser_thread_impl.h"
10 #include "content/common/content_export.h"
12 #if defined(OS_WIN)
13 namespace base {
14 namespace win {
15 class ScopedCOMInitializer;
18 #endif
20 namespace content {
21 class NotificationService;
24 namespace content {
26 // ----------------------------------------------------------------------------
27 // BrowserProcessSubThread
29 // This simple thread object is used for the specialized threads that the
30 // BrowserProcess spins up.
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.
35 class CONTENT_EXPORT BrowserProcessSubThread : public BrowserThreadImpl {
36 public:
37 explicit BrowserProcessSubThread(BrowserThread::ID identifier);
38 ~BrowserProcessSubThread() override;
40 protected:
41 void Init() override;
42 void CleanUp() override;
44 private:
45 // These methods encapsulate cleanup that needs to happen on the IO thread
46 // before we call the embedder's CleanUp function.
47 void IOThreadPreCleanUp();
49 #if defined (OS_WIN)
50 scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_;
51 #endif
53 // Each specialized thread has its own notification service.
54 scoped_ptr<NotificationService> notification_service_;
56 DISALLOW_COPY_AND_ASSIGN(BrowserProcessSubThread);
59 } // namespace content
61 #endif // CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_