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

Unified Diff: components/display_compositor/child/child_shared_bitmap_manager.h

Issue 2717213004: Move SharedBitmapManager implementation out of content/ (Closed)
Patch Set: rebase Created 3 years, 10 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
Index: components/display_compositor/child/child_shared_bitmap_manager.h
diff --git a/content/child/child_shared_bitmap_manager.h b/components/display_compositor/child/child_shared_bitmap_manager.h
similarity index 62%
rename from content/child/child_shared_bitmap_manager.h
rename to components/display_compositor/child/child_shared_bitmap_manager.h
index b63d3e50a11493b73aaa3455a5a1afefbb224aaa..22f39d261064753b7a67ae7ee32256e0578616f9 100644
--- a/content/child/child_shared_bitmap_manager.h
+++ b/components/display_compositor/child/child_shared_bitmap_manager.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_CHILD_CHILD_SHARED_BITMAP_MANAGER_H_
-#define CONTENT_CHILD_CHILD_SHARED_BITMAP_MANAGER_H_
+#ifndef COMPONENTS_DISPLAY_COMPOSITOR_CHILD_CHILD_SHARED_BITMAP_MANAGER_H_
+#define COMPONENTS_DISPLAY_COMPOSITOR_CHILD_CHILD_SHARED_BITMAP_MANAGER_H_
#include <stdint.h>
@@ -13,10 +13,11 @@
#include "base/memory/ref_counted.h"
#include "base/memory/shared_memory.h"
#include "cc/resources/shared_bitmap_manager.h"
-#include "content/common/render_message_filter.mojom.h"
+#include "components/display_compositor/display_compositor_export.h"
+#include "components/display_compositor/interfaces/shared_bitmap_manager.mojom.h"
#include "mojo/public/cpp/bindings/thread_safe_interface_ptr.h"
-namespace content {
+namespace display_compositor {
class SharedMemoryBitmap : public cc::SharedBitmap {
public:
@@ -30,13 +31,19 @@ class SharedMemoryBitmap : public cc::SharedBitmap {
base::SharedMemory* shared_memory_;
};
-class ChildSharedBitmapManager : public cc::SharedBitmapManager {
+class DISPLAY_COMPOSITOR_EXPORT ChildSharedBitmapManager
+ : public cc::SharedBitmapManager {
public:
explicit ChildSharedBitmapManager(
- const scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr>&
+ const scoped_refptr<mojom::ThreadSafeSharedBitmapManagerAssociatedPtr>&
render_message_filter_ptr);
~ChildSharedBitmapManager() override;
+ // Allocates a block of shared memory of the given size. Returns nullptr on
+ // failure.
+ static std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
+ size_t buf_size);
+
// cc::SharedBitmapManager implementation.
std::unique_ptr<cc::SharedBitmap> AllocateSharedBitmap(
const gfx::Size& size) override;
@@ -51,12 +58,12 @@ class ChildSharedBitmapManager : public cc::SharedBitmapManager {
void NotifyAllocatedSharedBitmap(base::SharedMemory* memory,
const cc::SharedBitmapId& id);
- scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr>
- render_message_filter_ptr_;
+ scoped_refptr<mojom::ThreadSafeSharedBitmapManagerAssociatedPtr>
+ shared_bitmap_manager_ptr_;
DISALLOW_COPY_AND_ASSIGN(ChildSharedBitmapManager);
};
-} // namespace content
+} // namespace display_compositor
-#endif // CONTENT_CHILD_CHILD_SHARED_BITMAP_MANAGER_H_
+#endif // COMPONENTS_DISPLAY_COMPOSITOR_CHILD_CHILD_SHARED_BITMAP_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698