Index: remoting/host/setup/daemon_controller_win.cc |
=================================================================== |
--- remoting/host/setup/daemon_controller_win.cc (revision 159985) |
+++ remoting/host/setup/daemon_controller_win.cc (working copy) |
@@ -16,13 +16,12 @@ |
#include "base/json/json_writer.h" |
#include "base/logging.h" |
#include "base/string16.h" |
-#include "base/threading/thread.h" |
+#include "base/threading/com_thread.h" |
#include "base/time.h" |
#include "base/timer.h" |
#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,17 @@ |
HWND window_handle_; |
// The worker thread used for servicing long running operations. |
- ComThread worker_thread_; |
+ base::ComThread 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_(kDaemonControllerThreadName, false) { |
if (!worker_thread_.Start()) { |
LOG(FATAL) << "Failed to start the Daemon Controller worker thread."; |
} |