| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 namespace gpu { | 43 namespace gpu { |
| 44 struct GpuPreferences; | 44 struct GpuPreferences; |
| 45 struct SyncToken; | 45 struct SyncToken; |
| 46 } | 46 } |
| 47 | 47 |
| 48 namespace content { | 48 namespace content { |
| 49 class BrowserChildProcessHostImpl; | 49 class BrowserChildProcessHostImpl; |
| 50 class GpuMainThread; | 50 class GpuMainThread; |
| 51 class InProcessChildThreadParams; | 51 class InProcessChildThreadParams; |
| 52 class MojoApplicationHost; | 52 class MojoChildConnection; |
| 53 class RenderWidgetHostViewFrameSubscriber; | 53 class RenderWidgetHostViewFrameSubscriber; |
| 54 class ShaderDiskCache; | 54 class ShaderDiskCache; |
| 55 | 55 |
| 56 typedef base::Thread* (*GpuMainThreadFactoryFunction)( | 56 typedef base::Thread* (*GpuMainThreadFactoryFunction)( |
| 57 const InProcessChildThreadParams&, const gpu::GpuPreferences&); | 57 const InProcessChildThreadParams&, const gpu::GpuPreferences&); |
| 58 | 58 |
| 59 class GpuProcessHost : public BrowserChildProcessHostDelegate, | 59 class GpuProcessHost : public BrowserChildProcessHostDelegate, |
| 60 public IPC::Sender, | 60 public IPC::Sender, |
| 61 public base::NonThreadSafe { | 61 public base::NonThreadSafe { |
| 62 public: | 62 public: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // thread. Calls Get and if a host is returned, sends it. Can be called from | 99 // thread. Calls Get and if a host is returned, sends it. Can be called from |
| 100 // any thread. Deletes the message if it cannot be sent. | 100 // any thread. Deletes the message if it cannot be sent. |
| 101 CONTENT_EXPORT static void SendOnIO(GpuProcessKind kind, | 101 CONTENT_EXPORT static void SendOnIO(GpuProcessKind kind, |
| 102 CauseForGpuLaunch cause, | 102 CauseForGpuLaunch cause, |
| 103 IPC::Message* message); | 103 IPC::Message* message); |
| 104 | 104 |
| 105 CONTENT_EXPORT static void RegisterGpuMainThreadFactory( | 105 CONTENT_EXPORT static void RegisterGpuMainThreadFactory( |
| 106 GpuMainThreadFactoryFunction create); | 106 GpuMainThreadFactoryFunction create); |
| 107 | 107 |
| 108 // BrowserChildProcessHostDelegate implementation. | 108 // BrowserChildProcessHostDelegate implementation. |
| 109 ServiceRegistry* GetServiceRegistry() override; | 109 shell::InterfaceRegistry* GetInterfaceRegistry() override; |
| 110 shell::InterfaceProvider* GetRemoteInterfaces() override; |
| 110 | 111 |
| 111 // Get the GPU process host for the GPU process with the given ID. Returns | 112 // Get the GPU process host for the GPU process with the given ID. Returns |
| 112 // null if the process no longer exists. | 113 // null if the process no longer exists. |
| 113 static GpuProcessHost* FromID(int host_id); | 114 static GpuProcessHost* FromID(int host_id); |
| 114 int host_id() const { return host_id_; } | 115 int host_id() const { return host_id_; } |
| 115 | 116 |
| 116 // IPC::Sender implementation. | 117 // IPC::Sender implementation. |
| 117 bool Send(IPC::Message* msg) override; | 118 bool Send(IPC::Message* msg) override; |
| 118 | 119 |
| 119 // Adds a message filter to the GpuProcessHost's channel. | 120 // Adds a message filter to the GpuProcessHost's channel. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 bool uma_memory_stats_received_; | 294 bool uma_memory_stats_received_; |
| 294 gpu::GPUMemoryUmaStats uma_memory_stats_; | 295 gpu::GPUMemoryUmaStats uma_memory_stats_; |
| 295 | 296 |
| 296 typedef std::map<int32_t, scoped_refptr<ShaderDiskCache>> | 297 typedef std::map<int32_t, scoped_refptr<ShaderDiskCache>> |
| 297 ClientIdToShaderCacheMap; | 298 ClientIdToShaderCacheMap; |
| 298 ClientIdToShaderCacheMap client_id_to_shader_cache_; | 299 ClientIdToShaderCacheMap client_id_to_shader_cache_; |
| 299 | 300 |
| 300 std::string shader_prefix_key_; | 301 std::string shader_prefix_key_; |
| 301 | 302 |
| 302 // Browser-side Mojo endpoint which sets up a Mojo channel with the child | 303 // Browser-side Mojo endpoint which sets up a Mojo channel with the child |
| 303 // process and contains the browser's ServiceRegistry. | 304 // process and contains the browser's shell::InterfaceRegistry. |
| 304 const std::string child_token_; | 305 const std::string child_token_; |
| 305 std::unique_ptr<MojoApplicationHost> mojo_application_host_; | 306 std::unique_ptr<MojoChildConnection> mojo_child_connection_; |
| 306 | 307 |
| 307 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 308 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
| 308 }; | 309 }; |
| 309 | 310 |
| 310 } // namespace content | 311 } // namespace content |
| 311 | 312 |
| 312 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 313 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
| OLD | NEW |