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

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 a threadchecker 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
« no previous file with comments | « base/threading/thread_restrictions.h ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 SendDestroyingVideoSurface(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 13 matching lines...) Expand all
179 bool OnMessageReceived(const IPC::Message& message) override; 185 bool OnMessageReceived(const IPC::Message& message) override;
180 void OnChannelConnected(int32_t peer_pid) override; 186 void OnChannelConnected(int32_t peer_pid) override;
181 void OnProcessLaunched() override; 187 void OnProcessLaunched() override;
182 void OnProcessLaunchFailed() override; 188 void OnProcessLaunchFailed() override;
183 void OnProcessCrashed(int exit_code) override; 189 void OnProcessCrashed(int exit_code) override;
184 190
185 // Message handlers. 191 // Message handlers.
186 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info); 192 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info);
187 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); 193 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle);
188 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle); 194 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle);
195 #if defined(OS_ANDROID)
196 void OnDestroyingVideoSurfaceAck(int surface_id);
197 #endif
189 void OnDidCreateOffscreenContext(const GURL& url); 198 void OnDidCreateOffscreenContext(const GURL& url);
190 void OnDidLoseContext(bool offscreen, 199 void OnDidLoseContext(bool offscreen,
191 gpu::error::ContextLostReason reason, 200 gpu::error::ContextLostReason reason,
192 const GURL& url); 201 const GURL& url);
193 void OnDidDestroyOffscreenContext(const GURL& url); 202 void OnDidDestroyOffscreenContext(const GURL& url);
194 void OnGpuMemoryUmaStatsReceived(const gpu::GPUMemoryUmaStats& stats); 203 void OnGpuMemoryUmaStatsReceived(const gpu::GPUMemoryUmaStats& stats);
195 #if defined(OS_MACOSX) 204 #if defined(OS_MACOSX)
196 void OnAcceleratedSurfaceBuffersSwapped(const IPC::Message& message); 205 void OnAcceleratedSurfaceBuffersSwapped(const IPC::Message& message);
197 #endif 206 #endif
198 207
(...skipping 24 matching lines...) Expand all
223 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. 232 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair.
224 int host_id_; 233 int host_id_;
225 234
226 // These are the channel requests that we have already sent to 235 // These are the channel requests that we have already sent to
227 // the GPU process, but haven't heard back about yet. 236 // the GPU process, but haven't heard back about yet.
228 std::queue<EstablishChannelRequest> channel_requests_; 237 std::queue<EstablishChannelRequest> channel_requests_;
229 238
230 // The pending create gpu memory buffer requests we need to reply to. 239 // The pending create gpu memory buffer requests we need to reply to.
231 std::queue<CreateGpuMemoryBufferCallback> create_gpu_memory_buffer_requests_; 240 std::queue<CreateGpuMemoryBufferCallback> create_gpu_memory_buffer_requests_;
232 241
242 // A callback to signal the completion of a SendDestroyingVideoSurface call.
243 base::Closure send_destroying_video_surface_done_cb_;
244
233 // Qeueud messages to send when the process launches. 245 // Qeueud messages to send when the process launches.
234 std::queue<IPC::Message*> queued_messages_; 246 std::queue<IPC::Message*> queued_messages_;
235 247
236 // Whether the GPU process is valid, set to false after Send() failed. 248 // Whether the GPU process is valid, set to false after Send() failed.
237 bool valid_; 249 bool valid_;
238 250
239 // Whether we are running a GPU thread inside the browser process instead 251 // Whether we are running a GPU thread inside the browser process instead
240 // of a separate GPU process. 252 // of a separate GPU process.
241 bool in_process_; 253 bool in_process_;
242 254
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 // Browser-side Mojo endpoint which sets up a Mojo channel with the child 304 // Browser-side Mojo endpoint which sets up a Mojo channel with the child
293 // process and contains the browser's ServiceRegistry. 305 // process and contains the browser's ServiceRegistry.
294 std::unique_ptr<MojoApplicationHost> mojo_application_host_; 306 std::unique_ptr<MojoApplicationHost> mojo_application_host_;
295 307
296 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); 308 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost);
297 }; 309 };
298 310
299 } // namespace content 311 } // namespace content
300 312
301 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ 313 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « base/threading/thread_restrictions.h ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698