| Index: ui/gfx/image/image_skia.cc
|
| diff --git a/ui/gfx/image/image_skia.cc b/ui/gfx/image/image_skia.cc
|
| index 6c73b02ef8cfa915188fefe386026a09344ed2c0..a886ab02d35b732c026e04eb5279e99475de8d33 100644
|
| --- a/ui/gfx/image/image_skia.cc
|
| +++ b/ui/gfx/image/image_skia.cc
|
| @@ -223,23 +223,23 @@ ImageSkia& ImageSkia::operator=(const ImageSkia& other) {
|
| ImageSkia::~ImageSkia() {
|
| }
|
|
|
| -ImageSkia ImageSkia::DeepCopy() const {
|
| - ImageSkia copy;
|
| +scoped_ptr<ImageSkia> ImageSkia::DeepCopy() const {
|
| + ImageSkia* copy = new ImageSkia;
|
| if (isNull())
|
| - return copy;
|
| + return scoped_ptr<ImageSkia>(copy);
|
|
|
| CHECK(CanRead());
|
|
|
| std::vector<gfx::ImageSkiaRep>& reps = storage_->image_reps();
|
| for (std::vector<gfx::ImageSkiaRep>::iterator iter = reps.begin();
|
| iter != reps.end(); ++iter) {
|
| - copy.AddRepresentation(*iter);
|
| + copy->AddRepresentation(*iter);
|
| }
|
| // The copy has its own storage. Detach the copy from the current
|
| // thread so that other thread can use this.
|
| - if (!copy.isNull())
|
| - copy.storage_->DetachFromThread();
|
| - return copy;
|
| + if (!copy->isNull())
|
| + copy->storage_->DetachFromThread();
|
| + return scoped_ptr<ImageSkia>(copy);
|
| }
|
|
|
| bool ImageSkia::BackedBySameObjectAs(const gfx::ImageSkia& other) const {
|
|
|