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

Unified Diff: chrome/browser/extensions/api/media_galleries/media_galleries_api.cc

Issue 2888073002: Remove raw DictionaryValue::Set in //chrome (Closed)
Patch Set: Fix Tests Created 3 years, 7 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: chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
index 9984780697852ce7ea656830491c8d7a22b609a2..dd6ccd573ffb145101e39ccfc1b08cef7fa51a06 100644
--- a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
+++ b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
@@ -664,7 +664,7 @@ void MediaGalleriesGetMetadataFunction::GetMetadata(
std::unique_ptr<base::DictionaryValue> result_dictionary(
new base::DictionaryValue);
- result_dictionary->Set(kMetadataKey, metadata.ToValue().release());
+ result_dictionary->Set(kMetadataKey, metadata.ToValue());
SetResult(std::move(result_dictionary));
SendResponse(true);
return;
@@ -700,7 +700,7 @@ void MediaGalleriesGetMetadataFunction::OnSafeMediaMetadataParserDone(
std::unique_ptr<base::DictionaryValue> result_dictionary(
new base::DictionaryValue);
- result_dictionary->Set(kMetadataKey, metadata_dictionary.release());
+ result_dictionary->Set(kMetadataKey, std::move(metadata_dictionary));
if (attached_images->empty()) {
SetResult(std::move(result_dictionary));
@@ -708,7 +708,8 @@ void MediaGalleriesGetMetadataFunction::OnSafeMediaMetadataParserDone(
return;
}
- result_dictionary->Set(kAttachedImagesBlobInfoKey, new base::ListValue);
+ result_dictionary->Set(kAttachedImagesBlobInfoKey,
+ base::MakeUnique<base::ListValue>());
metadata::AttachedImage* first_image = &attached_images->front();
content::BrowserContext::CreateMemoryBackedBlob(
GetProfile(), first_image->data.c_str(), first_image->data.size(),
@@ -743,11 +744,10 @@ void MediaGalleriesGetMetadataFunction::ConstructNextBlob(
&(*attached_images)[blob_uuids->size()];
std::unique_ptr<base::DictionaryValue> attached_image(
new base::DictionaryValue);
- attached_image->Set(kBlobUUIDKey, new base::Value(current_blob->GetUUID()));
- attached_image->Set(kTypeKey, new base::Value(current_image->type));
- attached_image->Set(
- kSizeKey,
- new base::Value(base::checked_cast<int>(current_image->data.size())));
+ attached_image->SetString(kBlobUUIDKey, current_blob->GetUUID());
+ attached_image->SetString(kTypeKey, current_image->type);
+ attached_image->SetInteger(
+ kSizeKey, base::checked_cast<int>(current_image->data.size()));
attached_images_list->Append(std::move(attached_image));
blob_uuids->push_back(current_blob->GetUUID());
« no previous file with comments | « no previous file | chrome/browser/extensions/api/proxy/proxy_api.cc » ('j') | chrome/browser/prerender/prerender_history.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698