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

Unified Diff: components/user_manager/user_image/user_image.h

Issue 1794323003: Make user_manager::UserImage non-copyable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: just rebase Created 4 years, 8 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
« no previous file with comments | « components/user_manager/user.cc ('k') | components/user_manager/user_image/user_image.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/user_manager/user_image/user_image.h
diff --git a/components/user_manager/user_image/user_image.h b/components/user_manager/user_image/user_image.h
index d6621be66e37eb7b8ae9e4a4100ea956ead2ac62..0d3e244decd392bdd8c9d6f7c31f61673f768b04 100644
--- a/components/user_manager/user_image/user_image.h
+++ b/components/user_manager/user_image/user_image.h
@@ -29,9 +29,9 @@ class USER_MANAGER_EXPORT UserImage {
static scoped_ptr<Bytes> Encode(const SkBitmap& bitmap);
// Creates a new instance from a given still frame and tries to encode it
- // to bytes representation for WebUI.
+ // to bytes representation for WebUI. Always returns a non-null result.
// TODO(ivankr): remove eventually.
- static UserImage CreateAndEncode(const gfx::ImageSkia& image);
+ static scoped_ptr<UserImage> CreateAndEncode(const gfx::ImageSkia& image);
// Create instance with an empty still frame and no bytes
// representation for WebUI.
@@ -43,6 +43,7 @@ class USER_MANAGER_EXPORT UserImage {
// Creates a new instance from a given still frame and bytes
// representation for WebUI.
+ // TODO(crbug.com/593251): Remove the data copy via |image_bytes|.
UserImage(const gfx::ImageSkia& image, const Bytes& image_bytes);
virtual ~UserImage();
@@ -76,6 +77,8 @@ class USER_MANAGER_EXPORT UserImage {
// If image was loaded from the local file, file path is stored here.
base::FilePath file_path_;
bool is_safe_format_;
+
+ DISALLOW_COPY_AND_ASSIGN(UserImage);
};
} // namespace user_manager
« no previous file with comments | « components/user_manager/user.cc ('k') | components/user_manager/user_image/user_image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698