Chromium Code Reviews| Index: components/display_compositor/host_shared_bitmap_manager_unittest.cc |
| diff --git a/components/display_compositor/host_shared_bitmap_manager_unittest.cc b/components/display_compositor/host_shared_bitmap_manager_unittest.cc |
| index dd6bbe9960b09681d0f48efdb8314ab6b590516a..a4284822d776f631901d464138062b082570f907 100644 |
| --- a/components/display_compositor/host_shared_bitmap_manager_unittest.cc |
| +++ b/components/display_compositor/host_shared_bitmap_manager_unittest.cc |
| @@ -27,8 +27,7 @@ TEST_F(HostSharedBitmapManagerTest, TestCreate) { |
| cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); |
| HostSharedBitmapManagerClient client(manager_.get()); |
| - base::SharedMemoryHandle handle; |
| - bitmap->ShareToProcess(base::GetCurrentProcessHandle(), &handle); |
| + base::SharedMemoryHandle handle = bitmap->handle().Duplicate(); |
| client.ChildAllocatedSharedBitmap(size_in_bytes, handle, id); |
|
Nico
2017/05/02 20:08:00
I did check that this does assume ownership.
|
| std::unique_ptr<cc::SharedBitmap> large_bitmap; |
| @@ -85,10 +84,9 @@ TEST_F(HostSharedBitmapManagerTest, RemoveProcess) { |
| memset(bitmap->memory(), 0xff, size_in_bytes); |
| cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); |
| - base::SharedMemoryHandle handle; |
| std::unique_ptr<HostSharedBitmapManagerClient> client( |
| new HostSharedBitmapManagerClient(manager_.get())); |
| - bitmap->ShareToProcess(base::GetCurrentProcessHandle(), &handle); |
| + base::SharedMemoryHandle handle = bitmap->handle().Duplicate(); |
| client->ChildAllocatedSharedBitmap(size_in_bytes, handle, id); |
| std::unique_ptr<cc::SharedBitmap> shared_bitmap; |
| @@ -118,8 +116,7 @@ TEST_F(HostSharedBitmapManagerTest, AddDuplicate) { |
| cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); |
| HostSharedBitmapManagerClient client(manager_.get()); |
| - base::SharedMemoryHandle handle; |
| - bitmap->ShareToProcess(base::GetCurrentProcessHandle(), &handle); |
| + base::SharedMemoryHandle handle = bitmap->handle().Duplicate(); |
| client.ChildAllocatedSharedBitmap(size_in_bytes, handle, id); |
| std::unique_ptr<base::SharedMemory> bitmap2(new base::SharedMemory()); |