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 class GpuMainThread; | 26 class GpuMainThread; |
26 struct GPUCreateCommandBufferConfig; | 27 struct GPUCreateCommandBufferConfig; |
27 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 28 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
28 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; | 29 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; |
29 struct GpuHostMsg_AcceleratedSurfaceRelease_Params; | 30 struct GpuHostMsg_AcceleratedSurfaceRelease_Params; |
30 | 31 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 IPC::Message* message); | 71 IPC::Message* message); |
71 | 72 |
72 // Get the GPU process host for the GPU process with the given ID. Returns | 73 // Get the GPU process host for the GPU process with the given ID. Returns |
73 // null if the process no longer exists. | 74 // null if the process no longer exists. |
74 static GpuProcessHost* FromID(int host_id); | 75 static GpuProcessHost* FromID(int host_id); |
75 int host_id() const { return host_id_; } | 76 int host_id() const { return host_id_; } |
76 | 77 |
77 // IPC::Sender implementation. | 78 // IPC::Sender implementation. |
78 virtual bool Send(IPC::Message* msg) OVERRIDE; | 79 virtual bool Send(IPC::Message* msg) OVERRIDE; |
79 | 80 |
| 81 // Adds a message filter to the GpuProcessHost's channel. |
| 82 void AddFilter(IPC::ChannelProxy::MessageFilter* filter); |
| 83 |
80 // Tells the GPU process to create a new channel for communication with a | 84 // Tells the GPU process to create a new channel for communication with a |
81 // client. Once the GPU process responds asynchronously with the IPC handle | 85 // client. Once the GPU process responds asynchronously with the IPC handle |
82 // and GPUInfo, we call the callback. | 86 // and GPUInfo, we call the callback. |
83 void EstablishGpuChannel(int client_id, | 87 void EstablishGpuChannel(int client_id, |
84 bool share_context, | 88 bool share_context, |
85 const EstablishChannelCallback& callback); | 89 const EstablishChannelCallback& callback); |
86 | 90 |
87 // Tells the GPU process to create a new command buffer that draws into the | 91 // Tells the GPU process to create a new command buffer that draws into the |
88 // given surface. | 92 // given surface. |
89 void CreateViewCommandBuffer( | 93 void CreateViewCommandBuffer( |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 static bool gpu_enabled_; | 220 static bool gpu_enabled_; |
217 | 221 |
218 static bool hardware_gpu_enabled_; | 222 static bool hardware_gpu_enabled_; |
219 | 223 |
220 scoped_ptr<BrowserChildProcessHostImpl> process_; | 224 scoped_ptr<BrowserChildProcessHostImpl> process_; |
221 | 225 |
222 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 226 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
223 }; | 227 }; |
224 | 228 |
225 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 229 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
OLD | NEW |