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 <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "content/browser/gpu/gpu_surface_tracker.h" | 18 #include "content/browser/gpu/gpu_surface_tracker.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
20 #include "content/common/gpu/gpu_memory_uma_stats.h" | 20 #include "content/common/gpu/gpu_memory_uma_stats.h" |
21 #include "content/common/gpu/gpu_process_launch_causes.h" | 21 #include "content/common/gpu/gpu_process_launch_causes.h" |
22 #include "content/public/browser/browser_child_process_host_delegate.h" | 22 #include "content/public/browser/browser_child_process_host_delegate.h" |
23 #include "content/public/browser/gpu_data_manager.h" | 23 #include "content/public/browser/gpu_data_manager.h" |
24 #include "gpu/command_buffer/common/constants.h" | 24 #include "gpu/command_buffer/common/constants.h" |
25 #include "gpu/config/gpu_info.h" | 25 #include "gpu/config/gpu_info.h" |
26 #include "ipc/ipc_channel_proxy.h" | |
27 #include "ipc/ipc_sender.h" | 26 #include "ipc/ipc_sender.h" |
| 27 #include "ipc/message_filter.h" |
28 #include "ui/gfx/native_widget_types.h" | 28 #include "ui/gfx/native_widget_types.h" |
29 #include "ui/gfx/size.h" | 29 #include "ui/gfx/size.h" |
30 #include "url/gurl.h" | 30 #include "url/gurl.h" |
31 | 31 |
32 struct GPUCreateCommandBufferConfig; | 32 struct GPUCreateCommandBufferConfig; |
33 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 33 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
34 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; | 34 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; |
35 struct GpuHostMsg_AcceleratedSurfaceRelease_Params; | 35 struct GpuHostMsg_AcceleratedSurfaceRelease_Params; |
36 | 36 |
37 namespace IPC { | 37 namespace IPC { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 // Get the GPU process host for the GPU process with the given ID. Returns | 90 // Get the GPU process host for the GPU process with the given ID. Returns |
91 // null if the process no longer exists. | 91 // null if the process no longer exists. |
92 static GpuProcessHost* FromID(int host_id); | 92 static GpuProcessHost* FromID(int host_id); |
93 int host_id() const { return host_id_; } | 93 int host_id() const { return host_id_; } |
94 | 94 |
95 // IPC::Sender implementation. | 95 // IPC::Sender implementation. |
96 virtual bool Send(IPC::Message* msg) OVERRIDE; | 96 virtual bool Send(IPC::Message* msg) OVERRIDE; |
97 | 97 |
98 // Adds a message filter to the GpuProcessHost's channel. | 98 // Adds a message filter to the GpuProcessHost's channel. |
99 void AddFilter(IPC::ChannelProxy::MessageFilter* filter); | 99 void AddFilter(IPC::MessageFilter* filter); |
100 | 100 |
101 // Tells the GPU process to create a new channel for communication with a | 101 // Tells the GPU process to create a new channel for communication with a |
102 // client. Once the GPU process responds asynchronously with the IPC handle | 102 // client. Once the GPU process responds asynchronously with the IPC handle |
103 // and GPUInfo, we call the callback. | 103 // and GPUInfo, we call the callback. |
104 void EstablishGpuChannel(int client_id, | 104 void EstablishGpuChannel(int client_id, |
105 bool share_context, | 105 bool share_context, |
106 const EstablishChannelCallback& callback); | 106 const EstablishChannelCallback& callback); |
107 | 107 |
108 // Tells the GPU process to create a new command buffer that draws into the | 108 // Tells the GPU process to create a new command buffer that draws into the |
109 // given surface. | 109 // given surface. |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 typedef std::multimap<int, scoped_refptr<GpuSurfaceTracker::SurfaceRef> > | 260 typedef std::multimap<int, scoped_refptr<GpuSurfaceTracker::SurfaceRef> > |
261 SurfaceRefMap; | 261 SurfaceRefMap; |
262 SurfaceRefMap surface_refs_; | 262 SurfaceRefMap surface_refs_; |
263 | 263 |
264 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 264 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
265 }; | 265 }; |
266 | 266 |
267 } // namespace content | 267 } // namespace content |
268 | 268 |
269 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 269 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
OLD | NEW |