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

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

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 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 | « ui/gfx/image/image_skia.h ('k') | ui/gfx/image/image_skia_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_skia.cc
diff --git a/ui/gfx/image/image_skia.cc b/ui/gfx/image/image_skia.cc
index 8a1a2c99555c6f46bae55fd1a3ef3e0d5c9d4053..d91b782fa1f1df177e7ee18ab272f73dd2728ae9 100644
--- a/ui/gfx/image/image_skia.cc
+++ b/ui/gfx/image/image_skia.cc
@@ -9,10 +9,11 @@
#include <algorithm>
#include <cmath>
#include <limits>
+#include <memory>
#include "base/command_line.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ptr_util.h"
#include "base/threading/non_thread_safe.h"
#include "build/build_config.h"
#include "ui/gfx/geometry/rect.h"
@@ -121,7 +122,7 @@ class ImageSkiaStorage : public base::RefCountedThreadSafe<ImageSkiaStorage>,
// Vector of bitmaps and their associated scale.
std::vector<gfx::ImageSkiaRep> image_reps_;
- scoped_ptr<ImageSkiaSource> source_;
+ std::unique_ptr<ImageSkiaSource> source_;
// Size of the image in DIP.
gfx::Size size_;
@@ -334,10 +335,10 @@ ImageSkia ImageSkia::CreateFrom1xBitmap(const SkBitmap& bitmap) {
return ImageSkia(ImageSkiaRep(bitmap, 0.0f));
}
-scoped_ptr<ImageSkia> ImageSkia::DeepCopy() const {
+std::unique_ptr<ImageSkia> ImageSkia::DeepCopy() const {
ImageSkia* copy = new ImageSkia;
if (isNull())
- return make_scoped_ptr(copy);
+ return base::WrapUnique(copy);
CHECK(CanRead());
@@ -350,7 +351,7 @@ scoped_ptr<ImageSkia> ImageSkia::DeepCopy() const {
// thread so that other thread can use this.
if (!copy->isNull())
copy->storage_->DetachFromThread();
- return make_scoped_ptr(copy);
+ return base::WrapUnique(copy);
}
bool ImageSkia::BackedBySameObjectAs(const gfx::ImageSkia& other) const {
« no previous file with comments | « ui/gfx/image/image_skia.h ('k') | ui/gfx/image/image_skia_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698