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

Unified Diff: remoting/host/setup/daemon_controller_win.cc

Issue 11048029: Allow Thread to initialize COM for Windows consumers who need it (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
« no previous file with comments | « media/audio/fake_audio_output_stream.cc ('k') | ui/base/dialogs/base_shell_dialog_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/setup/daemon_controller_win.cc
===================================================================
--- remoting/host/setup/daemon_controller_win.cc (revision 163371)
+++ remoting/host/setup/daemon_controller_win.cc (working copy)
@@ -22,7 +22,6 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "base/win/scoped_bstr.h"
-#include "base/win/scoped_com_initializer.h"
#include "base/win/scoped_comptr.h"
#include "base/win/windows_version.h"
#include "remoting/base/scoped_sc_handle_win.h"
@@ -64,23 +63,6 @@
// that the old binary will go away sooner.
const int kUnprivilegedTimeoutSec = 60;
-// A base::Thread implementation that initializes COM on the new thread.
-class ComThread : public base::Thread {
- public:
- explicit ComThread(const char* name);
- virtual ~ComThread();
-
- bool Start();
-
- private:
- virtual void Init() OVERRIDE;
- virtual void CleanUp() OVERRIDE;
-
- scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_;
-
- DISALLOW_COPY_AND_ASSIGN(ComThread);
-};
-
class DaemonControllerWin : public remoting::DaemonController {
public:
DaemonControllerWin();
@@ -165,38 +147,18 @@
HWND window_handle_;
// The worker thread used for servicing long running operations.
- ComThread worker_thread_;
+ base::Thread worker_thread_;
scoped_ptr<DaemonInstallerWin> installer_;
DISALLOW_COPY_AND_ASSIGN(DaemonControllerWin);
};
-ComThread::ComThread(const char* name) : base::Thread(name) {
-}
-
-ComThread::~ComThread() {
- Stop();
-}
-
-bool ComThread::Start() {
- // N.B. The single threaded COM apartment must be run on a UI message loop.
- base::Thread::Options thread_options(MessageLoop::TYPE_UI, 0);
- return StartWithOptions(thread_options);
-}
-
-void ComThread::Init() {
- com_initializer_.reset(new base::win::ScopedCOMInitializer());
-}
-
-void ComThread::CleanUp() {
- com_initializer_.reset();
-}
-
DaemonControllerWin::DaemonControllerWin()
: control_is_elevated_(false),
window_handle_(NULL),
worker_thread_(kDaemonControllerThreadName) {
+ worker_thread_.init_com_with_mta(false);
if (!worker_thread_.Start()) {
LOG(FATAL) << "Failed to start the Daemon Controller worker thread.";
}
« no previous file with comments | « media/audio/fake_audio_output_stream.cc ('k') | ui/base/dialogs/base_shell_dialog_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698