Chromium Code Reviews| 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 <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 | 165 |
| 166 // Get number of features being blacklisted. | 166 // Get number of features being blacklisted. |
| 167 size_t GetBlacklistedFeatureCount() const; | 167 size_t GetBlacklistedFeatureCount() const; |
| 168 | 168 |
| 169 typedef base::Callback<void()> GpuSwitchCallback; | 169 typedef base::Callback<void()> GpuSwitchCallback; |
| 170 | 170 |
| 171 // Add and remove gpu switch callback. | 171 // Add and remove gpu switch callback. |
| 172 void AddGpuSwitchCallback(const GpuSwitchCallback& callback); | 172 void AddGpuSwitchCallback(const GpuSwitchCallback& callback); |
| 173 void RemoveGpuSwitchCallback(const GpuSwitchCallback& callback); | 173 void RemoveGpuSwitchCallback(const GpuSwitchCallback& callback); |
| 174 | 174 |
| 175 void SetDisplayCount(unsigned int display_count); | |
| 176 unsigned int GetDisplayCount() const; | |
| 177 | |
| 175 private: | 178 private: |
| 176 struct DomainBlockEntry { | 179 struct DomainBlockEntry { |
| 177 DomainGuilt last_guilt; | 180 DomainGuilt last_guilt; |
| 178 }; | 181 }; |
| 179 | 182 |
| 180 typedef std::map<std::string, DomainBlockEntry> DomainBlockMap; | 183 typedef std::map<std::string, DomainBlockEntry> DomainBlockMap; |
| 181 | 184 |
| 182 typedef ObserverListThreadSafe<GpuDataManagerObserver> | 185 typedef ObserverListThreadSafe<GpuDataManagerObserver> |
| 183 GpuDataManagerObserverList; | 186 GpuDataManagerObserverList; |
| 184 | 187 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 | 287 |
| 285 // Number of currently open windows, to be used in gpu memory allocation. | 288 // Number of currently open windows, to be used in gpu memory allocation. |
| 286 int window_count_; | 289 int window_count_; |
| 287 | 290 |
| 288 DomainBlockMap blocked_domains_; | 291 DomainBlockMap blocked_domains_; |
| 289 mutable std::list<base::Time> timestamps_of_gpu_resets_; | 292 mutable std::list<base::Time> timestamps_of_gpu_resets_; |
| 290 bool domain_blocking_enabled_; | 293 bool domain_blocking_enabled_; |
| 291 | 294 |
| 292 std::vector<GpuSwitchCallback> gpu_switch_callbacks_; | 295 std::vector<GpuSwitchCallback> gpu_switch_callbacks_; |
| 293 | 296 |
| 297 #if defined(OS_MACOSX) | |
| 298 // Number of displays, to be used in GPU feature detection. | |
| 299 unsigned int display_count_; | |
|
Ken Russell (switch to Gerrit)
2013/05/08 23:53:24
This won't compile on non-Mac platforms. Given the
| |
| 300 #endif | |
| 301 | |
| 294 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); | 302 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); |
| 295 }; | 303 }; |
| 296 | 304 |
| 297 } // namespace content | 305 } // namespace content |
| 298 | 306 |
| 299 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ | 307 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
| OLD | NEW |