| 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/common/child_process_logging.h" | 10 #include "chrome/common/child_process_logging.h" |
| 10 #include "chrome/common/gpu_messages.h" | 11 #include "chrome/common/gpu_messages.h" |
| 11 | 12 |
| 12 // Tasks used by this file | 13 // Tasks used by this file |
| 13 namespace { | 14 namespace { |
| 14 | 15 |
| 15 class SendOnIOThreadTask : public Task { | 16 class SendOnIOThreadTask : public Task { |
| 16 public: | 17 public: |
| 17 explicit SendOnIOThreadTask(IPC::Message* msg) : msg_(msg) { | 18 explicit SendOnIOThreadTask(IPC::Message* msg) : msg_(msg) { |
| 18 } | 19 } |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 const GPUInfo& GpuProcessHostUIShim::gpu_info() const { | 99 const GPUInfo& GpuProcessHostUIShim::gpu_info() const { |
| 99 DCHECK(CalledOnValidThread()); | 100 DCHECK(CalledOnValidThread()); |
| 100 return gpu_info_; | 101 return gpu_info_; |
| 101 } | 102 } |
| 102 | 103 |
| 103 void GpuProcessHostUIShim::OnGraphicsInfoCollected(const GPUInfo& gpu_info) { | 104 void GpuProcessHostUIShim::OnGraphicsInfoCollected(const GPUInfo& gpu_info) { |
| 104 gpu_info_ = gpu_info; | 105 gpu_info_ = gpu_info; |
| 105 child_process_logging::SetGpuInfo(gpu_info); | 106 child_process_logging::SetGpuInfo(gpu_info); |
| 106 } | 107 } |
| 107 | 108 |
| 109 void GpuProcessHostUIShim::OnScheduleComposite(int renderer_id, |
| 110 int render_view_id) { |
| 111 RenderViewHost* host = RenderViewHost::FromID(renderer_id, |
| 112 render_view_id); |
| 113 if (!host) { |
| 114 return; |
| 115 } |
| 116 host->ScheduleComposite(); |
| 117 } |
| 108 void GpuProcessHostUIShim::OnControlMessageReceived( | 118 void GpuProcessHostUIShim::OnControlMessageReceived( |
| 109 const IPC::Message& message) { | 119 const IPC::Message& message) { |
| 110 DCHECK(CalledOnValidThread()); | 120 DCHECK(CalledOnValidThread()); |
| 111 | 121 |
| 112 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) | 122 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) |
| 113 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, | 123 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, |
| 114 OnGraphicsInfoCollected) | 124 OnGraphicsInfoCollected) |
| 125 #if defined(OS_WIN) |
| 126 IPC_MESSAGE_HANDLER(GpuHostMsg_ScheduleComposite, |
| 127 OnScheduleComposite); |
| 128 #endif |
| 115 IPC_MESSAGE_UNHANDLED_ERROR() | 129 IPC_MESSAGE_UNHANDLED_ERROR() |
| 116 IPC_END_MESSAGE_MAP() | 130 IPC_END_MESSAGE_MAP() |
| 117 } | 131 } |
| OLD | NEW |