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

Unified Diff: google_apis/gcm/base/mcs_message.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/base/mcs_message.cc
diff --git a/google_apis/gcm/base/mcs_message.cc b/google_apis/gcm/base/mcs_message.cc
index b14c751c8198baeef6a234f265b4007d2bbab230..1b0f0222e7ca31ae007b7e0884e0003f02786695 100644
--- a/google_apis/gcm/base/mcs_message.cc
+++ b/google_apis/gcm/base/mcs_message.cc
@@ -15,14 +15,14 @@ MCSMessage::Core::Core() {}
MCSMessage::Core::Core(uint8_t tag,
const google::protobuf::MessageLite& protobuf) {
- scoped_ptr<google::protobuf::MessageLite> owned_protobuf(protobuf.New());
+ std::unique_ptr<google::protobuf::MessageLite> owned_protobuf(protobuf.New());
owned_protobuf->CheckTypeAndMergeFrom(protobuf);
protobuf_ = std::move(owned_protobuf);
}
MCSMessage::Core::Core(
uint8_t tag,
- scoped_ptr<const google::protobuf::MessageLite> protobuf) {
+ std::unique_ptr<const google::protobuf::MessageLite> protobuf) {
protobuf_ = std::move(protobuf);
}
@@ -46,8 +46,9 @@ MCSMessage::MCSMessage(uint8_t tag,
DCHECK_EQ(tag, GetMCSProtoTag(protobuf));
}
-MCSMessage::MCSMessage(uint8_t tag,
- scoped_ptr<const google::protobuf::MessageLite> protobuf)
+MCSMessage::MCSMessage(
+ uint8_t tag,
+ std::unique_ptr<const google::protobuf::MessageLite> protobuf)
: tag_(tag),
size_(protobuf->ByteSize()),
core_(new Core(tag_, std::move(protobuf))) {
@@ -71,8 +72,9 @@ const google::protobuf::MessageLite& MCSMessage::GetProtobuf() const {
return core_->Get();
}
-scoped_ptr<google::protobuf::MessageLite> MCSMessage::CloneProtobuf() const {
- scoped_ptr<google::protobuf::MessageLite> clone(GetProtobuf().New());
+std::unique_ptr<google::protobuf::MessageLite> MCSMessage::CloneProtobuf()
+ const {
+ std::unique_ptr<google::protobuf::MessageLite> clone(GetProtobuf().New());
clone->CheckTypeAndMergeFrom(GetProtobuf());
return clone;
}

Powered by Google App Engine
This is Rietveld 408576698