Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: content/browser/browser_process_sub_thread.cc

Issue 8477004: Have content/ create and destroy its own threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix official build, avoid DCHECK in official Linux/ChromeOS builds. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/browser/browser_thread_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/browser/notification_service_impl.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 namespace content { 14 namespace content {
15 15
16 BrowserProcessSubThread::BrowserProcessSubThread(BrowserThread::ID identifier) 16 BrowserProcessSubThread::BrowserProcessSubThread(BrowserThread::ID identifier)
17 : BrowserThreadImpl(identifier) {} 17 : BrowserThreadImpl(identifier) {}
18 18
19 BrowserProcessSubThread::~BrowserProcessSubThread() { 19 BrowserProcessSubThread::~BrowserProcessSubThread() {
20 // We cannot rely on our base class to stop the thread since we want our
21 // CleanUp function to run.
22 Stop(); 20 Stop();
23 } 21 }
24 22
25 void BrowserProcessSubThread::Init() { 23 void BrowserProcessSubThread::Init() {
26 #if defined(OS_WIN) 24 #if defined(OS_WIN)
27 // Initializes the COM library on the current thread. 25 // Initializes the COM library on the current thread.
28 CoInitialize(NULL); 26 CoInitialize(NULL);
29 #endif 27 #endif
30 28
31 notification_service_ = new NotificationServiceImpl; 29 notification_service_ = new NotificationServiceImpl;
30
31 BrowserThreadImpl::Init();
32 } 32 }
33 33
34 void BrowserProcessSubThread::CleanUp() { 34 void BrowserProcessSubThread::CleanUp() {
35 BrowserThreadImpl::CleanUp();
36
35 delete notification_service_; 37 delete notification_service_;
36 notification_service_ = NULL; 38 notification_service_ = NULL;
37 39
38 #if defined(OS_WIN) 40 #if defined(OS_WIN)
39 // Closes the COM library on the current thread. CoInitialize must 41 // Closes the COM library on the current thread. CoInitialize must
40 // be balanced by a corresponding call to CoUninitialize. 42 // be balanced by a corresponding call to CoUninitialize.
41 CoUninitialize(); 43 CoUninitialize();
42 #endif 44 #endif
43 } 45 }
44 46
45 } // namespace content 47 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/browser/browser_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698