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

Unified Diff: remoting/host/host_user_interface.cc

Issue 10572005: Use SingleThreadTaskRunner instead of MessageLoopProxy in remoting/host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | « remoting/host/host_user_interface.h ('k') | remoting/host/it2me_host_user_interface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/host_user_interface.cc
diff --git a/remoting/host/host_user_interface.cc b/remoting/host/host_user_interface.cc
index 399a9fc59149ece15ec178f331c3fe7784383e89..925e1069b7bbd62a8f3b30fe917b80c36c042daa 100644
--- a/remoting/host/host_user_interface.cc
+++ b/remoting/host/host_user_interface.cc
@@ -18,11 +18,11 @@ HostUserInterface::HostUserInterface(ChromotingHostContext* context)
is_monitoring_local_inputs_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
weak_ptr_(weak_factory_.GetWeakPtr()) {
- DCHECK(ui_message_loop()->BelongsToCurrentThread());
+ DCHECK(ui_task_runner()->BelongsToCurrentThread());
}
HostUserInterface::~HostUserInterface() {
- DCHECK(ui_message_loop()->BelongsToCurrentThread());
+ DCHECK(ui_task_runner()->BelongsToCurrentThread());
MonitorLocalInputs(false);
ShowDisconnectWindow(false, std::string());
@@ -30,7 +30,7 @@ HostUserInterface::~HostUserInterface() {
void HostUserInterface::Start(ChromotingHost* host,
const base::Closure& disconnect_callback) {
- DCHECK(network_message_loop()->BelongsToCurrentThread());
+ DCHECK(network_task_runner()->BelongsToCurrentThread());
DCHECK(host_ == NULL);
DCHECK(disconnect_callback_.is_null());
@@ -42,21 +42,21 @@ void HostUserInterface::Start(ChromotingHost* host,
}
void HostUserInterface::OnClientAuthenticated(const std::string& jid) {
- DCHECK(network_message_loop()->BelongsToCurrentThread());
+ DCHECK(network_task_runner()->BelongsToCurrentThread());
authenticated_jid_ = jid;
std::string username = jid.substr(0, jid.find('/'));
- ui_message_loop()->PostTask(FROM_HERE, base::Bind(
+ ui_task_runner()->PostTask(FROM_HERE, base::Bind(
&HostUserInterface::ProcessOnClientAuthenticated,
weak_ptr_, username));
}
void HostUserInterface::OnClientDisconnected(const std::string& jid) {
- DCHECK(network_message_loop()->BelongsToCurrentThread());
+ DCHECK(network_task_runner()->BelongsToCurrentThread());
if (jid == authenticated_jid_) {
- ui_message_loop()->PostTask(FROM_HERE, base::Bind(
+ ui_task_runner()->PostTask(FROM_HERE, base::Bind(
&HostUserInterface::ProcessOnClientDisconnected,
weak_ptr_));
}
@@ -66,7 +66,7 @@ void HostUserInterface::OnAccessDenied(const std::string& jid) {
}
void HostUserInterface::OnShutdown() {
- DCHECK(network_message_loop()->BelongsToCurrentThread());
+ DCHECK(network_task_runner()->BelongsToCurrentThread());
// Host status observers must be removed on the network thread, so
// it must happen here instead of in the destructor.
@@ -75,22 +75,22 @@ void HostUserInterface::OnShutdown() {
}
void HostUserInterface::OnDisconnectCallback() {
- DCHECK(ui_message_loop()->BelongsToCurrentThread());
+ DCHECK(ui_task_runner()->BelongsToCurrentThread());
MonitorLocalInputs(false);
ShowDisconnectWindow(false, std::string());
DisconnectSession();
}
-base::MessageLoopProxy* HostUserInterface::network_message_loop() const {
- return context_->network_message_loop();
+base::SingleThreadTaskRunner* HostUserInterface::network_task_runner() const {
+ return context_->network_task_runner();
}
-base::MessageLoopProxy* HostUserInterface::ui_message_loop() const {
- return context_->ui_message_loop();
+base::SingleThreadTaskRunner* HostUserInterface::ui_task_runner() const {
+ return context_->ui_task_runner();
}
void HostUserInterface::DisconnectSession() const {
- DCHECK(ui_message_loop()->BelongsToCurrentThread());
+ DCHECK(ui_task_runner()->BelongsToCurrentThread());
DCHECK(!disconnect_callback_.is_null());
disconnect_callback_.Run();
@@ -98,14 +98,14 @@ void HostUserInterface::DisconnectSession() const {
void HostUserInterface::ProcessOnClientAuthenticated(
const std::string& username) {
- DCHECK(ui_message_loop()->BelongsToCurrentThread());
+ DCHECK(ui_task_runner()->BelongsToCurrentThread());
MonitorLocalInputs(true);
ShowDisconnectWindow(true, username);
}
void HostUserInterface::ProcessOnClientDisconnected() {
- DCHECK(ui_message_loop()->BelongsToCurrentThread());
+ DCHECK(ui_task_runner()->BelongsToCurrentThread());
MonitorLocalInputs(false);
ShowDisconnectWindow(false, std::string());
@@ -116,7 +116,7 @@ void HostUserInterface::StartForTest(
const base::Closure& disconnect_callback,
scoped_ptr<DisconnectWindow> disconnect_window,
scoped_ptr<LocalInputMonitor> local_input_monitor) {
- DCHECK(network_message_loop()->BelongsToCurrentThread());
+ DCHECK(network_task_runner()->BelongsToCurrentThread());
DCHECK(host_ == NULL);
DCHECK(disconnect_callback_.is_null());
@@ -127,7 +127,7 @@ void HostUserInterface::StartForTest(
}
void HostUserInterface::MonitorLocalInputs(bool enable) {
- DCHECK(ui_message_loop()->BelongsToCurrentThread());
+ DCHECK(ui_task_runner()->BelongsToCurrentThread());
if (enable != is_monitoring_local_inputs_) {
if (enable) {
@@ -141,7 +141,7 @@ void HostUserInterface::MonitorLocalInputs(bool enable) {
void HostUserInterface::ShowDisconnectWindow(bool show,
const std::string& username) {
- DCHECK(ui_message_loop()->BelongsToCurrentThread());
+ DCHECK(ui_task_runner()->BelongsToCurrentThread());
if (show) {
disconnect_window_->Show(
« no previous file with comments | « remoting/host/host_user_interface.h ('k') | remoting/host/it2me_host_user_interface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698