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

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

Issue 1873663002: Convert //google_apis from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 dfa1f8528c4f951a1fb39ce9bff9e196226b31c8..46060985a328247766f4b0f8a7da48dd404af190 100644
--- a/google_apis/gcm/engine/mcs_client.cc
+++ b/google_apis/gcm/engine/mcs_client.cc
@@ -27,7 +27,7 @@ namespace gcm {
namespace {
-typedef scoped_ptr<google::protobuf::MessageLite> MCSProto;
+typedef std::unique_ptr<google::protobuf::MessageLite> MCSProto;
// The category of messages intended for the GCM client itself from MCS.
const char kMCSCategory[] = "com.google.android.gsf.gtalkservice";
@@ -189,7 +189,7 @@ void MCSClient::Initialize(
const ErrorCallback& error_callback,
const OnMessageReceivedCallback& message_received_callback,
const OnMessageSentCallback& message_sent_callback,
- scoped_ptr<GCMStore::LoadResult> load_result) {
+ std::unique_ptr<GCMStore::LoadResult> load_result) {
DCHECK_EQ(state_, UNINITIALIZED);
state_ = LOADED;
@@ -317,7 +317,7 @@ void MCSClient::SendMessage(const MCSMessage& message) {
return;
}
- scoped_ptr<ReliablePacketInfo> packet_info(new ReliablePacketInfo());
+ std::unique_ptr<ReliablePacketInfo> packet_info(new ReliablePacketInfo());
packet_info->tag = message.tag();
packet_info->protobuf = message.CloneProtobuf();
@@ -378,7 +378,7 @@ void MCSClient::SendMessage(const MCSMessage& message) {
MaybeSendMessage();
}
-void MCSClient::UpdateHeartbeatTimer(scoped_ptr<base::Timer> timer) {
+void MCSClient::UpdateHeartbeatTimer(std::unique_ptr<base::Timer> timer) {
heartbeat_manager_.UpdateHeartbeatTimer(std::move(timer));
}
@@ -606,12 +606,12 @@ void MCSClient::SendPacketToWire(ReliablePacketInfo* packet_info) {
}
void MCSClient::HandleMCSDataMesssage(
- scoped_ptr<google::protobuf::MessageLite> protobuf) {
+ std::unique_ptr<google::protobuf::MessageLite> protobuf) {
mcs_proto::DataMessageStanza* data_message =
reinterpret_cast<mcs_proto::DataMessageStanza*>(protobuf.get());
// TODO(zea): implement a proper status manager rather than hardcoding these
// values.
- scoped_ptr<mcs_proto::DataMessageStanza> response(
+ std::unique_ptr<mcs_proto::DataMessageStanza> response(
new mcs_proto::DataMessageStanza());
response->set_from(kGCMFromField);
response->set_sent(clock_->Now().ToInternalValue() /
@@ -637,7 +637,7 @@ void MCSClient::HandleMCSDataMesssage(
}
void MCSClient::HandlePacketFromWire(
- scoped_ptr<google::protobuf::MessageLite> protobuf) {
+ std::unique_ptr<google::protobuf::MessageLite> protobuf) {
if (!protobuf.get())
return;
uint8_t tag = GetMCSProtoTag(*protobuf);

Powered by Google App Engine
This is Rietveld 408576698