summaryrefslogtreecommitdiffstats
path: root/content/browser/browser_process_sub_thread.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-03 17:14:48 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-03 17:14:48 +0000
commit451fd90d924b6fd4e6f208952b525cab2029cd6d (patch)
tree6cf9bec9c237224f6d70de9ea5c1cee7d31cd63f /content/browser/browser_process_sub_thread.cc
parent748d7a09fe3c109b5a829ebabdc97edd347f42e6 (diff)
downloadchromium_src-451fd90d924b6fd4e6f208952b525cab2029cd6d.zip
chromium_src-451fd90d924b6fd4e6f208952b525cab2029cd6d.tar.gz
chromium_src-451fd90d924b6fd4e6f208952b525cab2029cd6d.tar.bz2
Use ScopedCOMInitializer in more places. While this doesn't always simplify code, it does mean we do consistent logging and error-checking at all these sites.
BUG=none TEST=none Review URL: https://codereview.chromium.org/11050009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159908 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browser_process_sub_thread.cc')
-rw-r--r--content/browser/browser_process_sub_thread.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/content/browser/browser_process_sub_thread.cc b/content/browser/browser_process_sub_thread.cc
index 19a9e15..942ecd9 100644
--- a/content/browser/browser_process_sub_thread.cc
+++ b/content/browser/browser_process_sub_thread.cc
@@ -4,10 +4,6 @@
#include "content/browser/browser_process_sub_thread.h"
-#if defined(OS_WIN)
-#include <Objbase.h>
-#endif
-
#include "base/debug/leak_tracker.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
@@ -16,6 +12,10 @@
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request.h"
+#if defined(OS_WIN)
+#include "base/win/scoped_com_initializer.h"
+#endif
+
namespace content {
BrowserProcessSubThread::BrowserProcessSubThread(BrowserThread::ID identifier)
@@ -28,8 +28,7 @@ BrowserProcessSubThread::~BrowserProcessSubThread() {
void BrowserProcessSubThread::Init() {
#if defined(OS_WIN)
- // Initializes the COM library on the current thread.
- CoInitialize(NULL);
+ com_initializer_.reset(new base::win::ScopedCOMInitializer());
#endif
notification_service_.reset(new NotificationServiceImpl());
@@ -54,9 +53,7 @@ void BrowserProcessSubThread::CleanUp() {
notification_service_.reset();
#if defined(OS_WIN)
- // Closes the COM library on the current thread. CoInitialize must
- // be balanced by a corresponding call to CoUninitialize.
- CoUninitialize();
+ com_initializer_.reset();
#endif
}