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_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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 class CommandLine; | 24 class CommandLine; |
25 | 25 |
26 class CONTENT_EXPORT GpuDataManagerImpl | 26 class CONTENT_EXPORT GpuDataManagerImpl |
27 : public NON_EXPORTED_BASE(content::GpuDataManager) { | 27 : public NON_EXPORTED_BASE(content::GpuDataManager) { |
28 public: | 28 public: |
29 // Getter for the singleton. This will return NULL on failure. | 29 // Getter for the singleton. This will return NULL on failure. |
30 static GpuDataManagerImpl* GetInstance(); | 30 static GpuDataManagerImpl* GetInstance(); |
31 | 31 |
32 // GpuDataManager implementation. | 32 // GpuDataManager implementation. |
| 33 virtual void Initialize() OVERRIDE; |
33 virtual void Initialize( | 34 virtual void Initialize( |
34 const std::string& browser_version_string, | |
35 const std::string& gpu_blacklist_json) OVERRIDE; | |
36 virtual void Initialize( | |
37 const std::string& browser_version_string, | |
38 const std::string& gpu_blacklist_json, | 35 const std::string& gpu_blacklist_json, |
39 const content::GPUInfo& gpu_info) OVERRIDE; | 36 const content::GPUInfo& gpu_info) OVERRIDE; |
40 virtual content::GpuFeatureType GetBlacklistedFeatures() const OVERRIDE; | 37 virtual content::GpuFeatureType GetBlacklistedFeatures() const OVERRIDE; |
41 virtual content::GpuSwitchingOption GetGpuSwitchingOption() const OVERRIDE; | 38 virtual content::GpuSwitchingOption GetGpuSwitchingOption() const OVERRIDE; |
42 virtual base::ListValue* GetBlacklistReasons() const OVERRIDE; | 39 virtual base::ListValue* GetBlacklistReasons() const OVERRIDE; |
43 virtual std::string GetBlacklistVersion() const OVERRIDE; | 40 virtual std::string GetBlacklistVersion() const OVERRIDE; |
44 virtual content::GPUInfo GetGPUInfo() const OVERRIDE; | 41 virtual content::GPUInfo GetGPUInfo() const OVERRIDE; |
45 virtual bool GpuAccessAllowed() const OVERRIDE; | 42 virtual bool GpuAccessAllowed() const OVERRIDE; |
46 virtual void RequestCompleteGpuInfoIfNeeded() OVERRIDE; | 43 virtual void RequestCompleteGpuInfoIfNeeded() OVERRIDE; |
47 virtual bool IsCompleteGpuInfoAvailable() const OVERRIDE; | 44 virtual bool IsCompleteGpuInfoAvailable() const OVERRIDE; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, GpuSideBlacklisting); | 91 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, GpuSideBlacklisting); |
95 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, GpuSideExceptions); | 92 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, GpuSideExceptions); |
96 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, BlacklistCard); | 93 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, BlacklistCard); |
97 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, GpuInfoUpdate); | 94 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, GpuInfoUpdate); |
98 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, | 95 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, |
99 GPUVideoMemoryUsageStatsUpdate); | 96 GPUVideoMemoryUsageStatsUpdate); |
100 | 97 |
101 GpuDataManagerImpl(); | 98 GpuDataManagerImpl(); |
102 virtual ~GpuDataManagerImpl(); | 99 virtual ~GpuDataManagerImpl(); |
103 | 100 |
| 101 void InitializeImpl(const std::string& gpu_blacklist_json, |
| 102 const content::GPUInfo& gpu_info); |
| 103 |
104 void UpdateBlacklistedFeatures(content::GpuFeatureType features); | 104 void UpdateBlacklistedFeatures(content::GpuFeatureType features); |
105 | 105 |
106 // This should only be called once at initialization time, when preliminary | 106 // This should only be called once at initialization time, when preliminary |
107 // gpu info is collected. | 107 // gpu info is collected. |
108 void UpdatePreliminaryBlacklistedFeatures(); | 108 void UpdatePreliminaryBlacklistedFeatures(); |
109 | 109 |
110 // Notify all observers whenever there is a GPU info update. | 110 // Notify all observers whenever there is a GPU info update. |
111 void NotifyGpuInfoUpdate(); | 111 void NotifyGpuInfoUpdate(); |
112 | 112 |
113 // Try to switch to software rendering, if possible and necessary. | 113 // Try to switch to software rendering, if possible and necessary. |
(...skipping 28 matching lines...) Expand all Loading... |
142 bool card_blacklisted_; | 142 bool card_blacklisted_; |
143 | 143 |
144 // We disable histogram stuff in testing, especially in unit tests because | 144 // We disable histogram stuff in testing, especially in unit tests because |
145 // they cause random failures. | 145 // they cause random failures. |
146 bool update_histograms_; | 146 bool update_histograms_; |
147 | 147 |
148 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); | 148 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); |
149 }; | 149 }; |
150 | 150 |
151 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ | 151 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
OLD | NEW |