Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(506)

Side by Side Diff: content/browser/gpu/gpu_process_host.h

Issue 1878103002: Plumb a Browser->GPU surface destruction message for Android VDAs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing ifdefs Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 const gfx::Size& size, 146 const gfx::Size& size,
147 gfx::BufferFormat format, 147 gfx::BufferFormat format,
148 int client_id, 148 int client_id,
149 const CreateGpuMemoryBufferCallback& callback); 149 const CreateGpuMemoryBufferCallback& callback);
150 150
151 // Tells the GPU process to destroy GPU memory buffer. 151 // Tells the GPU process to destroy GPU memory buffer.
152 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, 152 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
153 int client_id, 153 int client_id,
154 const gpu::SyncToken& sync_token); 154 const gpu::SyncToken& sync_token);
155 155
156 #if defined(OS_ANDROID)
157 // Tells the GPU process that the given surface is being destroyed so that it
158 // can stop using it.
159 void DestroyingVideoSurface(int surface_id, const base::Closure& done_cb);
160 #endif
161
156 // What kind of GPU process, e.g. sandboxed or unsandboxed. 162 // What kind of GPU process, e.g. sandboxed or unsandboxed.
157 GpuProcessKind kind(); 163 GpuProcessKind kind();
158 164
159 // Forcefully terminates the GPU process. 165 // Forcefully terminates the GPU process.
160 void ForceShutdown(); 166 void ForceShutdown();
161 167
162 // Asks the GPU process to stop by itself. 168 // Asks the GPU process to stop by itself.
163 void StopGpuProcess(); 169 void StopGpuProcess();
164 170
165 void LoadedShader(const std::string& key, const std::string& data); 171 void LoadedShader(const std::string& key, const std::string& data);
(...skipping 16 matching lines...) Expand all
182 bool OnMessageReceived(const IPC::Message& message) override; 188 bool OnMessageReceived(const IPC::Message& message) override;
183 void OnChannelConnected(int32_t peer_pid) override; 189 void OnChannelConnected(int32_t peer_pid) override;
184 void OnProcessLaunched() override; 190 void OnProcessLaunched() override;
185 void OnProcessLaunchFailed() override; 191 void OnProcessLaunchFailed() override;
186 void OnProcessCrashed(int exit_code) override; 192 void OnProcessCrashed(int exit_code) override;
187 193
188 // Message handlers. 194 // Message handlers.
189 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info); 195 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info);
190 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); 196 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle);
191 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle); 197 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle);
198 #if defined(OS_ANDROID)
199 void OnDestroyingVideoSurfaceHandled(int surface_id);
200 #endif
192 void OnDidCreateOffscreenContext(const GURL& url); 201 void OnDidCreateOffscreenContext(const GURL& url);
193 void OnDidLoseContext(bool offscreen, 202 void OnDidLoseContext(bool offscreen,
194 gpu::error::ContextLostReason reason, 203 gpu::error::ContextLostReason reason,
195 const GURL& url); 204 const GURL& url);
196 void OnDidDestroyOffscreenContext(const GURL& url); 205 void OnDidDestroyOffscreenContext(const GURL& url);
197 void OnGpuMemoryUmaStatsReceived(const gpu::GPUMemoryUmaStats& stats); 206 void OnGpuMemoryUmaStatsReceived(const gpu::GPUMemoryUmaStats& stats);
198 #if defined(OS_MACOSX) 207 #if defined(OS_MACOSX)
199 void OnAcceleratedSurfaceBuffersSwapped(const IPC::Message& message); 208 void OnAcceleratedSurfaceBuffersSwapped(const IPC::Message& message);
200 #endif 209 #endif
201 210
(...skipping 23 matching lines...) Expand all
225 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. 234 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair.
226 int host_id_; 235 int host_id_;
227 236
228 // These are the channel requests that we have already sent to 237 // These are the channel requests that we have already sent to
229 // the GPU process, but haven't heard back about yet. 238 // the GPU process, but haven't heard back about yet.
230 std::queue<EstablishChannelRequest> channel_requests_; 239 std::queue<EstablishChannelRequest> channel_requests_;
231 240
232 // The pending create gpu memory buffer requests we need to reply to. 241 // The pending create gpu memory buffer requests we need to reply to.
233 std::queue<CreateGpuMemoryBufferCallback> create_gpu_memory_buffer_requests_; 242 std::queue<CreateGpuMemoryBufferCallback> create_gpu_memory_buffer_requests_;
234 243
244 // A callback to signal the completion of DestroyingVideoSurface call.
245 base::Closure destroying_video_surface_request_;
246
235 // Qeueud messages to send when the process launches. 247 // Qeueud messages to send when the process launches.
236 std::queue<IPC::Message*> queued_messages_; 248 std::queue<IPC::Message*> queued_messages_;
237 249
238 // Whether the GPU process is valid, set to false after Send() failed. 250 // Whether the GPU process is valid, set to false after Send() failed.
239 bool valid_; 251 bool valid_;
240 252
241 // Whether we are running a GPU thread inside the browser process instead 253 // Whether we are running a GPU thread inside the browser process instead
242 // of a separate GPU process. 254 // of a separate GPU process.
243 bool in_process_; 255 bool in_process_;
244 256
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 // Browser-side Mojo endpoint which sets up a Mojo channel with the child 306 // Browser-side Mojo endpoint which sets up a Mojo channel with the child
295 // process and contains the browser's ServiceRegistry. 307 // process and contains the browser's ServiceRegistry.
296 scoped_ptr<MojoApplicationHost> mojo_application_host_; 308 scoped_ptr<MojoApplicationHost> mojo_application_host_;
297 309
298 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); 310 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost);
299 }; 311 };
300 312
301 } // namespace content 313 } // namespace content
302 314
303 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ 315 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698