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

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

Issue 1096983002: Update usages of std::map to use ScopedPtrMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@passwordmanager-scopedmemory
Patch Set: Rebase. Created 5 years, 6 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 | « ui/gfx/image/image.h ('k') | ui/message_center/message_center_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image.cc
diff --git a/ui/gfx/image/image.cc b/ui/gfx/image/image.cc
index a3acc5420158374406db8b4b9b712bbd7b9f1f02..d9e51e87b3cebc044563b694c7847e9d3e2f6c73 100644
--- a/ui/gfx/image/image.cc
+++ b/ui/gfx/image/image.cc
@@ -8,7 +8,6 @@
#include <set>
#include "base/logging.h"
-#include "base/stl_util.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image_png_rep.h"
@@ -340,12 +339,13 @@ class ImageRepCocoa : public ImageRep {
class ImageStorage : public base::RefCounted<ImageStorage> {
public:
ImageStorage(Image::RepresentationType default_type)
- : default_representation_type_(default_type),
+ : default_representation_type_(default_type)
#if defined(OS_MACOSX) && !defined(OS_IOS)
+ ,
default_representation_color_space_(
- base::mac::GetGenericRGBColorSpace()),
+ base::mac::GetGenericRGBColorSpace())
#endif // defined(OS_MACOSX) && !defined(OS_IOS)
- representations_deleter_(&representations_) {
+ {
}
Image::RepresentationType default_representation_type() {
@@ -383,8 +383,6 @@ class ImageStorage : public base::RefCounted<ImageStorage> {
// more for any converted representations.
Image::RepresentationMap representations_;
- STLValueDeleter<Image::RepresentationMap> representations_deleter_;
-
DISALLOW_COPY_AND_ASSIGN(ImageStorage);
};
@@ -739,7 +737,8 @@ Image::RepresentationType Image::DefaultRepresentationType() const {
internal::ImageRep* Image::GetRepresentation(
RepresentationType rep_type, bool must_exist) const {
CHECK(storage_.get());
- RepresentationMap::iterator it = storage_->representations().find(rep_type);
+ RepresentationMap::const_iterator it =
+ storage_->representations().find(rep_type);
if (it == storage_->representations().end()) {
CHECK(!must_exist);
return NULL;
@@ -750,7 +749,7 @@ internal::ImageRep* Image::GetRepresentation(
void Image::AddRepresentation(scoped_ptr<internal::ImageRep> rep) const {
CHECK(storage_.get());
RepresentationType type = rep->type();
- storage_->representations().insert(std::make_pair(type, rep.release()));
+ storage_->representations().insert(type, rep.Pass());
}
} // namespace gfx
« no previous file with comments | « ui/gfx/image/image.h ('k') | ui/message_center/message_center_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698