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

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

Issue 1646853002: Add embedder api for participating in gpu logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // Helper function to send the given message to the GPU process on the IO 92 // Helper function to send the given message to the GPU process on the IO
93 // thread. Calls Get and if a host is returned, sends it. Can be called from 93 // thread. Calls Get and if a host is returned, sends it. Can be called from
94 // any thread. Deletes the message if it cannot be sent. 94 // any thread. Deletes the message if it cannot be sent.
95 CONTENT_EXPORT static void SendOnIO(GpuProcessKind kind, 95 CONTENT_EXPORT static void SendOnIO(GpuProcessKind kind,
96 CauseForGpuLaunch cause, 96 CauseForGpuLaunch cause,
97 IPC::Message* message); 97 IPC::Message* message);
98 98
99 CONTENT_EXPORT static void RegisterGpuMainThreadFactory( 99 CONTENT_EXPORT static void RegisterGpuMainThreadFactory(
100 GpuMainThreadFactoryFunction create); 100 GpuMainThreadFactoryFunction create);
101 101
102 // BrowserChildProcessHostDelegate implementation.
103 ServiceRegistry* GetServiceRegistry() override;
104
102 // Get the GPU process host for the GPU process with the given ID. Returns 105 // Get the GPU process host for the GPU process with the given ID. Returns
103 // null if the process no longer exists. 106 // null if the process no longer exists.
104 static GpuProcessHost* FromID(int host_id); 107 static GpuProcessHost* FromID(int host_id);
105 int host_id() const { return host_id_; } 108 int host_id() const { return host_id_; }
106 109
107 // IPC::Sender implementation. 110 // IPC::Sender implementation.
108 bool Send(IPC::Message* msg) override; 111 bool Send(IPC::Message* msg) override;
109 112
110 // Adds a message filter to the GpuProcessHost's channel. 113 // Adds a message filter to the GpuProcessHost's channel.
111 void AddFilter(IPC::MessageFilter* filter); 114 void AddFilter(IPC::MessageFilter* filter);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 184
182 // Post an IPC message to the UI shim's message handler on the UI thread. 185 // Post an IPC message to the UI shim's message handler on the UI thread.
183 void RouteOnUIThread(const IPC::Message& message); 186 void RouteOnUIThread(const IPC::Message& message);
184 187
185 // BrowserChildProcessHostDelegate implementation. 188 // BrowserChildProcessHostDelegate implementation.
186 bool OnMessageReceived(const IPC::Message& message) override; 189 bool OnMessageReceived(const IPC::Message& message) override;
187 void OnChannelConnected(int32_t peer_pid) override; 190 void OnChannelConnected(int32_t peer_pid) override;
188 void OnProcessLaunched() override; 191 void OnProcessLaunched() override;
189 void OnProcessLaunchFailed() override; 192 void OnProcessLaunchFailed() override;
190 void OnProcessCrashed(int exit_code) override; 193 void OnProcessCrashed(int exit_code) override;
191 ServiceRegistry* GetServiceRegistry() override;
192 194
193 // Message handlers. 195 // Message handlers.
194 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info); 196 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info);
195 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); 197 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle);
196 void OnCommandBufferCreated(CreateCommandBufferResult result); 198 void OnCommandBufferCreated(CreateCommandBufferResult result);
197 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle); 199 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle);
198 void OnDidCreateOffscreenContext(const GURL& url); 200 void OnDidCreateOffscreenContext(const GURL& url);
199 void OnDidLoseContext(bool offscreen, 201 void OnDidLoseContext(bool offscreen,
200 gpu::error::ContextLostReason reason, 202 gpu::error::ContextLostReason reason,
201 const GURL& url); 203 const GURL& url);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 // Browser-side Mojo endpoint which sets up a Mojo channel with the child 305 // Browser-side Mojo endpoint which sets up a Mojo channel with the child
304 // process and contains the browser's ServiceRegistry. 306 // process and contains the browser's ServiceRegistry.
305 scoped_ptr<MojoApplicationHost> mojo_application_host_; 307 scoped_ptr<MojoApplicationHost> mojo_application_host_;
306 308
307 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); 309 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost);
308 }; 310 };
309 311
310 } // namespace content 312 } // namespace content
311 313
312 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ 314 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698