| 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 <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/singleton.h" | 16 #include "base/memory/singleton.h" |
| 17 #include "base/observer_list_threadsafe.h" | 17 #include "base/observer_list_threadsafe.h" |
| 18 #include "base/process_util.h" | 18 #include "base/process_util.h" |
| 19 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
| 20 #include "base/time.h" | 20 #include "base/time.h" |
| 21 #include "base/values.h" | 21 #include "base/values.h" |
| 22 #include "content/browser/gpu/gpu_blacklist.h" | 22 #include "content/browser/gpu/gpu_blacklist.h" |
| 23 #include "content/browser/gpu/gpu_driver_bug_list.h" |
| 24 #include "content/browser/gpu/gpu_switching_list.h" |
| 23 #include "content/public/browser/gpu_data_manager.h" | 25 #include "content/public/browser/gpu_data_manager.h" |
| 24 #include "content/public/common/gpu_info.h" | 26 #include "content/public/common/gpu_info.h" |
| 25 #include "content/public/common/gpu_memory_stats.h" | 27 #include "content/public/common/gpu_memory_stats.h" |
| 26 #include "content/public/common/three_d_api_types.h" | 28 #include "content/public/common/three_d_api_types.h" |
| 27 | 29 |
| 28 class CommandLine; | 30 class CommandLine; |
| 29 class GURL; | 31 class GURL; |
| 30 | 32 |
| 31 namespace content { | 33 namespace content { |
| 32 | 34 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 UnblockDomainOfUnknownGuiltFrom3DAPIs); | 187 UnblockDomainOfUnknownGuiltFrom3DAPIs); |
| 186 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, | 188 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, |
| 187 UnblockOtherDomainFrom3DAPIs); | 189 UnblockOtherDomainFrom3DAPIs); |
| 188 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, | 190 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplTest, |
| 189 UnblockThisDomainFrom3DAPIs); | 191 UnblockThisDomainFrom3DAPIs); |
| 190 | 192 |
| 191 GpuDataManagerImpl(); | 193 GpuDataManagerImpl(); |
| 192 virtual ~GpuDataManagerImpl(); | 194 virtual ~GpuDataManagerImpl(); |
| 193 | 195 |
| 194 void InitializeImpl(const std::string& gpu_blacklist_json, | 196 void InitializeImpl(const std::string& gpu_blacklist_json, |
| 197 const std::string& gpu_switching_list_json, |
| 198 const std::string& gpu_driver_bug_list_json, |
| 195 const GPUInfo& gpu_info); | 199 const GPUInfo& gpu_info); |
| 196 | 200 |
| 197 void UpdateBlacklistedFeatures(GpuFeatureType features); | 201 void UpdateBlacklistedFeatures(GpuFeatureType features); |
| 198 | 202 |
| 199 // This should only be called once at initialization time, when preliminary | 203 // This should only be called once at initialization time, when preliminary |
| 200 // gpu info is collected. | 204 // gpu info is collected. |
| 201 void UpdatePreliminaryBlacklistedFeatures(); | 205 void UpdatePreliminaryBlacklistedFeatures(); |
| 202 | 206 |
| 203 // Update the GPU switching status. | 207 // Update the GPU switching status. |
| 204 // This should only be called once at initialization time. | 208 // This should only be called once at initialization time. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 226 int render_view_id, | 230 int render_view_id, |
| 227 ThreeDAPIType requester); | 231 ThreeDAPIType requester); |
| 228 | 232 |
| 229 bool complete_gpu_info_already_requested_; | 233 bool complete_gpu_info_already_requested_; |
| 230 | 234 |
| 231 GpuFeatureType blacklisted_features_; | 235 GpuFeatureType blacklisted_features_; |
| 232 GpuFeatureType preliminary_blacklisted_features_; | 236 GpuFeatureType preliminary_blacklisted_features_; |
| 233 | 237 |
| 234 GpuSwitchingOption gpu_switching_; | 238 GpuSwitchingOption gpu_switching_; |
| 235 | 239 |
| 240 int gpu_driver_bugs_; |
| 241 |
| 236 GPUInfo gpu_info_; | 242 GPUInfo gpu_info_; |
| 237 mutable base::Lock gpu_info_lock_; | 243 mutable base::Lock gpu_info_lock_; |
| 238 | 244 |
| 239 scoped_ptr<GpuBlacklist> gpu_blacklist_; | 245 scoped_ptr<GpuBlacklist> gpu_blacklist_; |
| 246 scoped_ptr<GpuSwitchingList> gpu_switching_list_; |
| 247 scoped_ptr<GpuDriverBugList> gpu_driver_bug_list_; |
| 240 | 248 |
| 241 const scoped_refptr<GpuDataManagerObserverList> observer_list_; | 249 const scoped_refptr<GpuDataManagerObserverList> observer_list_; |
| 242 | 250 |
| 243 ListValue log_messages_; | 251 ListValue log_messages_; |
| 244 mutable base::Lock log_messages_lock_; | 252 mutable base::Lock log_messages_lock_; |
| 245 | 253 |
| 246 bool software_rendering_; | 254 bool software_rendering_; |
| 247 | 255 |
| 248 base::FilePath swiftshader_path_; | 256 base::FilePath swiftshader_path_; |
| 249 | 257 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 261 DomainBlockMap blocked_domains_; | 269 DomainBlockMap blocked_domains_; |
| 262 mutable std::list<base::Time> timestamps_of_gpu_resets_; | 270 mutable std::list<base::Time> timestamps_of_gpu_resets_; |
| 263 bool domain_blocking_enabled_; | 271 bool domain_blocking_enabled_; |
| 264 | 272 |
| 265 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); | 273 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); |
| 266 }; | 274 }; |
| 267 | 275 |
| 268 } // namespace content | 276 } // namespace content |
| 269 | 277 |
| 270 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ | 278 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
| OLD | NEW |