OLD | NEW |
1 // Copyright (c) 2011 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 #include "content/browser/browser_process_sub_thread.h" | 5 #include "content/browser/browser_process_sub_thread.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "content/common/notification_service.h" | 8 #include "content/browser/notification_service_impl.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
11 #include <Objbase.h> | 11 #include <Objbase.h> |
12 #endif | 12 #endif |
13 | 13 |
14 BrowserProcessSubThread::BrowserProcessSubThread(BrowserThread::ID identifier) | 14 BrowserProcessSubThread::BrowserProcessSubThread(BrowserThread::ID identifier) |
15 : BrowserThread(identifier) {} | 15 : BrowserThread(identifier) {} |
16 | 16 |
17 BrowserProcessSubThread::~BrowserProcessSubThread() { | 17 BrowserProcessSubThread::~BrowserProcessSubThread() { |
18 // We cannot rely on our base class to stop the thread since we want our | 18 // We cannot rely on our base class to stop the thread since we want our |
19 // CleanUp function to run. | 19 // CleanUp function to run. |
20 Stop(); | 20 Stop(); |
21 } | 21 } |
22 | 22 |
23 void BrowserProcessSubThread::Init() { | 23 void BrowserProcessSubThread::Init() { |
24 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
25 // Initializes the COM library on the current thread. | 25 // Initializes the COM library on the current thread. |
26 CoInitialize(NULL); | 26 CoInitialize(NULL); |
27 #endif | 27 #endif |
28 | 28 |
29 notification_service_ = new NotificationService; | 29 notification_service_ = new NotificationServiceImpl; |
30 } | 30 } |
31 | 31 |
32 void BrowserProcessSubThread::CleanUp() { | 32 void BrowserProcessSubThread::CleanUp() { |
33 delete notification_service_; | 33 delete notification_service_; |
34 notification_service_ = NULL; | 34 notification_service_ = NULL; |
35 | 35 |
36 #if defined(OS_WIN) | 36 #if defined(OS_WIN) |
37 // Closes the COM library on the current thread. CoInitialize must | 37 // Closes the COM library on the current thread. CoInitialize must |
38 // be balanced by a corresponding call to CoUninitialize. | 38 // be balanced by a corresponding call to CoUninitialize. |
39 CoUninitialize(); | 39 CoUninitialize(); |
40 #endif | 40 #endif |
41 } | 41 } |
OLD | NEW |