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

Unified Diff: chrome/browser/chromeos/extensions/wallpaper_private_api.cc

Issue 2065793002: Return a unique_ptr from BinaryValue::CreateWithCopiedBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android and CrOS 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: chrome/browser/chromeos/extensions/wallpaper_private_api.cc
diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
index 99546e804d6819691b24f7e1153062336d2209b5..a0905ed8ba982031e353408e08b72111211476cd 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
@@ -716,9 +716,8 @@ void WallpaperPrivateSetCustomWallpaperFunction::GenerateThumbnail(
void WallpaperPrivateSetCustomWallpaperFunction::ThumbnailGenerated(
base::RefCountedBytes* data) {
- BinaryValue* result = BinaryValue::CreateWithCopiedBuffer(
- reinterpret_cast<const char*>(data->front()), data->size());
- SetResult(base::WrapUnique(result));
+ SetResult(BinaryValue::CreateWithCopiedBuffer(
+ reinterpret_cast<const char*>(data->front()), data->size()));
SendResponse(true);
}
@@ -842,9 +841,7 @@ void WallpaperPrivateGetThumbnailFunction::FileNotLoaded() {
void WallpaperPrivateGetThumbnailFunction::FileLoaded(
const std::string& data) {
- BinaryValue* thumbnail = BinaryValue::CreateWithCopiedBuffer(data.c_str(),
- data.size());
- SetResult(base::WrapUnique(thumbnail));
+ SetResult(BinaryValue::CreateWithCopiedBuffer(data.c_str(), data.size()));
SendResponse(true);
}

Powered by Google App Engine
This is Rietveld 408576698