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

Unified Diff: content/common/host_shared_bitmap_manager.h

Issue 955523005: Add HostSharedBitmapManagerClient to organize bitmaps coming from renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: content/common/host_shared_bitmap_manager.h
diff --git a/content/common/host_shared_bitmap_manager.h b/content/common/host_shared_bitmap_manager.h
index 423023abc28f702146fde7d773adb7c8f9204777..ce95f76bb076bfb694f1e7f309a14e0ba40c057b 100644
--- a/content/common/host_shared_bitmap_manager.h
+++ b/content/common/host_shared_bitmap_manager.h
@@ -29,6 +29,31 @@ struct hash<cc::SharedBitmapId> {
namespace content {
class BitmapData;
+class HostSharedBitmapManager;
+
+class CONTENT_EXPORT HostSharedBitmapManagerClient {
+ public:
+ explicit HostSharedBitmapManagerClient(HostSharedBitmapManager* manager);
+
+ ~HostSharedBitmapManagerClient();
+
+ void AllocateSharedBitmapForChild(
+ base::ProcessHandle process_handle,
+ size_t buffer_size,
+ const cc::SharedBitmapId& id,
+ base::SharedMemoryHandle* shared_memory_handle);
+ void ChildAllocatedSharedBitmap(size_t buffer_size,
+ const base::SharedMemoryHandle& handle,
+ base::ProcessHandle process_handle,
+ const cc::SharedBitmapId& id);
+ void ChildDeletedSharedBitmap(const cc::SharedBitmapId& id);
+
+ private:
+ HostSharedBitmapManager* manager_;
+ base::hash_set<cc::SharedBitmapId> owned_bitmaps_;
+
+ DISALLOW_COPY_AND_ASSIGN(HostSharedBitmapManagerClient);
+};
class CONTENT_EXPORT HostSharedBitmapManager : public cc::SharedBitmapManager {
public:
@@ -44,6 +69,13 @@ class CONTENT_EXPORT HostSharedBitmapManager : public cc::SharedBitmapManager {
const gfx::Size& size,
const cc::SharedBitmapId&) override;
+ size_t AllocatedBitmapCount() const;
+
+ void FreeSharedMemoryFromMap(const cc::SharedBitmapId& id);
+
+ private:
+ friend class HostSharedBitmapManagerClient;
+
void AllocateSharedBitmapForChild(
base::ProcessHandle process_handle,
size_t buffer_size,
@@ -54,22 +86,14 @@ class CONTENT_EXPORT HostSharedBitmapManager : public cc::SharedBitmapManager {
base::ProcessHandle process_handle,
const cc::SharedBitmapId& id);
void ChildDeletedSharedBitmap(const cc::SharedBitmapId& id);
- void ProcessRemoved(base::ProcessHandle process_handle);
-
- size_t AllocatedBitmapCount() const;
- void FreeSharedMemoryFromMap(const cc::SharedBitmapId& id);
-
- private:
mutable base::Lock lock_;
typedef base::hash_map<cc::SharedBitmapId, scoped_refptr<BitmapData> >
BitmapMap;
BitmapMap handle_map_;
- typedef base::hash_map<base::ProcessHandle,
- base::hash_set<cc::SharedBitmapId> > ProcessMap;
- ProcessMap process_map_;
+ DISALLOW_COPY_AND_ASSIGN(HostSharedBitmapManager);
};
} // namespace content
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura_unittest.cc ('k') | content/common/host_shared_bitmap_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698