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

Unified Diff: gpu/command_buffer/client/transfer_buffer.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: gpu/command_buffer/client/transfer_buffer.cc
diff --git a/gpu/command_buffer/client/transfer_buffer.cc b/gpu/command_buffer/client/transfer_buffer.cc
index 161c836c3ae87b3c88d754a045cef24f8bb2e8ee..3e03db4b69c0863496e3d6874e981896d2bf308d 100644
--- a/gpu/command_buffer/client/transfer_buffer.cc
+++ b/gpu/command_buffer/client/transfer_buffer.cc
@@ -96,6 +96,12 @@ unsigned int TransferBuffer::GetFreeSize() const {
return HaveBuffer() ? ring_buffer_->GetTotalFreeSizeNoWaiting() : 0;
}
+base::SharedMemory* TransferBuffer::GetSharedMemory() const {
+ if (!HaveBuffer())
+ return nullptr;
+ return buffer_->backing()->shared_memory();
+}
+
void TransferBuffer::AllocateRingBuffer(unsigned int size) {
for (;size >= min_buffer_size_; size /= 2) {
int32_t id = -1;

Powered by Google App Engine
This is Rietveld 408576698