summaryrefslogtreecommitdiffstats
path: root/remoting/host/host_mock_objects.cc
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-04 22:27:43 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-04 22:27:43 +0000
commitef948e69b97c179af5eb69ae318714052230df4f (patch)
treecc76efb6983b1a5868f26769fb654185880f2805 /remoting/host/host_mock_objects.cc
parent38091251bfc38e7ae748edbf66b13dd360f68bb4 (diff)
downloadchromium_src-ef948e69b97c179af5eb69ae318714052230df4f.zip
chromium_src-ef948e69b97c179af5eb69ae318714052230df4f.tar.gz
chromium_src-ef948e69b97c179af5eb69ae318714052230df4f.tar.bz2
[Chromoting] Introducing refcount-based life time management of the message loops in the service (daemon) and me2me host (network) processes.
This CL introduces AutoMessageLoop wrapper that provides control over life time of a message loop via scoped_refptr references. This scheme is useful in the cases when shutdown code has to run on a particular thread or when the OS requires resources (such as windows) to be freed before exiting a message loop. The CL switches threads, owned by remoting::HostService, remoting::HostProcess and remoting::ChromotingHostContext, to refcount-based lifetime management. This change required updating tear-down sequences in remoting_me2me_host and the host plugin code. BUG=134694 Review URL: https://chromiumcodereview.appspot.com/10829467 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/host_mock_objects.cc')
-rw-r--r--remoting/host/host_mock_objects.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/remoting/host/host_mock_objects.cc b/remoting/host/host_mock_objects.cc
index f192f8e..f8867a3 100644
--- a/remoting/host/host_mock_objects.cc
+++ b/remoting/host/host_mock_objects.cc
@@ -6,6 +6,7 @@
#include "base/message_loop_proxy.h"
#include "net/base/ip_endpoint.h"
+#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/base/capture_data.h"
#include "remoting/proto/event.pb.h"
#include "remoting/protocol/transport.h"
@@ -59,7 +60,8 @@ scoped_ptr<LocalInputMonitor> LocalInputMonitor::Create() {
}
MockChromotingHostContext::MockChromotingHostContext()
- : ChromotingHostContext(base::MessageLoopProxy::current()) {
+ : ChromotingHostContext(new AutoThreadTaskRunner(
+ base::MessageLoopProxy::current())) {
}
MockChromotingHostContext::~MockChromotingHostContext() {}