| 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 <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 Loading... |
| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 180 |
| 178 // Post an IPC message to the UI shim's message handler on the UI thread. | 181 // Post an IPC message to the UI shim's message handler on the UI thread. |
| 179 void RouteOnUIThread(const IPC::Message& message); | 182 void RouteOnUIThread(const IPC::Message& message); |
| 180 | 183 |
| 181 // BrowserChildProcessHostDelegate implementation. | 184 // BrowserChildProcessHostDelegate implementation. |
| 182 bool OnMessageReceived(const IPC::Message& message) override; | 185 bool OnMessageReceived(const IPC::Message& message) override; |
| 183 void OnChannelConnected(int32_t peer_pid) override; | 186 void OnChannelConnected(int32_t peer_pid) override; |
| 184 void OnProcessLaunched() override; | 187 void OnProcessLaunched() override; |
| 185 void OnProcessLaunchFailed() override; | 188 void OnProcessLaunchFailed() override; |
| 186 void OnProcessCrashed(int exit_code) override; | 189 void OnProcessCrashed(int exit_code) override; |
| 187 ServiceRegistry* GetServiceRegistry() override; | |
| 188 | 190 |
| 189 // Message handlers. | 191 // Message handlers. |
| 190 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info); | 192 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info); |
| 191 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); | 193 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); |
| 192 void OnCommandBufferCreated(CreateCommandBufferResult result); | 194 void OnCommandBufferCreated(CreateCommandBufferResult result); |
| 193 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle); | 195 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle); |
| 194 void OnDidCreateOffscreenContext(const GURL& url); | 196 void OnDidCreateOffscreenContext(const GURL& url); |
| 195 void OnDidLoseContext(bool offscreen, | 197 void OnDidLoseContext(bool offscreen, |
| 196 gpu::error::ContextLostReason reason, | 198 gpu::error::ContextLostReason reason, |
| 197 const GURL& url); | 199 const GURL& url); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 // Browser-side Mojo endpoint which sets up a Mojo channel with the child | 301 // Browser-side Mojo endpoint which sets up a Mojo channel with the child |
| 300 // process and contains the browser's ServiceRegistry. | 302 // process and contains the browser's ServiceRegistry. |
| 301 scoped_ptr<MojoApplicationHost> mojo_application_host_; | 303 scoped_ptr<MojoApplicationHost> mojo_application_host_; |
| 302 | 304 |
| 303 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 305 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
| 304 }; | 306 }; |
| 305 | 307 |
| 306 } // namespace content | 308 } // namespace content |
| 307 | 309 |
| 308 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 310 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
| OLD | NEW |