| 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 933dcd25db4d8d3ce68b201c249863b7d5e93d8f..7e14b2f2fb4493af2d6f1b916c882d69a64e5e80 100644
|
| --- a/cc/test/test_shared_bitmap_manager.cc
|
| +++ b/cc/test/test_shared_bitmap_manager.cc
|
| @@ -18,26 +18,10 @@ class OwnedSharedBitmap : public SharedBitmap {
|
|
|
| ~OwnedSharedBitmap() override {}
|
|
|
| - base::SharedMemory* memory() override { return shared_memory_.get(); }
|
| -
|
| private:
|
| scoped_ptr<base::SharedMemory> shared_memory_;
|
| };
|
|
|
| -class UnownedSharedBitmap : public SharedBitmap {
|
| - public:
|
| - UnownedSharedBitmap(base::SharedMemory* shared_memory,
|
| - const SharedBitmapId& id)
|
| - : SharedBitmap(static_cast<uint8*>(shared_memory->memory()), id),
|
| - shared_memory_(shared_memory) {}
|
| -
|
| - ~UnownedSharedBitmap() override {}
|
| -
|
| - base::SharedMemory* memory() override { return shared_memory_; }
|
| -
|
| - private:
|
| - base::SharedMemory* shared_memory_;
|
| -};
|
| } // namespace
|
|
|
| TestSharedBitmapManager::TestSharedBitmapManager() {}
|
| @@ -60,15 +44,8 @@ scoped_ptr<SharedBitmap> TestSharedBitmapManager::GetSharedBitmapFromId(
|
| base::AutoLock lock(lock_);
|
| if (bitmap_map_.find(id) == bitmap_map_.end())
|
| return nullptr;
|
| - return make_scoped_ptr(new UnownedSharedBitmap(bitmap_map_[id], id));
|
| -}
|
| -
|
| -scoped_ptr<SharedBitmap> TestSharedBitmapManager::GetBitmapForSharedMemory(
|
| - base::SharedMemory* memory) {
|
| - base::AutoLock lock(lock_);
|
| - SharedBitmapId id = SharedBitmap::GenerateId();
|
| - bitmap_map_[id] = memory;
|
| - return make_scoped_ptr(new UnownedSharedBitmap(memory, id));
|
| + uint8* pixels = static_cast<uint8*>(bitmap_map_[id]->memory());
|
| + return make_scoped_ptr(new SharedBitmap(pixels, id));
|
| }
|
|
|
| } // namespace cc
|
|
|