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

Unified Diff: cc/test/test_shared_bitmap_manager.cc

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/test/test_shared_bitmap_manager.cc
diff --git a/cc/test/test_shared_bitmap_manager.cc b/cc/test/test_shared_bitmap_manager.cc
index 604f669af5bbb643ef9aa3a94cf17182e62eed36..479beb625ec684065ac4d4fdd1d8539a024d6695 100644
--- a/cc/test/test_shared_bitmap_manager.cc
+++ b/cc/test/test_shared_bitmap_manager.cc
@@ -16,7 +16,9 @@ class OwnedSharedBitmap : public SharedBitmap {
public:
OwnedSharedBitmap(std::unique_ptr<base::SharedMemory> shared_memory,
const SharedBitmapId& id)
- : SharedBitmap(static_cast<uint8_t*>(shared_memory->memory()), id),
+ : SharedBitmap(static_cast<uint8_t*>(shared_memory->memory()),
+ shared_memory.get(),
+ id),
shared_memory_(std::move(shared_memory)) {}
~OwnedSharedBitmap() override {}
@@ -48,7 +50,7 @@ std::unique_ptr<SharedBitmap> TestSharedBitmapManager::GetSharedBitmapFromId(
if (bitmap_map_.find(id) == bitmap_map_.end())
return nullptr;
uint8_t* pixels = static_cast<uint8_t*>(bitmap_map_[id]->memory());
- return base::MakeUnique<SharedBitmap>(pixels, id);
+ return base::MakeUnique<SharedBitmap>(pixels, bitmap_map_[id], id);
}
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698