blob: c16997bbf3a31f359ea0082325fbcd22f8e1a6c1 [file] [log] [blame]
[email protected]0ac83682010-01-22 17:46:271// Copyright (c) 2010 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.
4
5#ifndef CHROME_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_
6#define CHROME_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_
7
8#include "base/basictypes.h"
9#include "chrome/browser/chrome_thread.h"
10
11class NotificationService;
12
13// ----------------------------------------------------------------------------
14// BrowserProcessSubThread
15//
16// This simple thread object is used for the specialized threads that the
17// BrowserProcess spins up.
18//
19// Applications must initialize the COM library before they can call
20// COM library functions other than CoGetMalloc and memory allocation
21// functions, so this class initializes COM for those users.
22class BrowserProcessSubThread : public ChromeThread {
23 public:
24 explicit BrowserProcessSubThread(ChromeThread::ID identifier);
25 virtual ~BrowserProcessSubThread();
26
27 protected:
28 virtual void Init();
29 virtual void CleanUp();
30
31 private:
32 // Each specialized thread has its own notification service.
33 // Note: We don't use scoped_ptr because the destructor runs on the wrong
34 // thread.
35 NotificationService* notification_service_;
36
37 DISALLOW_COPY_AND_ASSIGN(BrowserProcessSubThread);
38};
39
40#endif // CHROME_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_