| 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_PUBLIC_BROWSER_GPU_DATA_MANAGER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/process/process.h" | 12 #include "base/process/process.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 | 14 |
| 15 class GURL; | 15 class GURL; |
| 16 | 16 |
| 17 namespace gpu { | 17 namespace gpu { |
| 18 struct GPUInfo; | 18 struct GPUInfo; |
| 19 struct VideoMemoryUsageStats; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| 22 | 23 |
| 23 class GpuDataManagerObserver; | 24 class GpuDataManagerObserver; |
| 24 | 25 |
| 25 // This class is fully thread-safe. | 26 // This class is fully thread-safe. |
| 26 class GpuDataManager { | 27 class GpuDataManager { |
| 27 public: | 28 public: |
| 28 // Getter for the singleton. | 29 // Getter for the singleton. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 51 virtual void RequestCompleteGpuInfoIfNeeded() = 0; | 52 virtual void RequestCompleteGpuInfoIfNeeded() = 0; |
| 52 | 53 |
| 53 // Check if basic and context GPU info have been collected. | 54 // Check if basic and context GPU info have been collected. |
| 54 virtual bool IsEssentialGpuInfoAvailable() const = 0; | 55 virtual bool IsEssentialGpuInfoAvailable() const = 0; |
| 55 | 56 |
| 56 // On Windows, besides basic and context GPU info, it also checks if | 57 // On Windows, besides basic and context GPU info, it also checks if |
| 57 // DxDiagnostics have been collected. | 58 // DxDiagnostics have been collected. |
| 58 // On other platforms, it's the same as IsEsentialGpuInfoAvailable(). | 59 // On other platforms, it's the same as IsEsentialGpuInfoAvailable(). |
| 59 virtual bool IsCompleteGpuInfoAvailable() const = 0; | 60 virtual bool IsCompleteGpuInfoAvailable() const = 0; |
| 60 | 61 |
| 61 // Requests that the GPU process report its current video memory usage stats, | 62 // Requests that the GPU process report its current video memory usage stats. |
| 62 // which can be retrieved via the GPU data manager's on-update function. | 63 virtual void RequestVideoMemoryUsageStatsUpdate( |
| 63 virtual void RequestVideoMemoryUsageStatsUpdate() const = 0; | 64 const base::Callback<void(const gpu::VideoMemoryUsageStats& stats)>& |
| 65 callback) const = 0; |
| 64 | 66 |
| 65 // Returns true if SwiftShader should be used. | 67 // Returns true if SwiftShader should be used. |
| 66 virtual bool ShouldUseSwiftShader() const = 0; | 68 virtual bool ShouldUseSwiftShader() const = 0; |
| 67 | 69 |
| 68 // Registers/unregister |observer|. | 70 // Registers/unregister |observer|. |
| 69 virtual void AddObserver(GpuDataManagerObserver* observer) = 0; | 71 virtual void AddObserver(GpuDataManagerObserver* observer) = 0; |
| 70 virtual void RemoveObserver(GpuDataManagerObserver* observer) = 0; | 72 virtual void RemoveObserver(GpuDataManagerObserver* observer) = 0; |
| 71 | 73 |
| 72 // Allows a given domain previously blocked from accessing 3D APIs | 74 // Allows a given domain previously blocked from accessing 3D APIs |
| 73 // to access them again. | 75 // to access them again. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 101 // the backlists decision and applying commandline switches. | 103 // the backlists decision and applying commandline switches. |
| 102 virtual void SetGpuInfo(const gpu::GPUInfo& gpu_info) = 0; | 104 virtual void SetGpuInfo(const gpu::GPUInfo& gpu_info) = 0; |
| 103 | 105 |
| 104 protected: | 106 protected: |
| 105 virtual ~GpuDataManager() {} | 107 virtual ~GpuDataManager() {} |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 }; // namespace content | 110 }; // namespace content |
| 109 | 111 |
| 110 #endif // CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_H_ | 112 #endif // CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_H_ |
| OLD | NEW |