blob: e006388783b3028647b3cfc5887bbb0cf2bbcfd2 [file] [log] [blame]
[email protected]ef2bf422012-05-11 03:27:091// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]0ac83682010-01-22 17:46:272// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]b0f146f2011-09-15 22:14:255#ifndef CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_
6#define CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_
[email protected]0ac83682010-01-22 17:46:277
8#include "base/basictypes.h"
[email protected]c38831a12011-10-28 12:44:499#include "content/browser/browser_thread_impl.h"
[email protected]84c13c032011-09-23 00:12:2210#include "content/common/content_export.h"
[email protected]0ac83682010-01-22 17:46:2711
[email protected]451fd902012-10-03 17:14:4812#if defined(OS_WIN)
13namespace base {
14namespace win {
15class ScopedCOMInitializer;
16}
17}
18#endif
19
[email protected]ad50def52011-10-19 23:17:0720namespace content {
[email protected]0ac83682010-01-22 17:46:2721class NotificationService;
[email protected]ad50def52011-10-19 23:17:0722}
[email protected]0ac83682010-01-22 17:46:2723
[email protected]c38831a12011-10-28 12:44:4924namespace content {
25
[email protected]0ac83682010-01-22 17:46:2726// ----------------------------------------------------------------------------
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]c38831a12011-10-28 12:44:4935class CONTENT_EXPORT BrowserProcessSubThread : public BrowserThreadImpl {
[email protected]0ac83682010-01-22 17:46:2736 public:
[email protected]d04e7662010-10-10 22:24:4837 explicit BrowserProcessSubThread(BrowserThread::ID identifier);
[email protected]0ac83682010-01-22 17:46:2738 virtual ~BrowserProcessSubThread();
39
40 protected:
[email protected]edc64de2011-11-17 20:07:3841 virtual void Init() OVERRIDE;
42 virtual void CleanUp() OVERRIDE;
[email protected]0ac83682010-01-22 17:46:2743
44 private:
[email protected]af669932012-01-17 19:26:5845 // These methods encapsulate cleanup that needs to happen on the IO thread
[email protected]ef2bf422012-05-11 03:27:0946 // before we call the embedder's CleanUp function.
[email protected]af669932012-01-17 19:26:5847 void IOThreadPreCleanUp();
[email protected]af669932012-01-17 19:26:5848
[email protected]451fd902012-10-03 17:14:4849#if defined (OS_WIN)
50 scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_;
51#endif
52
[email protected]0ac83682010-01-22 17:46:2753 // Each specialized thread has its own notification service.
[email protected]435756b2012-10-01 21:19:3654 scoped_ptr<NotificationService> notification_service_;
[email protected]0ac83682010-01-22 17:46:2755
56 DISALLOW_COPY_AND_ASSIGN(BrowserProcessSubThread);
57};
58
[email protected]c38831a12011-10-28 12:44:4959} // namespace content
60
[email protected]b0f146f2011-09-15 22:14:2561#endif // CONTENT_BROWSER_BROWSER_PROCESS_SUB_THREAD_H_