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

Unified Diff: cc/test/test_shared_bitmap_manager.cc

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase 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 | « cc/test/test_shared_bitmap_manager.h ('k') | cc/test/test_texture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_shared_bitmap_manager.cc
diff --git a/cc/test/test_shared_bitmap_manager.cc b/cc/test/test_shared_bitmap_manager.cc
index 589a782382ac4bfd48eb6aea5d51f774d6c17f75..922c2f34adf323317763958712e01a3be1defa97 100644
--- a/cc/test/test_shared_bitmap_manager.cc
+++ b/cc/test/test_shared_bitmap_manager.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include "base/memory/ptr_util.h"
#include "base/memory/shared_memory.h"
namespace cc {
@@ -13,7 +14,7 @@ namespace cc {
namespace {
class OwnedSharedBitmap : public SharedBitmap {
public:
- OwnedSharedBitmap(scoped_ptr<base::SharedMemory> shared_memory,
+ OwnedSharedBitmap(std::unique_ptr<base::SharedMemory> shared_memory,
const SharedBitmapId& id)
: SharedBitmap(static_cast<uint8_t*>(shared_memory->memory()), id),
shared_memory_(std::move(shared_memory)) {}
@@ -21,7 +22,7 @@ class OwnedSharedBitmap : public SharedBitmap {
~OwnedSharedBitmap() override {}
private:
- scoped_ptr<base::SharedMemory> shared_memory_;
+ std::unique_ptr<base::SharedMemory> shared_memory_;
};
} // namespace
@@ -30,24 +31,24 @@ TestSharedBitmapManager::TestSharedBitmapManager() {}
TestSharedBitmapManager::~TestSharedBitmapManager() {}
-scoped_ptr<SharedBitmap> TestSharedBitmapManager::AllocateSharedBitmap(
+std::unique_ptr<SharedBitmap> TestSharedBitmapManager::AllocateSharedBitmap(
const gfx::Size& size) {
base::AutoLock lock(lock_);
- scoped_ptr<base::SharedMemory> memory(new base::SharedMemory);
+ std::unique_ptr<base::SharedMemory> memory(new base::SharedMemory);
memory->CreateAndMapAnonymous(size.GetArea() * 4);
SharedBitmapId id = SharedBitmap::GenerateId();
bitmap_map_[id] = memory.get();
- return make_scoped_ptr(new OwnedSharedBitmap(std::move(memory), id));
+ return base::WrapUnique(new OwnedSharedBitmap(std::move(memory), id));
}
-scoped_ptr<SharedBitmap> TestSharedBitmapManager::GetSharedBitmapFromId(
+std::unique_ptr<SharedBitmap> TestSharedBitmapManager::GetSharedBitmapFromId(
const gfx::Size&,
const SharedBitmapId& id) {
base::AutoLock lock(lock_);
if (bitmap_map_.find(id) == bitmap_map_.end())
return nullptr;
uint8_t* pixels = static_cast<uint8_t*>(bitmap_map_[id]->memory());
- return make_scoped_ptr(new SharedBitmap(pixels, id));
+ return base::WrapUnique(new SharedBitmap(pixels, id));
}
} // namespace cc
« no previous file with comments | « cc/test/test_shared_bitmap_manager.h ('k') | cc/test/test_texture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698