summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_process_sub_thread.cc
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-22 17:46:27 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-22 17:46:27 +0000
commit0ac8368b361a5edbcfe4b985131a8eec13304f49 (patch)
treefbc7e4bdb86150f112730932c0d9d97fab16f4e0 /chrome/browser/browser_process_sub_thread.cc
parent290da7ba0368e3cf1dbbe214a5be9f89666954d0 (diff)
downloadchromium_src-0ac8368b361a5edbcfe4b985131a8eec13304f49.zip
chromium_src-0ac8368b361a5edbcfe4b985131a8eec13304f49.tar.gz
chromium_src-0ac8368b361a5edbcfe4b985131a8eec13304f49.tar.bz2
Pull IOThread out of BrowserProcessImpl. Move the dns prefetching initialization into IOThread.
The global host resolver and dns master have changed to be member variables of IOThread. BUG=26156,26159 Review URL: http://codereview.chromium.org/553026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36866 0039d316-1c4b-4281-b951-d872f2087c98
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
+}