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

Unified Diff: chrome/browser/chromeos/login/user_image.h

Issue 10830111: [cros] Encode user images when set from WebUI (regression fix). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/login/user_image.h
diff --git a/chrome/browser/chromeos/login/user_image.h b/chrome/browser/chromeos/login/user_image.h
index 0afb26649330be96cc24b67cc66df17aeb05f691..5611c4e3967d825fe248b0cf826dcf0567bafa17 100644
--- a/chrome/browser/chromeos/login/user_image.h
+++ b/chrome/browser/chromeos/login/user_image.h
@@ -20,10 +20,14 @@ class UserImage {
// TODO(ivankr): replace with RefCountedMemory to prevent copying.
typedef std::vector<unsigned char> RawImage;
+ // Creates a new instance from a given still frame and tries to encode raw
+ // representation for it.
+ static UserImage CreateAndEncode(const gfx::ImageSkia& image);
Nikita (slow) 2012/08/01 03:56:18 const UserImage&
+
// Create instance with an empty still frame and no raw data.
UserImage();
- // Creates a new instance from a given still frame without any raw data.
+ // creates a new instance from a given still frame without any raw data.
Nikita (slow) 2012/08/01 03:56:18 nit: capitalize
Ivan Korotkov 2012/08/01 21:51:28 Done.
explicit UserImage(const gfx::ImageSkia& image);
// Creates a new instance from a given still frame and raw representation.
@@ -40,6 +44,9 @@ class UserImage {
bool has_raw_image() const { return has_raw_image_; }
const RawImage& raw_image() const { return raw_image_; }
+ // Discards the stored raw image, freeing used memory.
+ void DiscardRawImage();
+
// Optional raw representation of the animated image.
bool has_animated_image() const { return has_animated_image_; }
const RawImage& animated_image() const { return animated_image_; }

Powered by Google App Engine
This is Rietveld 408576698