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> |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 // Whether this GPU process is set up to use software rendering. | 117 // Whether this GPU process is set up to use software rendering. |
118 bool software_rendering(); | 118 bool software_rendering(); |
119 | 119 |
120 // What kind of GPU process, e.g. sandboxed or unsandboxed. | 120 // What kind of GPU process, e.g. sandboxed or unsandboxed. |
121 GpuProcessKind kind(); | 121 GpuProcessKind kind(); |
122 | 122 |
123 void ForceShutdown(); | 123 void ForceShutdown(); |
124 | 124 |
125 private: | 125 private: |
126 static bool HostIsValid(GpuProcessHost* host); | 126 static bool ValidateHost(GpuProcessHost* host); |
127 | 127 |
128 GpuProcessHost(int host_id, GpuProcessKind kind); | 128 GpuProcessHost(int host_id, GpuProcessKind kind); |
129 virtual ~GpuProcessHost(); | 129 virtual ~GpuProcessHost(); |
130 | 130 |
131 bool Init(); | 131 bool Init(); |
132 | 132 |
133 // Post an IPC message to the UI shim's message handler on the UI thread. | 133 // Post an IPC message to the UI shim's message handler on the UI thread. |
134 void RouteOnUIThread(const IPC::Message& message); | 134 void RouteOnUIThread(const IPC::Message& message); |
135 | 135 |
136 // BrowserChildProcessHostDelegate implementation. | 136 // BrowserChildProcessHostDelegate implementation. |
(...skipping 25 matching lines...) Expand all Loading... |
162 void OnAcceleratedSurfacePostSubBuffer( | 162 void OnAcceleratedSurfacePostSubBuffer( |
163 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params); | 163 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params); |
164 void OnAcceleratedSurfaceSuspend(int32 surface_id); | 164 void OnAcceleratedSurfaceSuspend(int32 surface_id); |
165 void OnAcceleratedSurfaceRelease( | 165 void OnAcceleratedSurfaceRelease( |
166 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); | 166 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); |
167 #endif | 167 #endif |
168 | 168 |
169 bool LaunchGpuProcess(const std::string& channel_id); | 169 bool LaunchGpuProcess(const std::string& channel_id); |
170 | 170 |
171 void SendOutstandingReplies(); | 171 void SendOutstandingReplies(); |
172 void EstablishChannelError( | |
173 const EstablishChannelCallback& callback, | |
174 const IPC::ChannelHandle& channel_handle, | |
175 base::ProcessHandle client_process_for_gpu, | |
176 const GPUInfo& gpu_info); | |
177 void CreateCommandBufferError(const CreateCommandBufferCallback& callback, | |
178 int32 route_id); | |
179 void CreateImageError(const CreateImageCallback& callback, | |
180 const gfx::Size size); | |
181 | 172 |
182 void BlockLiveOffscreenContexts(); | 173 void BlockLiveOffscreenContexts(); |
183 | 174 |
184 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. | 175 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. |
185 int host_id_; | 176 int host_id_; |
186 | 177 |
187 // These are the channel requests that we have already sent to | 178 // These are the channel requests that we have already sent to |
188 // the GPU process, but haven't heard back about yet. | 179 // the GPU process, but haven't heard back about yet. |
189 std::queue<EstablishChannelCallback> channel_requests_; | 180 std::queue<EstablishChannelCallback> channel_requests_; |
190 | 181 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 237 |
247 // Statics kept around to send to UMA histograms on GPU process lost. | 238 // Statics kept around to send to UMA histograms on GPU process lost. |
248 GPUMemoryUmaStats uma_memory_stats_; | 239 GPUMemoryUmaStats uma_memory_stats_; |
249 | 240 |
250 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 241 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
251 }; | 242 }; |
252 | 243 |
253 } // namespace content | 244 } // namespace content |
254 | 245 |
255 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 246 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
OLD | NEW |