| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 namespace IPC { | 45 namespace IPC { |
| 46 struct ChannelHandle; | 46 struct ChannelHandle; |
| 47 } | 47 } |
| 48 | 48 |
| 49 namespace gpu { | 49 namespace gpu { |
| 50 struct GpuPreferences; | 50 struct GpuPreferences; |
| 51 class ShaderDiskCache; | 51 class ShaderDiskCache; |
| 52 struct SyncToken; | 52 struct SyncToken; |
| 53 } | 53 } |
| 54 | 54 |
| 55 namespace service_manager { | |
| 56 class InterfaceProvider; | |
| 57 } | |
| 58 | |
| 59 namespace content { | 55 namespace content { |
| 60 class BrowserChildProcessHostImpl; | 56 class BrowserChildProcessHostImpl; |
| 61 | 57 |
| 62 class GpuProcessHost : public BrowserChildProcessHostDelegate, | 58 class GpuProcessHost : public BrowserChildProcessHostDelegate, |
| 63 public IPC::Sender, | 59 public IPC::Sender, |
| 64 public ui::mojom::GpuHost, | 60 public ui::mojom::GpuHost, |
| 65 public base::NonThreadSafe { | 61 public base::NonThreadSafe { |
| 66 public: | 62 public: |
| 67 enum GpuProcessKind { | 63 enum GpuProcessKind { |
| 68 GPU_PROCESS_KIND_UNSANDBOXED, | 64 GPU_PROCESS_KIND_UNSANDBOXED, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 99 |
| 104 // Helper function to run a callback on the IO thread. The callback receives | 100 // Helper function to run a callback on the IO thread. The callback receives |
| 105 // the appropriate GpuProcessHost instance. Note that the callback can be | 101 // the appropriate GpuProcessHost instance. Note that the callback can be |
| 106 // called with a null host (e.g. when |force_create| is false, and no | 102 // called with a null host (e.g. when |force_create| is false, and no |
| 107 // GpuProcessHost instance exists). | 103 // GpuProcessHost instance exists). |
| 108 CONTENT_EXPORT static void CallOnIO( | 104 CONTENT_EXPORT static void CallOnIO( |
| 109 GpuProcessKind kind, | 105 GpuProcessKind kind, |
| 110 bool force_create, | 106 bool force_create, |
| 111 const base::Callback<void(GpuProcessHost*)>& callback); | 107 const base::Callback<void(GpuProcessHost*)>& callback); |
| 112 | 108 |
| 113 service_manager::InterfaceProvider* GetRemoteInterfaces(); | 109 void BindInterface(const std::string& interface_name, |
| 110 mojo::ScopedMessagePipeHandle interface_pipe); |
| 114 | 111 |
| 115 // 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 |
| 116 // null if the process no longer exists. | 113 // null if the process no longer exists. |
| 117 static GpuProcessHost* FromID(int host_id); | 114 static GpuProcessHost* FromID(int host_id); |
| 118 int host_id() const { return host_id_; } | 115 int host_id() const { return host_id_; } |
| 119 | 116 |
| 120 // IPC::Sender implementation. | 117 // IPC::Sender implementation. |
| 121 bool Send(IPC::Message* msg) override; | 118 bool Send(IPC::Message* msg) override; |
| 122 | 119 |
| 123 // Adds a message filter to the GpuProcessHost's channel. | 120 // Adds a message filter to the GpuProcessHost's channel. |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 gpu::GpuProcessHostActivityFlags activity_flags_; | 297 gpu::GpuProcessHostActivityFlags activity_flags_; |
| 301 | 298 |
| 302 base::WeakPtrFactory<GpuProcessHost> weak_ptr_factory_; | 299 base::WeakPtrFactory<GpuProcessHost> weak_ptr_factory_; |
| 303 | 300 |
| 304 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 301 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
| 305 }; | 302 }; |
| 306 | 303 |
| 307 } // namespace content | 304 } // namespace content |
| 308 | 305 |
| 309 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 306 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
| OLD | NEW |