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

Unified Diff: content/child/child_shared_bitmap_manager.h

Issue 2488913003: Replacing allocate bitmap IPC messages with a new Mojo interface. (Closed)
Patch Set: Clean-up Created 4 years, 1 month 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
Index: content/child/child_shared_bitmap_manager.h
diff --git a/content/child/child_shared_bitmap_manager.h b/content/child/child_shared_bitmap_manager.h
index feb065bb92a433fb64f549e3c5fd10d27e3ba37e..65bbeb9511f76190c154f808808bc4166b72771e 100644
--- a/content/child/child_shared_bitmap_manager.h
+++ b/content/child/child_shared_bitmap_manager.h
@@ -14,6 +14,7 @@
#include "base/memory/shared_memory.h"
#include "cc/resources/shared_bitmap_manager.h"
#include "content/child/thread_safe_sender.h"
+#include "content/common/shared_memory_allocator.mojom.h"
namespace content {
@@ -31,7 +32,9 @@ class SharedMemoryBitmap : public cc::SharedBitmap {
class ChildSharedBitmapManager : public cc::SharedBitmapManager {
public:
- ChildSharedBitmapManager(scoped_refptr<ThreadSafeSender> sender);
+ ChildSharedBitmapManager(
+ scoped_refptr<ThreadSafeSender> sender,
+ mojom::SharedMemoryAllocatorPtr shared_memory_allocator);
~ChildSharedBitmapManager() override;
// cc::SharedBitmapManager implementation.
@@ -46,9 +49,22 @@ class ChildSharedBitmapManager : public cc::SharedBitmapManager {
std::unique_ptr<SharedMemoryBitmap> AllocateSharedMemoryBitmap(
const gfx::Size& size);
+ void OnBitmapDeleted(const cc::SharedBitmapId& id);
+
private:
+ void FinishInitialization();
+
+ void NotifyAllocatedSharedBitmap(
+ base::SharedMemory* memory,
+ const cc::SharedBitmapId& id);
+
scoped_refptr<ThreadSafeSender> sender_;
+ mojom::SharedMemoryAllocatorPtrInfo shared_memory_allocator_ptr_info_;
+ mojom::SharedMemoryAllocatorPtr shared_memory_allocator_;
+
+ base::WeakPtrFactory<ChildSharedBitmapManager> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ChildSharedBitmapManager);
};

Powered by Google App Engine
This is Rietveld 408576698