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

Unified Diff: gpu/command_buffer/client/transfer_buffer.cc

Issue 2535213002: [WIP] Add SharedMemoryTracker to dump base::SharedMemory usage
Patch Set: (rebase) Created 3 years, 7 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
« no previous file with comments | « gpu/command_buffer/client/transfer_buffer.h ('k') | gpu/command_buffer/common/buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..18b15c1d93427d3f01063276c3b285c49a05f998 100644
--- a/gpu/command_buffer/client/transfer_buffer.cc
+++ b/gpu/command_buffer/client/transfer_buffer.cc
@@ -96,6 +96,14 @@ unsigned int TransferBuffer::GetFreeSize() const {
return HaveBuffer() ? ring_buffer_->GetTotalFreeSizeNoWaiting() : 0;
}
+base::SharedMemory* TransferBuffer::GetSharedMemory() const {
+ if (!HaveBuffer())
+ return nullptr;
+ if (!buffer_->backing())
+ return nullptr;
+ return buffer_->backing()->shared_memory();
+}
+
void TransferBuffer::AllocateRingBuffer(unsigned int size) {
for (;size >= min_buffer_size_; size /= 2) {
int32_t id = -1;
« no previous file with comments | « gpu/command_buffer/client/transfer_buffer.h ('k') | gpu/command_buffer/common/buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698