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

Unified Diff: remoting/host/remoting_me2me_host.cc

Issue 9956148: Add file thread in MessageHostContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/plugin/host_script_object.cc ('k') | remoting/host/simple_host_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/remoting_me2me_host.cc
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index f380056afb27e437f1d868d7faff9107857b3db9..cb81bf8956671f5994a11093c6aedb16776df868 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -77,15 +77,10 @@ class HostProcess : public OAuthClient::Delegate {
public:
HostProcess()
: message_loop_(MessageLoop::TYPE_UI),
- file_io_thread_("FileIO"),
allow_nat_traversal_(true),
restarting_(false) {
- file_io_thread_.StartWithOptions(
- base::Thread::Options(MessageLoop::TYPE_IO, 0));
-
- context_.reset(new ChromotingHostContext(
- file_io_thread_.message_loop_proxy(),
- message_loop_.message_loop_proxy()));
+ context_.reset(
+ new ChromotingHostContext(message_loop_.message_loop_proxy()));
context_->Start();
network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
}
@@ -113,7 +108,7 @@ class HostProcess : public OAuthClient::Delegate {
// The auth tokens can't be updated once the host is running, so we don't
// need to check the pending state, but it's a required parameter.
bool tokens_pending;
- if (LoadConfig(file_io_thread_.message_loop_proxy(), &tokens_pending)) {
+ if (LoadConfig(&tokens_pending)) {
context_->network_message_loop()->PostTask(
FROM_HERE,
base::Bind(&HostProcess::CreateAuthenticatorFactory,
@@ -140,7 +135,7 @@ class HostProcess : public OAuthClient::Delegate {
int Run() {
bool tokens_pending = false;
- if (!LoadConfig(file_io_thread_.message_loop_proxy(), &tokens_pending)) {
+ if (!LoadConfig(&tokens_pending)) {
return kInvalidHostConfigurationExitCode;
}
if (tokens_pending) {
@@ -157,7 +152,7 @@ class HostProcess : public OAuthClient::Delegate {
}
#if defined(OS_MACOSX)
- file_io_thread_.message_loop_proxy()->PostTask(
+ context_->file_message_loop()->PostTask(
FROM_HERE,
base::Bind(&HostProcess::ListenForConfigChanges,
base::Unretained(this)));
@@ -192,14 +187,14 @@ class HostProcess : public OAuthClient::Delegate {
private:
void StartWatchingNatPolicy() {
nat_policy_.reset(
- policy_hack::NatPolicy::Create(file_io_thread_.message_loop_proxy()));
+ policy_hack::NatPolicy::Create(
+ context_->file_message_loop()->message_loop_proxy()));
nat_policy_->StartWatching(
base::Bind(&HostProcess::OnNatPolicyUpdate, base::Unretained(this)));
}
// Read Host config from disk, returning true if successful.
- bool LoadConfig(base::MessageLoopProxy* io_message_loop,
- bool* tokens_pending) {
+ bool LoadConfig(bool* tokens_pending) {
JsonHostConfig host_config(host_config_path_);
JsonHostConfig auth_config(auth_config_path_);
@@ -343,7 +338,6 @@ class HostProcess : public OAuthClient::Delegate {
}
MessageLoop message_loop_;
- base::Thread file_io_thread_;
scoped_ptr<ChromotingHostContext> context_;
scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_;
« no previous file with comments | « remoting/host/plugin/host_script_object.cc ('k') | remoting/host/simple_host_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698