| 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 #ifndef CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
| 6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
| 14 #include "base/process.h" | 14 #include "base/process.h" |
| 15 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/non_thread_safe.h" |
| 16 #include "base/time.h" | 16 #include "base/time.h" |
| 17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 18 #include "content/common/gpu/gpu_process_launch_causes.h" | 18 #include "content/common/gpu/gpu_process_launch_causes.h" |
| 19 #include "content/public/browser/browser_child_process_host_delegate.h" | 19 #include "content/public/browser/browser_child_process_host_delegate.h" |
| 20 #include "content/public/common/gpu_info.h" | 20 #include "content/public/common/gpu_info.h" |
| 21 #include "ipc/ipc_channel_proxy.h" |
| 21 #include "ipc/ipc_sender.h" | 22 #include "ipc/ipc_sender.h" |
| 22 #include "ui/gfx/native_widget_types.h" | 23 #include "ui/gfx/native_widget_types.h" |
| 23 #include "ui/gfx/size.h" | 24 #include "ui/gfx/size.h" |
| 24 | 25 |
| 25 struct GPUCreateCommandBufferConfig; | 26 struct GPUCreateCommandBufferConfig; |
| 26 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 27 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
| 27 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; | 28 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; |
| 28 struct GpuHostMsg_AcceleratedSurfaceRelease_Params; | 29 struct GpuHostMsg_AcceleratedSurfaceRelease_Params; |
| 29 | 30 |
| 30 namespace IPC { | 31 namespace IPC { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 IPC::Message* message); | 70 IPC::Message* message); |
| 70 | 71 |
| 71 // Get the GPU process host for the GPU process with the given ID. Returns | 72 // Get the GPU process host for the GPU process with the given ID. Returns |
| 72 // null if the process no longer exists. | 73 // null if the process no longer exists. |
| 73 static GpuProcessHost* FromID(int host_id); | 74 static GpuProcessHost* FromID(int host_id); |
| 74 int host_id() const { return host_id_; } | 75 int host_id() const { return host_id_; } |
| 75 | 76 |
| 76 // IPC::Sender implementation. | 77 // IPC::Sender implementation. |
| 77 virtual bool Send(IPC::Message* msg) OVERRIDE; | 78 virtual bool Send(IPC::Message* msg) OVERRIDE; |
| 78 | 79 |
| 80 // Adds a message filter to the GpuProcessHost's channel. |
| 81 void AddFilter(IPC::ChannelProxy::MessageFilter* filter); |
| 82 |
| 79 // Tells the GPU process to create a new channel for communication with a | 83 // Tells the GPU process to create a new channel for communication with a |
| 80 // client. Once the GPU process responds asynchronously with the IPC handle | 84 // client. Once the GPU process responds asynchronously with the IPC handle |
| 81 // and GPUInfo, we call the callback. | 85 // and GPUInfo, we call the callback. |
| 82 void EstablishGpuChannel(int client_id, | 86 void EstablishGpuChannel(int client_id, |
| 83 bool share_context, | 87 bool share_context, |
| 84 const EstablishChannelCallback& callback); | 88 const EstablishChannelCallback& callback); |
| 85 | 89 |
| 86 // Tells the GPU process to create a new command buffer that draws into the | 90 // Tells the GPU process to create a new command buffer that draws into the |
| 87 // given surface. | 91 // given surface. |
| 88 void CreateViewCommandBuffer( | 92 void CreateViewCommandBuffer( |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 static bool hardware_gpu_enabled_; | 221 static bool hardware_gpu_enabled_; |
| 218 | 222 |
| 219 scoped_ptr<BrowserChildProcessHostImpl> process_; | 223 scoped_ptr<BrowserChildProcessHostImpl> process_; |
| 220 | 224 |
| 221 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 225 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
| 222 }; | 226 }; |
| 223 | 227 |
| 224 } // namespace content | 228 } // namespace content |
| 225 | 229 |
| 226 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 230 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
| OLD | NEW |