Chromium Code Reviews| Index: content/browser/renderer_host/gpu_message_filter.cc |
| diff --git a/content/browser/renderer_host/gpu_message_filter.cc b/content/browser/renderer_host/gpu_message_filter.cc |
| index 5a98c13bd4d9d7025213c5b90a800da5598511d9..94de127fba4d150cd17f8f84e8bbc3fde0b71b1c 100644 |
| --- a/content/browser/renderer_host/gpu_message_filter.cc |
| +++ b/content/browser/renderer_host/gpu_message_filter.cc |
| @@ -10,7 +10,7 @@ |
| #include "base/callback.h" |
| #include "chrome/common/render_messages.h" |
| -#include "content/browser/gpu/gpu_process_host.h" |
| +#include "content/browser/gpu/gpu_message_hub.h" |
| #include "content/common/gpu/gpu_messages.h" |
| GpuMessageFilter::GpuMessageFilter(int render_process_id) |
| @@ -150,9 +150,6 @@ class CreateCommandBufferCallback : public CallbackRunner<Tuple1<int32> > { |
| void GpuMessageFilter::OnEstablishGpuChannel( |
| content::CauseForGpuLaunch cause_for_gpu_launch) { |
| - scoped_ptr<EstablishChannelCallback> callback( |
| - new EstablishChannelCallback(this)); |
| - |
| // TODO(apatrick): Eventually, this will return the route ID of a |
| // GpuProcessStub, from which the renderer process will create a |
| // GpuProcessProxy. The renderer will use the proxy for all subsequent |
| @@ -160,35 +157,18 @@ void GpuMessageFilter::OnEstablishGpuChannel( |
| // terminates, the renderer process will not find itself unknowingly sending |
| // IPCs to a newly launched GPU process. Also, I will rename this function |
| // to something like OnCreateGpuProcess. |
| - GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); |
| - if (!host) { |
| - host = GpuProcessHost::GetForRenderer( |
| - render_process_id_, cause_for_gpu_launch); |
| - if (!host) { |
| - callback->Run(IPC::ChannelHandle(), |
| - static_cast<base::ProcessHandle>(NULL), |
| - GPUInfo()); |
| - return; |
| - } |
| - |
| - gpu_host_id_ = host->host_id(); |
| - } |
| - |
| - host->EstablishGpuChannel(render_process_id_, callback.release()); |
| + int host_id; |
| + if (GpuMessageHub::EstablishGpuChannel( |
| + render_process_id_, |
| + cause_for_gpu_launch, |
| + new EstablishChannelCallback(this), |
| + host_id)) |
| + gpu_host_id_ = host_id; |
| } |
| void GpuMessageFilter::OnSynchronizeGpu(IPC::Message* reply) { |
| - GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); |
| - if (!host) { |
| - // TODO(apatrick): Eventually, this IPC message will be routed to a |
|
apatrick_chromium
2011/05/23 22:01:33
keep TODO
|
| - // GpuProcessStub with a particular routing ID. The error will be set if |
| - // the GpuProcessStub with that routing ID is not in the MessageRouter. |
| - reply->set_reply_error(); |
| - Send(reply); |
| - return; |
| - } |
| - |
| - host->Synchronize(new SynchronizeCallback(this, reply)); |
| + GpuMessageHub::Synchronize(gpu_host_id_, |
| + new SynchronizeCallback(this, reply)); |
| } |
| void GpuMessageFilter::OnCreateViewCommandBuffer( |
| @@ -196,17 +176,8 @@ void GpuMessageFilter::OnCreateViewCommandBuffer( |
| int32 render_view_id, |
| const GPUCreateCommandBufferConfig& init_params, |
| IPC::Message* reply) { |
| - GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); |
| - if (!host) { |
| - // TODO(apatrick): Eventually, this IPC message will be routed to a |
|
apatrick_chromium
2011/05/23 22:01:33
keep TODO
|
| - // GpuProcessStub with a particular routing ID. The error will be set if |
| - // the GpuProcessStub with that routing ID is not in the MessageRouter. |
| - reply->set_reply_error(); |
| - Send(reply); |
| - return; |
| - } |
| - |
| - host->CreateViewCommandBuffer( |
| + GpuMessageHub::CreateViewCommandBuffer( |
| + gpu_host_id_, |
| compositing_surface, |
| render_view_id, |
| render_process_id_, |