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

Side by Side Diff: ui/gfx/image/image.h

Issue 1773433002: Fix use-after-free in gfx::Image. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/gfx/image/image.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // An Image wraps an image any flavor, be it platform-native GdkBitmap/NSImage, 5 // An Image wraps an image any flavor, be it platform-native GdkBitmap/NSImage,
6 // or a SkBitmap. This also provides easy conversion to other image types 6 // or a SkBitmap. This also provides easy conversion to other image types
7 // through operator overloading. It will cache the converted representations 7 // through operator overloading. It will cache the converted representations
8 // internally to prevent double-conversion. 8 // internally to prevent double-conversion.
9 // 9 //
10 // The lifetime of both the initial representation and any converted ones are 10 // The lifetime of both the initial representation and any converted ones are
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 private: 177 private:
178 // Returns the type of the default representation. 178 // Returns the type of the default representation.
179 RepresentationType DefaultRepresentationType() const; 179 RepresentationType DefaultRepresentationType() const;
180 180
181 // Returns the ImageRep of the appropriate type or NULL if there is no 181 // Returns the ImageRep of the appropriate type or NULL if there is no
182 // representation of that type (and must_exist is false). 182 // representation of that type (and must_exist is false).
183 internal::ImageRep* GetRepresentation( 183 internal::ImageRep* GetRepresentation(
184 RepresentationType rep_type, bool must_exist) const; 184 RepresentationType rep_type, bool must_exist) const;
185 185
186 // Stores a representation into the map. 186 // Stores a representation into the map. A representation of that type must
187 // not already be in the map.
187 void AddRepresentation(scoped_ptr<internal::ImageRep> rep) const; 188 void AddRepresentation(scoped_ptr<internal::ImageRep> rep) const;
188 189
189 // Internal class that holds all the representations. This allows the Image to 190 // Internal class that holds all the representations. This allows the Image to
190 // be cheaply copied. 191 // be cheaply copied.
191 scoped_refptr<internal::ImageStorage> storage_; 192 scoped_refptr<internal::ImageStorage> storage_;
192 }; 193 };
193 194
194 } // namespace gfx 195 } // namespace gfx
195 196
196 #endif // UI_GFX_IMAGE_IMAGE_H_ 197 #endif // UI_GFX_IMAGE_IMAGE_H_
OLDNEW
« 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