| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // Helper function to send the given message to the GPU process on the IO | 88 // Helper function to send the given message to the GPU process on the IO |
| 89 // thread. Calls Get and if a host is returned, sends it. Can be called from | 89 // thread. Calls Get and if a host is returned, sends it. Can be called from |
| 90 // any thread. Deletes the message if it cannot be sent. | 90 // any thread. Deletes the message if it cannot be sent. |
| 91 CONTENT_EXPORT static void SendOnIO(GpuProcessKind kind, | 91 CONTENT_EXPORT static void SendOnIO(GpuProcessKind kind, |
| 92 CauseForGpuLaunch cause, | 92 CauseForGpuLaunch cause, |
| 93 IPC::Message* message); | 93 IPC::Message* message); |
| 94 | 94 |
| 95 CONTENT_EXPORT static void RegisterGpuMainThreadFactory( | 95 CONTENT_EXPORT static void RegisterGpuMainThreadFactory( |
| 96 GpuMainThreadFactoryFunction create); | 96 GpuMainThreadFactoryFunction create); |
| 97 | 97 |
| 98 // BrowserChildProcessHostDelegate implementation. |
| 99 ServiceRegistry* GetServiceRegistry() override; |
| 100 |
| 98 // Get the GPU process host for the GPU process with the given ID. Returns | 101 // Get the GPU process host for the GPU process with the given ID. Returns |
| 99 // null if the process no longer exists. | 102 // null if the process no longer exists. |
| 100 static GpuProcessHost* FromID(int host_id); | 103 static GpuProcessHost* FromID(int host_id); |
| 101 int host_id() const { return host_id_; } | 104 int host_id() const { return host_id_; } |
| 102 | 105 |
| 103 // IPC::Sender implementation. | 106 // IPC::Sender implementation. |
| 104 bool Send(IPC::Message* msg) override; | 107 bool Send(IPC::Message* msg) override; |
| 105 | 108 |
| 106 // Adds a message filter to the GpuProcessHost's channel. | 109 // Adds a message filter to the GpuProcessHost's channel. |
| 107 void AddFilter(IPC::MessageFilter* filter); | 110 void AddFilter(IPC::MessageFilter* filter); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 167 |
| 165 // Post an IPC message to the UI shim's message handler on the UI thread. | 168 // Post an IPC message to the UI shim's message handler on the UI thread. |
| 166 void RouteOnUIThread(const IPC::Message& message); | 169 void RouteOnUIThread(const IPC::Message& message); |
| 167 | 170 |
| 168 // BrowserChildProcessHostDelegate implementation. | 171 // BrowserChildProcessHostDelegate implementation. |
| 169 bool OnMessageReceived(const IPC::Message& message) override; | 172 bool OnMessageReceived(const IPC::Message& message) override; |
| 170 void OnChannelConnected(int32_t peer_pid) override; | 173 void OnChannelConnected(int32_t peer_pid) override; |
| 171 void OnProcessLaunched() override; | 174 void OnProcessLaunched() override; |
| 172 void OnProcessLaunchFailed() override; | 175 void OnProcessLaunchFailed() override; |
| 173 void OnProcessCrashed(int exit_code) override; | 176 void OnProcessCrashed(int exit_code) override; |
| 174 ServiceRegistry* GetServiceRegistry() override; | |
| 175 | 177 |
| 176 // Message handlers. | 178 // Message handlers. |
| 177 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info); | 179 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info); |
| 178 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); | 180 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); |
| 179 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle); | 181 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle); |
| 180 void OnDidCreateOffscreenContext(const GURL& url); | 182 void OnDidCreateOffscreenContext(const GURL& url); |
| 181 void OnDidLoseContext(bool offscreen, | 183 void OnDidLoseContext(bool offscreen, |
| 182 gpu::error::ContextLostReason reason, | 184 gpu::error::ContextLostReason reason, |
| 183 const GURL& url); | 185 const GURL& url); |
| 184 void OnDidDestroyOffscreenContext(const GURL& url); | 186 void OnDidDestroyOffscreenContext(const GURL& url); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 // Browser-side Mojo endpoint which sets up a Mojo channel with the child | 284 // Browser-side Mojo endpoint which sets up a Mojo channel with the child |
| 283 // process and contains the browser's ServiceRegistry. | 285 // process and contains the browser's ServiceRegistry. |
| 284 scoped_ptr<MojoApplicationHost> mojo_application_host_; | 286 scoped_ptr<MojoApplicationHost> mojo_application_host_; |
| 285 | 287 |
| 286 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 288 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
| 287 }; | 289 }; |
| 288 | 290 |
| 289 } // namespace content | 291 } // namespace content |
| 290 | 292 |
| 291 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 293 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
| OLD | NEW |