Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "chrome/browser/browser_thread.h" | 7 #include "chrome/browser/browser_thread.h" |
| 8 #include "chrome/browser/gpu_process_host.h" | 8 #include "chrome/browser/gpu_process_host.h" |
| 9 #include "chrome/browser/renderer_host/render_view_host.h" | 9 #include "chrome/browser/renderer_host/render_view_host.h" |
| 10 #include "chrome/common/child_process_logging.h" | 10 #include "chrome/common/child_process_logging.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 } | 97 } |
| 98 | 98 |
| 99 const GPUInfo& GpuProcessHostUIShim::gpu_info() const { | 99 const GPUInfo& GpuProcessHostUIShim::gpu_info() const { |
| 100 DCHECK(CalledOnValidThread()); | 100 DCHECK(CalledOnValidThread()); |
| 101 return gpu_info_; | 101 return gpu_info_; |
| 102 } | 102 } |
| 103 | 103 |
| 104 void GpuProcessHostUIShim::OnGraphicsInfoCollected(const GPUInfo& gpu_info) { | 104 void GpuProcessHostUIShim::OnGraphicsInfoCollected(const GPUInfo& gpu_info) { |
| 105 gpu_info_ = gpu_info; | 105 gpu_info_ = gpu_info; |
| 106 child_process_logging::SetGpuInfo(gpu_info); | 106 child_process_logging::SetGpuInfo(gpu_info); |
| 107 | |
| 108 // Used only in testing. | |
| 109 if (gpu_info_collected_callback_.get()) { | |
| 110 gpu_info_collected_callback_->Run(); | |
| 111 gpu_info_collected_callback_.reset(); | |
|
apatrick_chromium
2010/12/13 21:16:35
I think the caller of set_gpu_info_collected_callb
kkania
2010/12/13 22:12:57
Done.
| |
| 112 } | |
| 107 } | 113 } |
| 108 | 114 |
| 109 void GpuProcessHostUIShim::OnScheduleComposite(int renderer_id, | 115 void GpuProcessHostUIShim::OnScheduleComposite(int renderer_id, |
| 110 int render_view_id) { | 116 int render_view_id) { |
| 111 RenderViewHost* host = RenderViewHost::FromID(renderer_id, | 117 RenderViewHost* host = RenderViewHost::FromID(renderer_id, |
| 112 render_view_id); | 118 render_view_id); |
| 113 if (!host) { | 119 if (!host) { |
| 114 return; | 120 return; |
| 115 } | 121 } |
| 116 host->ScheduleComposite(); | 122 host->ScheduleComposite(); |
| 117 } | 123 } |
| 118 void GpuProcessHostUIShim::OnControlMessageReceived( | 124 void GpuProcessHostUIShim::OnControlMessageReceived( |
| 119 const IPC::Message& message) { | 125 const IPC::Message& message) { |
| 120 DCHECK(CalledOnValidThread()); | 126 DCHECK(CalledOnValidThread()); |
| 121 | 127 |
| 122 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) | 128 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) |
| 123 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, | 129 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, |
| 124 OnGraphicsInfoCollected) | 130 OnGraphicsInfoCollected) |
| 125 #if defined(OS_WIN) | 131 #if defined(OS_WIN) |
| 126 IPC_MESSAGE_HANDLER(GpuHostMsg_ScheduleComposite, | 132 IPC_MESSAGE_HANDLER(GpuHostMsg_ScheduleComposite, |
| 127 OnScheduleComposite); | 133 OnScheduleComposite); |
| 128 #endif | 134 #endif |
| 129 IPC_MESSAGE_UNHANDLED_ERROR() | 135 IPC_MESSAGE_UNHANDLED_ERROR() |
| 130 IPC_END_MESSAGE_MAP() | 136 IPC_END_MESSAGE_MAP() |
| 131 } | 137 } |
| OLD | NEW |