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

Side by Side Diff: content/gpu/gpu_child_thread.cc

Issue 10854076: Add GPU memory tab to the task manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allow only one outstanding vidmem refresh 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/gpu/gpu_child_thread.h" 5 #include "content/gpu/gpu_child_thread.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 return ChildThread::Send(msg); 92 return ChildThread::Send(msg);
93 } 93 }
94 94
95 bool GpuChildThread::OnControlMessageReceived(const IPC::Message& msg) { 95 bool GpuChildThread::OnControlMessageReceived(const IPC::Message& msg) {
96 bool msg_is_ok = true; 96 bool msg_is_ok = true;
97 bool handled = true; 97 bool handled = true;
98 IPC_BEGIN_MESSAGE_MAP_EX(GpuChildThread, msg, msg_is_ok) 98 IPC_BEGIN_MESSAGE_MAP_EX(GpuChildThread, msg, msg_is_ok)
99 IPC_MESSAGE_HANDLER(GpuMsg_Initialize, OnInitialize) 99 IPC_MESSAGE_HANDLER(GpuMsg_Initialize, OnInitialize)
100 IPC_MESSAGE_HANDLER(GpuMsg_CollectGraphicsInfo, OnCollectGraphicsInfo) 100 IPC_MESSAGE_HANDLER(GpuMsg_CollectGraphicsInfo, OnCollectGraphicsInfo)
101 IPC_MESSAGE_HANDLER(GpuMsg_GetVidmem, OnGetVidmem)
101 IPC_MESSAGE_HANDLER(GpuMsg_Clean, OnClean) 102 IPC_MESSAGE_HANDLER(GpuMsg_Clean, OnClean)
102 IPC_MESSAGE_HANDLER(GpuMsg_Crash, OnCrash) 103 IPC_MESSAGE_HANDLER(GpuMsg_Crash, OnCrash)
103 IPC_MESSAGE_HANDLER(GpuMsg_Hang, OnHang) 104 IPC_MESSAGE_HANDLER(GpuMsg_Hang, OnHang)
104 IPC_MESSAGE_UNHANDLED(handled = false) 105 IPC_MESSAGE_UNHANDLED(handled = false)
105 IPC_END_MESSAGE_MAP_EX() 106 IPC_END_MESSAGE_MAP_EX()
106 107
107 if (handled) 108 if (handled)
108 return true; 109 return true;
109 110
110 return gpu_channel_manager_.get() && 111 return gpu_channel_manager_.get() &&
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 // collected. 210 // collected.
210 collecting_dx_diagnostics_ = false; 211 collecting_dx_diagnostics_ = false;
211 gpu_info_.finalized = true; 212 gpu_info_.finalized = true;
212 } 213 }
213 } 214 }
214 #endif 215 #endif
215 } 216 }
216 Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_)); 217 Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_));
217 } 218 }
218 219
220 void GpuChildThread::OnGetVidmem()
greggman 2012/08/10 01:23:25 style: { goes on the end of this line
221 {
222 content::GPUVidmem vidmem;
223 if (gpu_channel_manager_.get())
224 gpu_channel_manager_->gpu_memory_manager()->GetVidmem(vidmem);
225 Send(new GpuHostMsg_Vidmem(vidmem));
226 }
227
219 void GpuChildThread::OnClean() { 228 void GpuChildThread::OnClean() {
220 VLOG(1) << "GPU: Removing all contexts"; 229 VLOG(1) << "GPU: Removing all contexts";
221 if (gpu_channel_manager_.get()) 230 if (gpu_channel_manager_.get())
222 gpu_channel_manager_->LoseAllContexts(); 231 gpu_channel_manager_->LoseAllContexts();
223 } 232 }
224 233
225 void GpuChildThread::OnCrash() { 234 void GpuChildThread::OnCrash() {
226 VLOG(1) << "GPU: Simulating GPU crash"; 235 VLOG(1) << "GPU: Simulating GPU crash";
227 // Good bye, cruel world. 236 // Good bye, cruel world.
228 volatile int* it_s_the_end_of_the_world_as_we_know_it = NULL; 237 volatile int* it_s_the_end_of_the_world_as_we_know_it = NULL;
(...skipping 23 matching lines...) Expand all
252 // Runs on the main thread. 261 // Runs on the main thread.
253 void GpuChildThread::SetDxDiagnostics(GpuChildThread* thread, 262 void GpuChildThread::SetDxDiagnostics(GpuChildThread* thread,
254 const content::DxDiagNode& node) { 263 const content::DxDiagNode& node) {
255 thread->gpu_info_.dx_diagnostics = node; 264 thread->gpu_info_.dx_diagnostics = node;
256 thread->gpu_info_.finalized = true; 265 thread->gpu_info_.finalized = true;
257 thread->collecting_dx_diagnostics_ = false; 266 thread->collecting_dx_diagnostics_ = false;
258 thread->Send(new GpuHostMsg_GraphicsInfoCollected(thread->gpu_info_)); 267 thread->Send(new GpuHostMsg_GraphicsInfoCollected(thread->gpu_info_));
259 } 268 }
260 269
261 #endif 270 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698