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

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

Issue 2747743004: Fix crash when user disconnects It2Me host (Closed)
Patch Set: Fix Client breakage Created 3 years, 9 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_native_messaging_host.h ('k') | remoting/signaling/delegating_signal_strategy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/it2me/it2me_native_messaging_host.cc
diff --git a/remoting/host/it2me/it2me_native_messaging_host.cc b/remoting/host/it2me/it2me_native_messaging_host.cc
index 41e8f75ea95aa527f1a0d74c2ed1b56d8125e0ce..5636006d9a67f9309061773b79c4a1f931fbcadf 100644
--- a/remoting/host/it2me/it2me_native_messaging_host.cc
+++ b/remoting/host/it2me/it2me_native_messaging_host.cc
@@ -296,11 +296,14 @@ void It2MeNativeMessagingHost::ProcessConnect(
return;
}
- delegating_signal_strategy_ = new DelegatingSignalStrategy(
- local_jid, host_context_->network_task_runner(),
- base::Bind(&It2MeNativeMessagingHost::SendOutgoingIq,
- weak_factory_.GetWeakPtr()));
- signal_strategy.reset(delegating_signal_strategy_);
+ auto delegating_signal_strategy =
+ base::MakeUnique<DelegatingSignalStrategy>(
+ local_jid, host_context_->network_task_runner(),
+ base::Bind(&It2MeNativeMessagingHost::SendOutgoingIq,
+ weak_factory_.GetWeakPtr()));
+ incoming_message_callback_ =
+ delegating_signal_strategy->GetIncomingMessageCallback();
+ signal_strategy = std::move(delegating_signal_strategy);
}
std::string directory_bot_jid = service_urls->directory_bot_jid();
@@ -357,8 +360,7 @@ void It2MeNativeMessagingHost::ProcessIncomingIq(
return;
}
- if (delegating_signal_strategy_)
- delegating_signal_strategy_->OnIncomingMessage(iq);
+ incoming_message_callback_.Run(iq);
SendMessageToClient(std::move(response));
};
« no previous file with comments | « remoting/host/it2me/it2me_native_messaging_host.h ('k') | remoting/signaling/delegating_signal_strategy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698