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

Unified Diff: chromecast/media/cma/ipc_streamer/decrypt_config_marshaller.cc

Issue 1875623002: Convert //chromecast 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: chromecast/media/cma/ipc_streamer/decrypt_config_marshaller.cc
diff --git a/chromecast/media/cma/ipc_streamer/decrypt_config_marshaller.cc b/chromecast/media/cma/ipc_streamer/decrypt_config_marshaller.cc
index e45a0e9362cc5563da62b60409035e940aa47d00..fcfe2c1399b7e433014a4382418a6a02027e8a1c 100644
--- a/chromecast/media/cma/ipc_streamer/decrypt_config_marshaller.cc
+++ b/chromecast/media/cma/ipc_streamer/decrypt_config_marshaller.cc
@@ -39,19 +39,20 @@ void DecryptConfigMarshaller::Write(const CastDecryptConfig& config,
}
// static
-scoped_ptr<CastDecryptConfig> DecryptConfigMarshaller::Read(MediaMessage* msg) {
+std::unique_ptr<CastDecryptConfig> DecryptConfigMarshaller::Read(
+ MediaMessage* msg) {
size_t key_id_size = 0;
CHECK(msg->ReadPod(&key_id_size));
CHECK_GT(key_id_size, 0u);
CHECK_LT(key_id_size, kMaxKeyIdSize);
- scoped_ptr<char[]> key_id(new char[key_id_size]);
+ std::unique_ptr<char[]> key_id(new char[key_id_size]);
CHECK(msg->ReadBuffer(key_id.get(), key_id_size));
size_t iv_size = 0;
CHECK(msg->ReadPod(&iv_size));
CHECK_GT(iv_size, 0u);
CHECK_LT(iv_size, kMaxIvSize);
- scoped_ptr<char[]> iv(new char[iv_size]);
+ std::unique_ptr<char[]> iv(new char[iv_size]);
CHECK(msg->ReadBuffer(iv.get(), iv_size));
size_t subsample_count = 0;
@@ -66,7 +67,7 @@ scoped_ptr<CastDecryptConfig> DecryptConfigMarshaller::Read(MediaMessage* msg) {
CHECK(msg->ReadPod(&subsamples[k].cypher_bytes));
}
- return scoped_ptr<CastDecryptConfig>(
+ return std::unique_ptr<CastDecryptConfig>(
new CastDecryptConfigImpl(std::string(key_id.get(), key_id_size),
std::string(iv.get(), iv_size), subsamples));
}

Powered by Google App Engine
This is Rietveld 408576698