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

Unified Diff: google_apis/gcm/engine/mcs_client.cc

Issue 1547233002: Convert Pass()→std::move() in //google_apis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « google_apis/gcm/engine/heartbeat_manager.cc ('k') | google_apis/gcm/engine/mcs_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/mcs_client.cc
diff --git a/google_apis/gcm/engine/mcs_client.cc b/google_apis/gcm/engine/mcs_client.cc
index 93854513056d56ef0ba645f78e1fb9856892bf4e..dfa1f8528c4f951a1fb39ce9bff9e196226b31c8 100644
--- a/google_apis/gcm/engine/mcs_client.cc
+++ b/google_apis/gcm/engine/mcs_client.cc
@@ -5,8 +5,8 @@
#include "google_apis/gcm/engine/mcs_client.h"
#include <stddef.h>
-
#include <set>
+#include <utility>
#include "base/bind.h"
#include "base/location.h"
@@ -334,7 +334,7 @@ void MCSClient::SendMessage(const MCSMessage& message) {
ReliablePacketInfo* original_packet = collapse_key_map_[collapse_key];
DVLOG(1) << "Found matching collapse key, Reusing persistent id of "
<< original_packet->persistent_id;
- original_packet->protobuf = packet_info->protobuf.Pass();
+ original_packet->protobuf = std::move(packet_info->protobuf);
SetPersistentId(original_packet->persistent_id,
original_packet->protobuf.get());
gcm_store_->OverwriteOutgoingMessage(
@@ -379,7 +379,7 @@ void MCSClient::SendMessage(const MCSMessage& message) {
}
void MCSClient::UpdateHeartbeatTimer(scoped_ptr<base::Timer> timer) {
- heartbeat_manager_.UpdateHeartbeatTimer(timer.Pass());
+ heartbeat_manager_.UpdateHeartbeatTimer(std::move(timer));
}
void MCSClient::AddHeartbeatInterval(const std::string& scope,
@@ -632,7 +632,7 @@ void MCSClient::HandleMCSDataMesssage(
}
if (send) {
- SendMessage(MCSMessage(kDataMessageStanzaTag, response.Pass()));
+ SendMessage(MCSMessage(kDataMessageStanzaTag, std::move(response)));
}
}
@@ -721,9 +721,8 @@ void MCSClient::HandlePacketFromWire(
// Pass the login response on up.
base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE,
- base::Bind(message_received_callback_,
- MCSMessage(tag, protobuf.Pass())));
+ FROM_HERE, base::Bind(message_received_callback_,
+ MCSMessage(tag, std::move(protobuf))));
// If there are pending messages, attempt to send one.
if (!to_send_.empty()) {
@@ -786,15 +785,14 @@ void MCSClient::HandlePacketFromWire(
mcs_proto::DataMessageStanza* data_message =
reinterpret_cast<mcs_proto::DataMessageStanza*>(protobuf.get());
if (data_message->category() == kMCSCategory) {
- HandleMCSDataMesssage(protobuf.Pass());
+ HandleMCSDataMesssage(std::move(protobuf));
return;
}
DCHECK(protobuf.get());
base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE,
- base::Bind(message_received_callback_,
- MCSMessage(tag, protobuf.Pass())));
+ FROM_HERE, base::Bind(message_received_callback_,
+ MCSMessage(tag, std::move(protobuf))));
return;
}
default:
« no previous file with comments | « google_apis/gcm/engine/heartbeat_manager.cc ('k') | google_apis/gcm/engine/mcs_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698