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

Unified Diff: remoting/host/it2me/it2me_host.cc

Issue 886913002: Always run PolicyWatcher on UI thread in It2Me host. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/it2me/it2me_host.h ('k') | remoting/host/policy_watcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/it2me/it2me_host.cc
diff --git a/remoting/host/it2me/it2me_host.cc b/remoting/host/it2me/it2me_host.cc
index 2834dcd72c28d9e5abb0e03e31eb8428210a85ee..22a9790d69876bfecdb223eb0d04acc0ea4e308c 100644
--- a/remoting/host/it2me/it2me_host.cc
+++ b/remoting/host/it2me/it2me_host.cc
@@ -298,14 +298,6 @@ void It2MeHost::ShutdownOnUiThread() {
desktop_environment_factory_.reset();
// Stop listening for policy updates.
- if (policy_watcher_.get()) {
- policy_watcher_->StopWatching(
- base::Bind(&It2MeHost::OnPolicyWatcherShutdown, this));
- return;
- }
-}
-
-void It2MeHost::OnPolicyWatcherShutdown() {
policy_watcher_.reset();
}
@@ -356,8 +348,7 @@ void It2MeHost::OnClientDisconnected(const std::string& jid) {
}
void It2MeHost::OnPolicyUpdate(scoped_ptr<base::DictionaryValue> policies) {
- // The policy watcher runs on the |ui_task_runner| on ChromeOS and the
- // |network_task_runner| on other platforms.
+ // The policy watcher runs on the |ui_task_runner|.
if (!host_context_->network_task_runner()->BelongsToCurrentThread()) {
host_context_->network_task_runner()->PostTask(
FROM_HERE,
@@ -532,10 +523,12 @@ scoped_refptr<It2MeHost> It2MeHostFactory::CreateIt2MeHost(
base::WeakPtr<It2MeHost::Observer> observer,
const XmppSignalStrategy::XmppServerConfig& xmpp_server_config,
const std::string& directory_bot_jid) {
+ DCHECK(context->ui_task_runner()->BelongsToCurrentThread());
+
scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory(
new It2MeConfirmationDialogFactory());
scoped_ptr<PolicyWatcher> policy_watcher =
- PolicyWatcher::Create(policy_service_, context->network_task_runner());
+ PolicyWatcher::Create(policy_service_, context->file_task_runner());
return new It2MeHost(context.Pass(), policy_watcher.Pass(),
confirmation_dialog_factory.Pass(),
observer, xmpp_server_config, directory_bot_jid);
« no previous file with comments | « remoting/host/it2me/it2me_host.h ('k') | remoting/host/policy_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698