Index: content/browser/browser_process_sub_thread.cc |
=================================================================== |
--- content/browser/browser_process_sub_thread.cc (revision 159813) |
+++ content/browser/browser_process_sub_thread.cc (working copy) |
@@ -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 @@ |
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 @@ |
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 |
} |