| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_process_host_ui_shim.h" | 5 #include "content/browser/gpu_process_host_ui_shim.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/io_thread.h" | |
| 12 #include "content/browser/browser_thread.h" | 11 #include "content/browser/browser_thread.h" |
| 13 #include "content/browser/gpu_data_manager.h" | 12 #include "content/browser/gpu_data_manager.h" |
| 14 #include "content/browser/gpu_process_host.h" | 13 #include "content/browser/gpu_process_host.h" |
| 15 #include "content/browser/renderer_host/render_process_host.h" | 14 #include "content/browser/renderer_host/render_process_host.h" |
| 16 #include "content/browser/renderer_host/render_view_host.h" | 15 #include "content/browser/renderer_host/render_view_host.h" |
| 17 #include "content/browser/renderer_host/render_widget_host_view.h" | 16 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 18 #include "content/common/content_switches.h" | 17 #include "content/common/content_switches.h" |
| 19 #include "content/common/gpu/gpu_messages.h" | 18 #include "content/common/gpu/gpu_messages.h" |
| 20 #include "gpu/common/gpu_trace_event.h" | 19 #include "gpu/common/gpu_trace_event.h" |
| 21 | 20 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 GpuProcessHostUIShim::GpuProcessHostUIShim(int host_id) | 109 GpuProcessHostUIShim::GpuProcessHostUIShim(int host_id) |
| 111 : host_id_(host_id), | 110 : host_id_(host_id), |
| 112 gpu_channel_manager_(NULL), | 111 gpu_channel_manager_(NULL), |
| 113 ui_thread_sender_(NULL) { | 112 ui_thread_sender_(NULL) { |
| 114 g_hosts_by_id.AddWithID(this, host_id_); | 113 g_hosts_by_id.AddWithID(this, host_id_); |
| 115 if (host_id == 0) { | 114 if (host_id == 0) { |
| 116 ui_thread_sender_ = new UIThreadSender; | 115 ui_thread_sender_ = new UIThreadSender; |
| 117 gpu_channel_manager_ = new GpuChannelManager( | 116 gpu_channel_manager_ = new GpuChannelManager( |
| 118 ui_thread_sender_, | 117 ui_thread_sender_, |
| 119 NULL, | 118 NULL, |
| 120 g_browser_process->io_thread()->message_loop(), | 119 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 121 g_browser_process->shutdown_event()); | 120 g_browser_process->shutdown_event()); |
| 122 } | 121 } |
| 123 } | 122 } |
| 124 | 123 |
| 125 // static | 124 // static |
| 126 GpuProcessHostUIShim* GpuProcessHostUIShim::Create(int host_id) { | 125 GpuProcessHostUIShim* GpuProcessHostUIShim::Create(int host_id) { |
| 127 DCHECK(!FromID(host_id)); | 126 DCHECK(!FromID(host_id)); |
| 128 return new GpuProcessHostUIShim(host_id); | 127 return new GpuProcessHostUIShim(host_id); |
| 129 } | 128 } |
| 130 | 129 |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 int render_view_id) { | 336 int render_view_id) { |
| 338 RenderViewHost* host = RenderViewHost::FromID(renderer_id, | 337 RenderViewHost* host = RenderViewHost::FromID(renderer_id, |
| 339 render_view_id); | 338 render_view_id); |
| 340 if (!host) { | 339 if (!host) { |
| 341 return; | 340 return; |
| 342 } | 341 } |
| 343 host->ScheduleComposite(); | 342 host->ScheduleComposite(); |
| 344 } | 343 } |
| 345 | 344 |
| 346 #endif | 345 #endif |
| OLD | NEW |