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

Unified Diff: cc/resources/shared_bitmap.h

Issue 2535213002: [WIP] Add SharedMemoryTracker to dump base::SharedMemory usage
Patch Set: Implement buckets Created 3 years, 11 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: cc/resources/shared_bitmap.h
diff --git a/cc/resources/shared_bitmap.h b/cc/resources/shared_bitmap.h
index c711a8b5ea47d470abc5f42eabe4d119b64ecae8..bd744189fb3904108724650a348412b0df53969b 100644
--- a/cc/resources/shared_bitmap.h
+++ b/cc/resources/shared_bitmap.h
@@ -14,6 +14,12 @@
#include "gpu/command_buffer/common/mailbox.h"
#include "ui/gfx/geometry/size.h"
+namespace base {
+
+class SharedMemory;
+
+} // namespace base
+
namespace cc {
typedef gpu::Mailbox SharedBitmapId;
@@ -22,12 +28,16 @@ GetSharedBitmapGUIDForTracing(const SharedBitmapId& bitmap_id);
class CC_EXPORT SharedBitmap {
public:
- SharedBitmap(uint8_t* pixels, const SharedBitmapId& id);
+ SharedBitmap(uint8_t* pixels,
+ base::SharedMemory* shared_memory,
+ const SharedBitmapId& id);
virtual ~SharedBitmap();
uint8_t* pixels() { return pixels_; }
+ base::SharedMemory* shared_memory() const { return shared_memory_; }
+
const SharedBitmapId& id() { return id_; }
// Returns true if the size is valid and false otherwise.
@@ -45,6 +55,7 @@ class CC_EXPORT SharedBitmap {
private:
uint8_t* pixels_;
+ base::SharedMemory* shared_memory_;
SharedBitmapId id_;
DISALLOW_COPY_AND_ASSIGN(SharedBitmap);

Powered by Google App Engine
This is Rietveld 408576698