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

Unified Diff: chrome/browser/ui/webui/chromeos/image_source.cc

Issue 2517053004: Use base::RefCountedBytes in user_manager::UserImage (Closed)
Patch Set: remove unnecessary base::move Created 4 years, 1 month 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/ui/webui/chromeos/image_source.cc
diff --git a/chrome/browser/ui/webui/chromeos/image_source.cc b/chrome/browser/ui/webui/chromeos/image_source.cc
index e6af8a9c55003a844928e0f17953ce6a91c9f0a4..621461b7f0874c6b62dbcaf5ae1ae16cc51df3be 100644
--- a/chrome/browser/ui/webui/chromeos/image_source.cc
+++ b/chrome/browser/ui/webui/chromeos/image_source.cc
@@ -38,11 +38,10 @@ void ImageLoaded(
std::unique_ptr<user_manager::UserImage> user_image) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- // TODO(crbug.com/593251): Remove the data copy.
if (user_image->has_image_bytes())
- got_data_callback.Run(new base::RefCountedBytes(user_image->image_bytes()));
+ got_data_callback.Run(user_image->image_bytes());
else
- got_data_callback.Run(NULL);
+ got_data_callback.Run(nullptr);
}
} // namespace
@@ -67,7 +66,7 @@ void ImageSource::StartDataRequest(
const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
const content::URLDataSource::GotDataCallback& got_data_callback) {
if (!IsWhitelisted(path)) {
- got_data_callback.Run(NULL);
+ got_data_callback.Run(nullptr);
return;
}

Powered by Google App Engine
This is Rietveld 408576698