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

Unified Diff: ui/gfx/image/image.h

Issue 240293006: gfx::Image is now thread-safe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « no previous file | ui/gfx/image/image.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image.h
diff --git a/ui/gfx/image/image.h b/ui/gfx/image/image.h
index 6f0e9266e7b8a017f94ccda3e4e94fdc12960ec4..e3ee6091f9d685a43c23609cd81a28b5dfcb3254 100644
--- a/ui/gfx/image/image.h
+++ b/ui/gfx/image/image.h
@@ -49,6 +49,12 @@ class ImageRep;
class ImageStorage;
}
+// An image, backed by zero or more equivalent representations. When a specific
Robert Sesek 2014/04/17 16:56:58 The comment for this class is at the top of the fi
+// representation is requested, the image data is converted to the desired
+// representation and cached, if it is not already.
+//
+// Image objects are copyable and thread safe. However, there are no thread
+// safety guarantees about the individual representations.
class GFX_EXPORT Image {
public:
enum RepresentationType {
@@ -60,8 +66,6 @@ class GFX_EXPORT Image {
kImageRepPNG,
};
- typedef std::map<RepresentationType, internal::ImageRep*> RepresentationMap;
-
// Creates an empty image with no representations.
Image();
@@ -188,6 +192,10 @@ class GFX_EXPORT Image {
RepresentationType rep_type, bool must_exist) const;
// Stores a representation into the map.
+ // NOTE: This is const, despite modifying the object's internal storage. It
+ // should only be used to add representations that are equivalent to an
+ // existing representation (i.e., it should not affect the externally visible
+ // state of the object).
void AddRepresentation(internal::ImageRep* rep) const;
// Internal class that holds all the representations. This allows the Image to
« no previous file with comments | « no previous file | ui/gfx/image/image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698