| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_DATA_MANAGER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
| 6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 enum DomainBlockStatus { | 51 enum DomainBlockStatus { |
| 52 DOMAIN_BLOCK_STATUS_BLOCKED, | 52 DOMAIN_BLOCK_STATUS_BLOCKED, |
| 53 DOMAIN_BLOCK_STATUS_ALL_DOMAINS_BLOCKED, | 53 DOMAIN_BLOCK_STATUS_ALL_DOMAINS_BLOCKED, |
| 54 DOMAIN_BLOCK_STATUS_NOT_BLOCKED | 54 DOMAIN_BLOCK_STATUS_NOT_BLOCKED |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 // Getter for the singleton. This will return NULL on failure. | 57 // Getter for the singleton. This will return NULL on failure. |
| 58 static GpuDataManagerImpl* GetInstance(); | 58 static GpuDataManagerImpl* GetInstance(); |
| 59 | 59 |
| 60 // GpuDataManager implementation. | 60 // GpuDataManager implementation. |
| 61 virtual void InitializeForTesting( | 61 void InitializeForTesting(const std::string& gpu_blacklist_json, |
| 62 const std::string& gpu_blacklist_json, | 62 const gpu::GPUInfo& gpu_info) override; |
| 63 const gpu::GPUInfo& gpu_info) override; | 63 bool IsFeatureBlacklisted(int feature) const override; |
| 64 virtual bool IsFeatureBlacklisted(int feature) const override; | 64 gpu::GPUInfo GetGPUInfo() const override; |
| 65 virtual gpu::GPUInfo GetGPUInfo() const override; | 65 void GetGpuProcessHandles( |
| 66 virtual void GetGpuProcessHandles( | |
| 67 const GetGpuProcessHandlesCallback& callback) const override; | 66 const GetGpuProcessHandlesCallback& callback) const override; |
| 68 virtual bool GpuAccessAllowed(std::string* reason) const override; | 67 bool GpuAccessAllowed(std::string* reason) const override; |
| 69 virtual void RequestCompleteGpuInfoIfNeeded() override; | 68 void RequestCompleteGpuInfoIfNeeded() override; |
| 70 virtual bool IsEssentialGpuInfoAvailable() const override; | 69 bool IsEssentialGpuInfoAvailable() const override; |
| 71 virtual bool IsCompleteGpuInfoAvailable() const override; | 70 bool IsCompleteGpuInfoAvailable() const override; |
| 72 virtual void RequestVideoMemoryUsageStatsUpdate() const override; | 71 void RequestVideoMemoryUsageStatsUpdate() const override; |
| 73 virtual bool ShouldUseSwiftShader() const override; | 72 bool ShouldUseSwiftShader() const override; |
| 74 virtual void RegisterSwiftShaderPath(const base::FilePath& path) override; | 73 void RegisterSwiftShaderPath(const base::FilePath& path) override; |
| 75 virtual bool ShouldUseWarp() const override; | 74 bool ShouldUseWarp() const override; |
| 76 virtual void AddObserver(GpuDataManagerObserver* observer) override; | 75 void AddObserver(GpuDataManagerObserver* observer) override; |
| 77 virtual void RemoveObserver(GpuDataManagerObserver* observer) override; | 76 void RemoveObserver(GpuDataManagerObserver* observer) override; |
| 78 virtual void UnblockDomainFrom3DAPIs(const GURL& url) override; | 77 void UnblockDomainFrom3DAPIs(const GURL& url) override; |
| 79 virtual void DisableGpuWatchdog() override; | 78 void DisableGpuWatchdog() override; |
| 80 virtual void SetGLStrings(const std::string& gl_vendor, | 79 void SetGLStrings(const std::string& gl_vendor, |
| 81 const std::string& gl_renderer, | 80 const std::string& gl_renderer, |
| 82 const std::string& gl_version) override; | 81 const std::string& gl_version) override; |
| 83 virtual void GetGLStrings(std::string* gl_vendor, | 82 void GetGLStrings(std::string* gl_vendor, |
| 84 std::string* gl_renderer, | 83 std::string* gl_renderer, |
| 85 std::string* gl_version) override; | 84 std::string* gl_version) override; |
| 86 virtual void DisableHardwareAcceleration() override; | 85 void DisableHardwareAcceleration() override; |
| 87 virtual bool CanUseGpuBrowserCompositor() const override; | 86 bool CanUseGpuBrowserCompositor() const override; |
| 88 | 87 |
| 89 // This collects preliminary GPU info, load GpuBlacklist, and compute the | 88 // This collects preliminary GPU info, load GpuBlacklist, and compute the |
| 90 // preliminary blacklisted features; it should only be called at browser | 89 // preliminary blacklisted features; it should only be called at browser |
| 91 // startup time in UI thread before the IO restriction is turned on. | 90 // startup time in UI thread before the IO restriction is turned on. |
| 92 void Initialize(); | 91 void Initialize(); |
| 93 | 92 |
| 94 // Only update if the current GPUInfo is not finalized. If blacklist is | 93 // Only update if the current GPUInfo is not finalized. If blacklist is |
| 95 // loaded, run through blacklist and update blacklisted features. | 94 // loaded, run through blacklist and update blacklisted features. |
| 96 void UpdateGpuInfo(const gpu::GPUInfo& gpu_info); | 95 void UpdateGpuInfo(const gpu::GPUInfo& gpu_info); |
| 97 | 96 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 DCHECK(owner_); | 199 DCHECK(owner_); |
| 201 owner_->lock_.Acquire(); | 200 owner_->lock_.Acquire(); |
| 202 } | 201 } |
| 203 | 202 |
| 204 private: | 203 private: |
| 205 GpuDataManagerImpl* owner_; | 204 GpuDataManagerImpl* owner_; |
| 206 DISALLOW_COPY_AND_ASSIGN(UnlockedSession); | 205 DISALLOW_COPY_AND_ASSIGN(UnlockedSession); |
| 207 }; | 206 }; |
| 208 | 207 |
| 209 GpuDataManagerImpl(); | 208 GpuDataManagerImpl(); |
| 210 virtual ~GpuDataManagerImpl(); | 209 ~GpuDataManagerImpl() override; |
| 211 | 210 |
| 212 mutable base::Lock lock_; | 211 mutable base::Lock lock_; |
| 213 scoped_ptr<GpuDataManagerImplPrivate> private_; | 212 scoped_ptr<GpuDataManagerImplPrivate> private_; |
| 214 | 213 |
| 215 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); | 214 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); |
| 216 }; | 215 }; |
| 217 | 216 |
| 218 } // namespace content | 217 } // namespace content |
| 219 | 218 |
| 220 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ | 219 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
| OLD | NEW |