| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // while processing the request (e.g. the gpu process | 72 // while processing the request (e.g. the gpu process |
| 73 // may have been killed). The caller should normally | 73 // may have been killed). The caller should normally |
| 74 // make another request to establish a new channel. | 74 // make another request to establish a new channel. |
| 75 SUCCESS | 75 SUCCESS |
| 76 }; | 76 }; |
| 77 using EstablishChannelCallback = | 77 using EstablishChannelCallback = |
| 78 base::Callback<void(const IPC::ChannelHandle&, | 78 base::Callback<void(const IPC::ChannelHandle&, |
| 79 const gpu::GPUInfo&, | 79 const gpu::GPUInfo&, |
| 80 EstablishChannelStatus status)>; | 80 EstablishChannelStatus status)>; |
| 81 | 81 |
| 82 typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)> | 82 enum class BufferCreationStatus { |
| 83 CreateGpuMemoryBufferCallback; | 83 GPU_HOST_INVALID, |
| 84 SUCCESS, |
| 85 }; |
| 86 using CreateGpuMemoryBufferCallback = |
| 87 base::Callback<void(const gfx::GpuMemoryBufferHandle& handle, |
| 88 BufferCreationStatus status)>; |
| 84 | 89 |
| 85 static bool gpu_enabled() { return gpu_enabled_; } | 90 static bool gpu_enabled() { return gpu_enabled_; } |
| 86 static int gpu_crash_count() { return gpu_crash_count_; } | 91 static int gpu_crash_count() { return gpu_crash_count_; } |
| 87 | 92 |
| 88 // Creates a new GpuProcessHost (if |force_create| is turned on) or gets an | 93 // Creates a new GpuProcessHost (if |force_create| is turned on) or gets an |
| 89 // existing one, resulting in the launching of a GPU process if required. | 94 // existing one, resulting in the launching of a GPU process if required. |
| 90 // Returns null on failure. It is not safe to store the pointer once control | 95 // Returns null on failure. It is not safe to store the pointer once control |
| 91 // has returned to the message loop as it can be destroyed. Instead store the | 96 // has returned to the message loop as it can be destroyed. Instead store the |
| 92 // associated GPU host ID. This could return NULL if GPU access is not | 97 // associated GPU host ID. This could return NULL if GPU access is not |
| 93 // allowed (blacklisted). | 98 // allowed (blacklisted). |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 gpu::GpuProcessHostActivityFlags activity_flags_; | 300 gpu::GpuProcessHostActivityFlags activity_flags_; |
| 296 | 301 |
| 297 base::WeakPtrFactory<GpuProcessHost> weak_ptr_factory_; | 302 base::WeakPtrFactory<GpuProcessHost> weak_ptr_factory_; |
| 298 | 303 |
| 299 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 304 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
| 300 }; | 305 }; |
| 301 | 306 |
| 302 } // namespace content | 307 } // namespace content |
| 303 | 308 |
| 304 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 309 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
| OLD | NEW |