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

Unified Diff: content/browser/gpu/browser_gpu_memory_buffer_manager.cc

Issue 1256613002: Add tracing for GL texture objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@browser_process_id
Patch Set: review feedback Created 5 years, 5 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/browser/gpu/browser_gpu_memory_buffer_manager.cc
diff --git a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
index 67797d42937129b8dcc17254764621bb84db3316..94c07ef755c732b63a356c6ac0e783c71c7c07e9 100644
--- a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
+++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
@@ -294,8 +294,8 @@ bool BrowserGpuMemoryBufferManager::OnMemoryDump(
// corresponding dump for the same buffer, this will avoid to
// double-count them in tracing. If, instead, no other process will emit a
// dump with the same guid, the segment will be accounted to the browser.
- const uint64 client_tracing_process_id = base::trace_event::
- MemoryDumpManager::ChildProcessIdToTracingProcessId(client_id);
+ uint64 client_tracing_process_id = ClientIdToTracingProcessId(client_id);
+
base::trace_event::MemoryAllocatorDumpGuid shared_buffer_guid =
gfx::GetGpuMemoryBufferGUIDForTracing(client_tracing_process_id,
buffer_id);
@@ -590,4 +590,20 @@ void BrowserGpuMemoryBufferManager::DestroyGpuMemoryBufferOnIO(
buffers.erase(buffer_it);
}
+uint64_t BrowserGpuMemoryBufferManager::ClientIdToTracingProcessId(
+ int client_id) const {
+ if (client_id == gpu_client_id_) {
+ // The browser process doesn't use a client ID to generate its tracing ID.
+ // Instead it uses a fixed tracing ID. If |client_id| == |gpu_client_id_|,
+ // then this surface is owned by the browser, so get our current tracing ID.
+ return base::trace_event::MemoryDumpManager::GetInstance()
+ ->tracing_process_id();
reveman 2015/07/29 19:41:19 nit: Please add a "const int gpu_client_tracing_id
ericrk 2015/07/29 21:37:46 good point. done.
+ } else {
reveman 2015/07/29 19:41:19 nit: maybe skip this else statement as you return
ericrk 2015/07/29 21:37:46 Done.
+ // In normal cases, |client_id| is a child process id, so we can perform
+ // the standard conversion.
+ return base::trace_event::MemoryDumpManager::
+ ChildProcessIdToTracingProcessId(client_id);
+ }
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698