| OLD | NEW |
| 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/browser/gpu/gpu_process_host_ui_shim.h" | 5 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 surface_id, &render_process_id, &render_widget_id)) | 83 surface_id, &render_process_id, &render_widget_id)) |
| 84 return NULL; | 84 return NULL; |
| 85 | 85 |
| 86 content::RenderProcessHost* process = | 86 content::RenderProcessHost* process = |
| 87 content::RenderProcessHost::FromID(render_process_id); | 87 content::RenderProcessHost::FromID(render_process_id); |
| 88 if (!process) | 88 if (!process) |
| 89 return NULL; | 89 return NULL; |
| 90 | 90 |
| 91 RenderWidgetHostImpl* host = static_cast<RenderWidgetHostImpl*>( | 91 RenderWidgetHostImpl* host = static_cast<RenderWidgetHostImpl*>( |
| 92 process->GetListenerByID(render_widget_id)); | 92 process->GetListenerByID(render_widget_id)); |
| 93 return host ? RenderWidgetHostViewPort::FromRWHV(host->view()) : NULL; | 93 return host ? RenderWidgetHostViewPort::FromRWHV(host->GetView()) : NULL; |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace | 96 } // namespace |
| 97 | 97 |
| 98 void RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg) { | 98 void RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg) { |
| 99 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(host_id); | 99 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(host_id); |
| 100 if (ui_shim) | 100 if (ui_shim) |
| 101 ui_shim->OnMessageReceived(msg); | 101 ui_shim->OnMessageReceived(msg); |
| 102 } | 102 } |
| 103 | 103 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( | 393 void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( |
| 394 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { | 394 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { |
| 395 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( | 395 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( |
| 396 params.surface_id); | 396 params.surface_id); |
| 397 if (!view) | 397 if (!view) |
| 398 return; | 398 return; |
| 399 view->AcceleratedSurfaceRelease(params.identifier); | 399 view->AcceleratedSurfaceRelease(params.identifier); |
| 400 } | 400 } |
| 401 | 401 |
| 402 #endif | 402 #endif |
| OLD | NEW |