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

Unified Diff: media/cdm/json_web_key.cc

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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: media/cdm/json_web_key.cc
diff --git a/media/cdm/json_web_key.cc b/media/cdm/json_web_key.cc
index aec7273a1d88dfb77596e8356acd7af37e7e9df8..60e73e8cf63af3e36108e491d5ecf11ca05766e7 100644
--- a/media/cdm/json_web_key.cc
+++ b/media/cdm/json_web_key.cc
@@ -73,8 +73,7 @@ std::string GenerateJWKSet(const uint8_t* key,
int key_id_length) {
// Create the JWK, and wrap it into a JWK Set.
std::unique_ptr<base::ListValue> list(new base::ListValue());
- list->Append(
- CreateJSONDictionary(key, key_length, key_id, key_id_length).release());
+ list->Append(CreateJSONDictionary(key, key_length, key_id, key_id_length));
base::DictionaryValue jwk_set;
jwk_set.Set(kKeysTag, list.release());
@@ -90,11 +89,10 @@ std::string GenerateJWKSet(const KeyIdAndKeyPairs& keys,
std::unique_ptr<base::ListValue> list(new base::ListValue());
for (const auto& key_pair : keys) {
list->Append(CreateJSONDictionary(
- reinterpret_cast<const uint8_t*>(key_pair.second.data()),
- key_pair.second.length(),
- reinterpret_cast<const uint8_t*>(key_pair.first.data()),
- key_pair.first.length())
- .release());
+ reinterpret_cast<const uint8_t*>(key_pair.second.data()),
+ key_pair.second.length(),
+ reinterpret_cast<const uint8_t*>(key_pair.first.data()),
+ key_pair.first.length()));
}
base::DictionaryValue jwk_set;

Powered by Google App Engine
This is Rietveld 408576698