Commit 659c2575 authored by limasdf's avatar limasdf Committed by Commit bot

ScopedPtrMap -> std::map from /ui/gfx/image

C++ 11 enables containers that contain move-only type, scoped_ptr.
So, Use std::map<key, scoped_ptr<Foo>> instead of ScopedPtrMap.

also use std::move() instead of scoped_ptr::Pass().

BUG=554291, 557422

Review URL: https://codereview.chromium.org/1456703004

Cr-Commit-Position: refs/heads/master@{#360461}
parent 872e59f9
......@@ -743,13 +743,13 @@ internal::ImageRep* Image::GetRepresentation(
CHECK(!must_exist);
return NULL;
}
return it->second;
return it->second.get();
}
void Image::AddRepresentation(scoped_ptr<internal::ImageRep> rep) const {
CHECK(storage_.get());
RepresentationType type = rep->type();
storage_->representations().insert(type, rep.Pass());
storage_->representations().insert(std::make_pair(type, std::move(rep)));
}
} // namespace gfx
......@@ -19,10 +19,10 @@
#ifndef UI_GFX_IMAGE_IMAGE_H_
#define UI_GFX_IMAGE_IMAGE_H_
#include <map>
#include <vector>
#include "base/basictypes.h"
#include "base/containers/scoped_ptr_map.h"
#include "base/memory/ref_counted_memory.h"
#include "base/memory/scoped_ptr.h"
#include "ui/gfx/gfx_export.h"
......@@ -53,8 +53,8 @@ class GFX_EXPORT Image {
kImageRepPNG,
};
typedef base::ScopedPtrMap<RepresentationType, scoped_ptr<internal::ImageRep>>
RepresentationMap;
using RepresentationMap =
std::map<RepresentationType, scoped_ptr<internal::ImageRep>>;
// Creates an empty image with no representations.
Image();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment