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

Side by Side Diff: chrome/browser/gpu_process_host_ui_shim.cc

Issue 6551019: Trace_event upgrades (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More gooder js thanks to arv. Created 9 years, 10 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/gpu_process_host_ui_shim.h" 5 #include "chrome/browser/gpu_process_host_ui_shim.h"
6 6
7 #include "app/app_switches.h" 7 #include "app/app_switches.h"
8 #include "app/gfx/gl/gl_implementation.h" 8 #include "app/gfx/gl/gl_implementation.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h"
10 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
11 #include "chrome/browser/browser_thread.h" 12 #include "chrome/browser/browser_thread.h"
12 #include "chrome/browser/gpu_blacklist.h" 13 #include "chrome/browser/gpu_blacklist.h"
13 #include "chrome/browser/gpu_process_host.h" 14 #include "chrome/browser/gpu_process_host.h"
14 #include "chrome/browser/renderer_host/render_process_host.h" 15 #include "chrome/browser/renderer_host/render_process_host.h"
15 #include "chrome/browser/renderer_host/render_view_host.h" 16 #include "chrome/browser/renderer_host/render_view_host.h"
16 #include "chrome/browser/renderer_host/render_widget_host_view.h" 17 #include "chrome/browser/renderer_host/render_widget_host_view.h"
17 #include "chrome/common/child_process_logging.h" 18 #include "chrome/common/child_process_logging.h"
18 #include "chrome/common/chrome_switches.h" 19 #include "chrome/common/chrome_switches.h"
19 #include "chrome/common/gpu_messages.h" 20 #include "chrome/common/gpu_messages.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 CreateCommandBufferError(wrapped_callback.release(), MSG_ROUTING_NONE); 256 CreateCommandBufferError(wrapped_callback.release(), MSG_ROUTING_NONE);
256 } 257 }
257 } 258 }
258 259
259 void GpuProcessHostUIShim::CollectGraphicsInfoAsynchronously( 260 void GpuProcessHostUIShim::CollectGraphicsInfoAsynchronously(
260 GPUInfo::Level level) { 261 GPUInfo::Level level) {
261 DCHECK(CalledOnValidThread()); 262 DCHECK(CalledOnValidThread());
262 Send(new GpuMsg_CollectGraphicsInfo(level)); 263 Send(new GpuMsg_CollectGraphicsInfo(level));
263 } 264 }
264 265
266 void GpuProcessHostUIShim::OnTraceDataCollectedRemotely(
267 const std::string& json_events) {
268 base::debug::TraceLog::GetInstance()->AddRemotelyCollectedData(json_events);
269 }
270
271 void GpuProcessHostUIShim::SetTraceEnabled(bool enabled) {
272 DCHECK(CalledOnValidThread());
273
274 BrowserThread::PostTask(
275 BrowserThread::IO,
276 FROM_HERE,
277 new SendOnIOThreadTask(new GpuMsg_SetTraceEnabled(enabled)));
278 }
279
265 void GpuProcessHostUIShim::SendAboutGpuCrash() { 280 void GpuProcessHostUIShim::SendAboutGpuCrash() {
266 DCHECK(CalledOnValidThread()); 281 DCHECK(CalledOnValidThread());
267 Send(new GpuMsg_Crash()); 282 Send(new GpuMsg_Crash());
268 } 283 }
269 284
270 void GpuProcessHostUIShim::SendAboutGpuHang() { 285 void GpuProcessHostUIShim::SendAboutGpuHang() {
271 DCHECK(CalledOnValidThread()); 286 DCHECK(CalledOnValidThread());
272 Send(new GpuMsg_Hang()); 287 Send(new GpuMsg_Hang());
273 } 288 }
274 289
(...skipping 18 matching lines...) Expand all
293 IPC_MESSAGE_HANDLER(GpuHostMsg_CommandBufferCreated, 308 IPC_MESSAGE_HANDLER(GpuHostMsg_CommandBufferCreated,
294 OnCommandBufferCreated) 309 OnCommandBufferCreated)
295 IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyCommandBuffer, 310 IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyCommandBuffer,
296 OnDestroyCommandBuffer) 311 OnDestroyCommandBuffer)
297 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, 312 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected,
298 OnGraphicsInfoCollected) 313 OnGraphicsInfoCollected)
299 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, 314 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage,
300 OnLogMessage) 315 OnLogMessage)
301 IPC_MESSAGE_HANDLER(GpuHostMsg_SynchronizeReply, 316 IPC_MESSAGE_HANDLER(GpuHostMsg_SynchronizeReply,
302 OnSynchronizeReply) 317 OnSynchronizeReply)
318 IPC_MESSAGE_HANDLER(GpuHostMsg_TraceDataCollectedRemotely,
319 OnTraceDataCollectedRemotely)
303 #if defined(OS_LINUX) 320 #if defined(OS_LINUX)
304 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_ResizeXID, OnResizeXID) 321 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_ResizeXID, OnResizeXID)
305 #elif defined(OS_MACOSX) 322 #elif defined(OS_MACOSX)
306 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceSetIOSurface, 323 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceSetIOSurface,
307 OnAcceleratedSurfaceSetIOSurface) 324 OnAcceleratedSurfaceSetIOSurface)
308 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, 325 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
309 OnAcceleratedSurfaceBuffersSwapped) 326 OnAcceleratedSurfaceBuffersSwapped)
310 #elif defined(OS_WIN) 327 #elif defined(OS_WIN)
311 IPC_MESSAGE_HANDLER(GpuHostMsg_ScheduleComposite, OnScheduleComposite); 328 IPC_MESSAGE_HANDLER(GpuHostMsg_ScheduleComposite, OnScheduleComposite);
312 #endif 329 #endif
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 return true; 522 return true;
506 static const base::StringPiece gpu_blacklist_json( 523 static const base::StringPiece gpu_blacklist_json(
507 ResourceBundle::GetSharedInstance().GetRawDataResource( 524 ResourceBundle::GetSharedInstance().GetRawDataResource(
508 IDR_GPU_BLACKLIST)); 525 IDR_GPU_BLACKLIST));
509 gpu_blacklist_.reset(new GpuBlacklist()); 526 gpu_blacklist_.reset(new GpuBlacklist());
510 if (gpu_blacklist_->LoadGpuBlacklist(gpu_blacklist_json.as_string(), true)) 527 if (gpu_blacklist_->LoadGpuBlacklist(gpu_blacklist_json.as_string(), true))
511 return true; 528 return true;
512 gpu_blacklist_.reset(NULL); 529 gpu_blacklist_.reset(NULL);
513 return false; 530 return false;
514 } 531 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698