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

Unified Diff: chrome/browser/ui/webui/options/chromeos/user_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
« no previous file with comments | « chrome/browser/ui/webui/chromeos/image_source.cc ('k') | components/user_manager/user.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/chromeos/user_image_source.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/user_image_source.cc b/chrome/browser/ui/webui/options/chromeos/user_image_source.cc
index ae1a8719ccc20f9a3dc446d68c0fb3e762592a30..d302cbfb181902662e122fce7a9f3541074a0405 100644
--- a/chrome/browser/ui/webui/options/chromeos/user_image_source.cc
+++ b/chrome/browser/ui/webui/options/chromeos/user_image_source.cc
@@ -43,7 +43,8 @@ void ParseRequest(const GURL& url, std::string* email) {
*email = account_id.GetUserEmail();
}
-base::RefCountedMemory* GetUserImageInternal(const AccountId& account_id) {
+scoped_refptr<base::RefCountedMemory> GetUserImageInternal(
+ const AccountId& account_id) {
const user_manager::User* user =
user_manager::UserManager::Get()->FindUser(account_id);
@@ -53,7 +54,7 @@ base::RefCountedMemory* GetUserImageInternal(const AccountId& account_id) {
// specifically want 100% scale images to not transmit more data than needed.
if (user) {
if (user->has_image_bytes())
- return new base::RefCountedBytes(user->image_bytes());
+ return user->image_bytes();
if (user->image_is_stub()) {
return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
IDR_PROFILE_PICTURE_LOADING, ui::SCALE_FACTOR_100P);
« no previous file with comments | « chrome/browser/ui/webui/chromeos/image_source.cc ('k') | components/user_manager/user.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698