Commit 46c8e539 authored by Joey Scarr's avatar Joey Scarr Committed by Commit Bot

Minor clean-ups in remoting/signaling.

In response to post-commit comments on https://crrev.com/c/2050408.

Bug: 1007827,1007826
Change-Id: I4ef3aeb5ae586ad19c40db7d2c656e011bdf382a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2062016Reviewed-by: default avatardanakj <danakj@chromium.org>
Reviewed-by: default avatarJoe Downing <joedow@chromium.org>
Commit-Queue: Joey Scarr <jsca@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742855}
parent f17ed629
......@@ -347,8 +347,8 @@ void JingleSession::SendTransportInfo(
stanza->AddAttr(jingle_xmpp::QN_ID, GetNextOutgoingId());
auto request = session_manager_->iq_sender()->SendIq(
std::move(stanza), base::Bind(&JingleSession::OnTransportInfoResponse,
base::Unretained(this)));
std::move(stanza), base::BindOnce(&JingleSession::OnTransportInfoResponse,
base::Unretained(this)));
if (request) {
request->SetTimeout(base::TimeDelta::FromSeconds(kTransportInfoTimeout));
transport_info_requests_.push_back(std::move(request));
......@@ -427,8 +427,9 @@ void JingleSession::SendMessage(std::unique_ptr<JingleMessage> message) {
stanza->AddAttr(jingle_xmpp::QN_ID, GetNextOutgoingId());
auto request = session_manager_->iq_sender()->SendIq(
std::move(stanza), base::Bind(&JingleSession::OnMessageResponse,
base::Unretained(this), message->action));
std::move(stanza),
base::BindOnce(&JingleSession::OnMessageResponse, base::Unretained(this),
message->action));
int timeout = kDefaultMessageTimeout;
if (message->action == JingleMessage::SESSION_INITIATE ||
......
......@@ -68,11 +68,12 @@ void FakeSignalStrategy::ConnectTo(FakeSignalStrategy* peer) {
base::BindRepeating(&FakeSignalStrategy::DeliverMessageOnThread,
main_thread_, weak_factory_.GetWeakPtr());
if (peer->main_thread_->BelongsToCurrentThread()) {
peer->SetPeerCallback(peer_callback);
peer->SetPeerCallback(std::move(peer_callback));
} else {
peer->main_thread_->PostTask(
FROM_HERE, base::BindOnce(&FakeSignalStrategy::SetPeerCallback,
base::Unretained(peer), peer_callback));
FROM_HERE,
base::BindOnce(&FakeSignalStrategy::SetPeerCallback,
base::Unretained(peer), std::move(peer_callback)));
}
}
......
......@@ -57,8 +57,8 @@ std::unique_ptr<IqRequest> IqSender::SendIq(
}
DCHECK(requests_.find(id) == requests_.end());
bool callback_exists = !callback.is_null();
std::unique_ptr<IqRequest> request(
new IqRequest(this, std::move(callback), addressee));
auto request =
std::make_unique<IqRequest>(this, std::move(callback), addressee);
if (callback_exists)
requests_[id] = request.get();
return request;
......
......@@ -34,9 +34,9 @@ class IqSender : public SignalStrategy::Listener {
public:
// Callback that is called when an Iq response is received. Called
// with the |response| set to nullptr in case of a timeout.
typedef base::OnceCallback<void(IqRequest* request,
const jingle_xmpp::XmlElement* response)>
ReplyCallback;
using ReplyCallback =
base::OnceCallback<void(IqRequest* request,
const jingle_xmpp::XmlElement* response)>;
explicit IqSender(SignalStrategy* signal_strategy);
~IqSender() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment