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.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 queued_messages_.push(msg); | 467 queued_messages_.push(msg); |
468 return true; | 468 return true; |
469 } | 469 } |
470 | 470 |
471 bool result = process_->Send(msg); | 471 bool result = process_->Send(msg); |
472 if (!result) | 472 if (!result) |
473 valid_ = false; | 473 valid_ = false; |
474 return result; | 474 return result; |
475 } | 475 } |
476 | 476 |
| 477 void GpuProcessHost::AddFilter(IPC::ChannelProxy::MessageFilter* filter) { |
| 478 DCHECK(CalledOnValidThread()); |
| 479 process_->GetHost()->AddFilter(filter); |
| 480 } |
| 481 |
477 bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) { | 482 bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) { |
478 DCHECK(CalledOnValidThread()); | 483 DCHECK(CalledOnValidThread()); |
479 IPC_BEGIN_MESSAGE_MAP(GpuProcessHost, message) | 484 IPC_BEGIN_MESSAGE_MAP(GpuProcessHost, message) |
480 IPC_MESSAGE_HANDLER(GpuHostMsg_Initialized, OnInitialized) | 485 IPC_MESSAGE_HANDLER(GpuHostMsg_Initialized, OnInitialized) |
481 IPC_MESSAGE_HANDLER(GpuHostMsg_ChannelEstablished, OnChannelEstablished) | 486 IPC_MESSAGE_HANDLER(GpuHostMsg_ChannelEstablished, OnChannelEstablished) |
482 IPC_MESSAGE_HANDLER(GpuHostMsg_CommandBufferCreated, OnCommandBufferCreated) | 487 IPC_MESSAGE_HANDLER(GpuHostMsg_CommandBufferCreated, OnCommandBufferCreated) |
483 IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyCommandBuffer, OnDestroyCommandBuffer) | 488 IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyCommandBuffer, OnDestroyCommandBuffer) |
484 IPC_MESSAGE_HANDLER(GpuHostMsg_ImageCreated, OnImageCreated) | 489 IPC_MESSAGE_HANDLER(GpuHostMsg_ImageCreated, OnImageCreated) |
485 #if defined(OS_MACOSX) | 490 #if defined(OS_MACOSX) |
486 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, | 491 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 | 959 |
955 void GpuProcessHost::CreateCommandBufferError( | 960 void GpuProcessHost::CreateCommandBufferError( |
956 const CreateCommandBufferCallback& callback, int32 route_id) { | 961 const CreateCommandBufferCallback& callback, int32 route_id) { |
957 callback.Run(route_id); | 962 callback.Run(route_id); |
958 } | 963 } |
959 | 964 |
960 void GpuProcessHost::CreateImageError( | 965 void GpuProcessHost::CreateImageError( |
961 const CreateImageCallback& callback, const gfx::Size size) { | 966 const CreateImageCallback& callback, const gfx::Size size) { |
962 callback.Run(size); | 967 callback.Run(size); |
963 } | 968 } |
OLD | NEW |