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

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: Key texture manager memory dump provider registration off of memory_tracker_ Created 5 years, 4 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 20da57b8de2b443e9fe2faa90971cce08da0cb39..a1d54b7b365c2f4485e71dfe0bd38a63402556d5 100644
--- a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
+++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
@@ -147,11 +147,14 @@ struct BrowserGpuMemoryBufferManager::AllocateGpuMemoryBufferRequest {
scoped_ptr<gfx::GpuMemoryBuffer> result;
};
-BrowserGpuMemoryBufferManager::BrowserGpuMemoryBufferManager(int gpu_client_id)
+BrowserGpuMemoryBufferManager::BrowserGpuMemoryBufferManager(
+ int gpu_client_id,
+ uint64_t gpu_client_tracing_id)
: factory_type_(GetGpuMemoryBufferFactoryType()),
supported_configurations_(
GetSupportedGpuMemoryBufferConfigurations(factory_type_)),
gpu_client_id_(gpu_client_id),
+ gpu_client_tracing_id_(gpu_client_tracing_id),
gpu_host_id_(0) {
DCHECK(!g_gpu_memory_buffer_manager);
g_gpu_memory_buffer_manager = this;
@@ -292,9 +295,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 =
- ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId(
- 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);
@@ -589,4 +591,17 @@ void BrowserGpuMemoryBufferManager::DestroyGpuMemoryBufferOnIO(
buffers.erase(buffer_it);
}
+uint64_t BrowserGpuMemoryBufferManager::ClientIdToTracingProcessId(
+ int client_id) const {
+ if (client_id == gpu_client_id_) {
+ // The gpu_client uses a fixed tracing ID.
+ return gpu_client_tracing_id_;
+ }
+
+ // In normal cases, |client_id| is a child process id, so we can perform
+ // the standard conversion.
+ return ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId(
+ client_id);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698