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

Unified Diff: ui/base/dialogs/base_shell_dialog_win.cc

Issue 11050009: Use ScopedCOMInitializer in more places. While this doesn't always simplify code, it does mean we … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/dialogs/base_shell_dialog_win.cc
===================================================================
--- ui/base/dialogs/base_shell_dialog_win.cc (revision 159813)
+++ ui/base/dialogs/base_shell_dialog_win.cc (working copy)
@@ -7,6 +7,7 @@
#include <algorithm>
#include "base/threading/thread.h"
+#include "base/win/scoped_com_initializer.h"
namespace {
@@ -17,11 +18,12 @@
ShellDialogThread() : base::Thread("Chrome_ShellDialogThread") { }
~ShellDialogThread();
- protected:
+ private:
void Init();
void CleanUp();
- private:
+ scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_;
+
DISALLOW_COPY_AND_ASSIGN(ShellDialogThread);
};
@@ -30,14 +32,11 @@
}
void ShellDialogThread::Init() {
- // Initializes the COM library on the current thread.
- CoInitialize(NULL);
+ com_initializer_.reset(new base::win::ScopedCOMInitializer());
}
void ShellDialogThread::CleanUp() {
- // Closes the COM library on the current thread. CoInitialize must
- // be balanced by a corresponding call to CoUninitialize.
- CoUninitialize();
+ com_initializer_.reset();
}
} // namespace
« net/url_request/url_request_unittest.cc ('K') | « remoting/host/setup/daemon_controller_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698