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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 10854076: Add GPU memory tab to the task manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean try errors (remove semicolon, remove unneeded assert that unittests don't follow) Created 8 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/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 15302bfaed2392f492ffb44c96bb6e8e1ed60add..52fdda0b9057f402eac5f51810d5afe142b157b7 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -38,15 +38,22 @@ namespace {
// ContextGroup's memory type managers and the GpuMemoryManager class.
class GpuCommandBufferMemoryTracker : public gpu::gles2::MemoryTracker {
public:
- GpuCommandBufferMemoryTracker(GpuMemoryManager* gpu_memory_manager)
- : gpu_memory_manager_(gpu_memory_manager) {}
+ GpuCommandBufferMemoryTracker(GpuChannel* channel) {
+ gpu_memory_manager_tracking_group_ = new GpuMemoryTrackingGroup(
+ channel->renderer_pid(),
greggman 2012/08/10 01:23:26 style: indent 4 spaces when splitting statement
ccameron 2012/08/10 18:13:38 Done.
+ channel->gpu_channel_manager()->gpu_memory_manager());
+ }
+
void TrackMemoryAllocatedChange(size_t old_size, size_t new_size) {
- gpu_memory_manager_->TrackMemoryAllocatedChange(old_size, new_size);
+ gpu_memory_manager_tracking_group_->TrackMemoryAllocatedChange(
+ old_size, new_size);
greggman 2012/08/10 01:23:26 style: indent 4 from previous line
ccameron 2012/08/10 18:13:38 Done.
}
private:
- ~GpuCommandBufferMemoryTracker() {}
- GpuMemoryManager* gpu_memory_manager_;
+ ~GpuCommandBufferMemoryTracker() {
+ delete gpu_memory_manager_tracking_group_;
+ }
+ GpuMemoryTrackingGroup* gpu_memory_manager_tracking_group_;
DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferMemoryTracker);
};
@@ -123,8 +130,7 @@ GpuCommandBufferStub::GpuCommandBufferStub(
} else {
context_group_ = new gpu::gles2::ContextGroup(
mailbox_manager,
- new GpuCommandBufferMemoryTracker(
- channel->gpu_channel_manager()->gpu_memory_manager()),
+ new GpuCommandBufferMemoryTracker(channel),
greggman 2012/08/10 01:23:26 style: indent 4 from first line of this group (pre
ccameron 2012/08/10 18:13:38 Done.
true);
}
if (surface_id != 0)

Powered by Google App Engine
This is Rietveld 408576698