Commit 27e8203c authored by jbauman's avatar jbauman Committed by Commit bot

Remove GetBitmapForSharedMemory from cc::SharedBitmapManager

This is only used in specific circumstances in the renderer, so move it to ChildSharedBitmapManager.

Review URL: https://codereview.chromium.org/795843002

Cr-Commit-Position: refs/heads/master@{#308014}
parent c72103b1
...@@ -21,8 +21,6 @@ class CC_EXPORT SharedBitmapManager { ...@@ -21,8 +21,6 @@ class CC_EXPORT SharedBitmapManager {
virtual scoped_ptr<SharedBitmap> GetSharedBitmapFromId( virtual scoped_ptr<SharedBitmap> GetSharedBitmapFromId(
const gfx::Size&, const gfx::Size&,
const SharedBitmapId&) = 0; const SharedBitmapId&) = 0;
virtual scoped_ptr<SharedBitmap> GetBitmapForSharedMemory(
base::SharedMemory*) = 0;
private: private:
DISALLOW_COPY_AND_ASSIGN(SharedBitmapManager); DISALLOW_COPY_AND_ASSIGN(SharedBitmapManager);
......
...@@ -63,12 +63,4 @@ scoped_ptr<SharedBitmap> TestSharedBitmapManager::GetSharedBitmapFromId( ...@@ -63,12 +63,4 @@ scoped_ptr<SharedBitmap> TestSharedBitmapManager::GetSharedBitmapFromId(
return make_scoped_ptr(new UnownedSharedBitmap(bitmap_map_[id], id)); 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));
}
} // namespace cc } // namespace cc
...@@ -23,9 +23,6 @@ class TestSharedBitmapManager : public SharedBitmapManager { ...@@ -23,9 +23,6 @@ class TestSharedBitmapManager : public SharedBitmapManager {
const gfx::Size&, const gfx::Size&,
const SharedBitmapId& id) override; const SharedBitmapId& id) override;
scoped_ptr<SharedBitmap> GetBitmapForSharedMemory(
base::SharedMemory* memory) override;
private: private:
base::Lock lock_; base::Lock lock_;
std::map<SharedBitmapId, base::SharedMemory*> bitmap_map_; std::map<SharedBitmapId, base::SharedMemory*> bitmap_map_;
......
...@@ -18,13 +18,15 @@ class ChildSharedBitmapManager : public cc::SharedBitmapManager { ...@@ -18,13 +18,15 @@ class ChildSharedBitmapManager : public cc::SharedBitmapManager {
ChildSharedBitmapManager(scoped_refptr<ThreadSafeSender> sender); ChildSharedBitmapManager(scoped_refptr<ThreadSafeSender> sender);
~ChildSharedBitmapManager() override; ~ChildSharedBitmapManager() override;
// cc::SharedBitmapManager implementation.
scoped_ptr<cc::SharedBitmap> AllocateSharedBitmap( scoped_ptr<cc::SharedBitmap> AllocateSharedBitmap(
const gfx::Size& size) override; const gfx::Size& size) override;
scoped_ptr<cc::SharedBitmap> GetSharedBitmapFromId( scoped_ptr<cc::SharedBitmap> GetSharedBitmapFromId(
const gfx::Size&, const gfx::Size&,
const cc::SharedBitmapId&) override; const cc::SharedBitmapId&) override;
scoped_ptr<cc::SharedBitmap> GetBitmapForSharedMemory( scoped_ptr<cc::SharedBitmap> GetBitmapForSharedMemory(
base::SharedMemory* mem) override; base::SharedMemory* mem);
private: private:
scoped_refptr<ThreadSafeSender> sender_; scoped_refptr<ThreadSafeSender> sender_;
......
...@@ -113,11 +113,6 @@ scoped_ptr<cc::SharedBitmap> HostSharedBitmapManager::GetSharedBitmapFromId( ...@@ -113,11 +113,6 @@ scoped_ptr<cc::SharedBitmap> HostSharedBitmapManager::GetSharedBitmapFromId(
static_cast<uint8*>(data->memory->memory()), data, id, nullptr)); static_cast<uint8*>(data->memory->memory()), data, id, nullptr));
} }
scoped_ptr<cc::SharedBitmap> HostSharedBitmapManager::GetBitmapForSharedMemory(
base::SharedMemory*) {
return scoped_ptr<cc::SharedBitmap>();
}
void HostSharedBitmapManager::ChildAllocatedSharedBitmap( void HostSharedBitmapManager::ChildAllocatedSharedBitmap(
size_t buffer_size, size_t buffer_size,
const base::SharedMemoryHandle& handle, const base::SharedMemoryHandle& handle,
......
...@@ -43,8 +43,6 @@ class CONTENT_EXPORT HostSharedBitmapManager : public cc::SharedBitmapManager { ...@@ -43,8 +43,6 @@ class CONTENT_EXPORT HostSharedBitmapManager : public cc::SharedBitmapManager {
scoped_ptr<cc::SharedBitmap> GetSharedBitmapFromId( scoped_ptr<cc::SharedBitmap> GetSharedBitmapFromId(
const gfx::Size& size, const gfx::Size& size,
const cc::SharedBitmapId&) override; const cc::SharedBitmapId&) override;
scoped_ptr<cc::SharedBitmap> GetBitmapForSharedMemory(
base::SharedMemory*) override;
void AllocateSharedBitmapForChild( void AllocateSharedBitmapForChild(
base::ProcessHandle process_handle, base::ProcessHandle process_handle,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment