summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_process_sub_thread.cc
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-07-29 17:14:53 +0100
committerBen Murdoch <benm@google.com>2010-08-04 14:29:45 +0100
commitc407dc5cd9bdc5668497f21b26b09d988ab439de (patch)
tree7eaf8707c0309516bdb042ad976feedaf72b0bb1 /chrome/browser/browser_process_sub_thread.cc
parent0998b1cdac5733f299c12d88bc31ef9c8035b8fa (diff)
downloadexternal_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.zip
external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.gz
external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.bz2
Merge Chromium src@r53293
Change-Id: Ia79acf8670f385cee48c45b0a75371d8e950af34
Diffstat (limited to 'chrome/browser/browser_process_sub_thread.cc')
-rw-r--r--chrome/browser/browser_process_sub_thread.cc40
1 files changed, 40 insertions, 0 deletions
diff --git a/chrome/browser/browser_process_sub_thread.cc b/chrome/browser/browser_process_sub_thread.cc
new file mode 100644
index 0000000..2e99d90
--- /dev/null
+++ b/chrome/browser/browser_process_sub_thread.cc
@@ -0,0 +1,40 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/browser_process_sub_thread.h"
+#include "build/build_config.h"
+#include "chrome/common/notification_service.h"
+
+#if defined(OS_WIN)
+#include <Objbase.h>
+#endif
+
+BrowserProcessSubThread::BrowserProcessSubThread(ChromeThread::ID identifier)
+ : ChromeThread(identifier) {}
+
+BrowserProcessSubThread::~BrowserProcessSubThread() {
+ // We cannot rely on our base class to stop the thread since we want our
+ // CleanUp function to run.
+ Stop();
+}
+
+void BrowserProcessSubThread::Init() {
+#if defined(OS_WIN)
+ // Initializes the COM library on the current thread.
+ CoInitialize(NULL);
+#endif
+
+ notification_service_ = new NotificationService;
+}
+
+void BrowserProcessSubThread::CleanUp() {
+ delete notification_service_;
+ notification_service_ = NULL;
+
+#if defined(OS_WIN)
+ // Closes the COM library on the current thread. CoInitialize must
+ // be balanced by a corresponding call to CoUninitialize.
+ CoUninitialize();
+#endif
+}