| 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 GPU_CONFIG_GPU_CONTROL_LIST_H_ | 5 #ifndef GPU_CONFIG_GPU_CONTROL_LIST_H_ |
| 6 #define GPU_CONFIG_GPU_CONTROL_LIST_H_ | 6 #define GPU_CONFIG_GPU_CONTROL_LIST_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 bool contains_unknown_fields() const { return contains_unknown_fields_; } | 89 bool contains_unknown_fields() const { return contains_unknown_fields_; } |
| 90 | 90 |
| 91 // Returns the number of entries. This is only for tests. | 91 // Returns the number of entries. This is only for tests. |
| 92 size_t num_entries() const; | 92 size_t num_entries() const; |
| 93 | 93 |
| 94 // Register a feature to FeatureMap - used to construct a GpuControlList. | 94 // Register a feature to FeatureMap - used to construct a GpuControlList. |
| 95 void AddSupportedFeature(const std::string& feature_name, int feature_id); | 95 void AddSupportedFeature(const std::string& feature_name, int feature_id); |
| 96 // Register whether "all" is recognized as all features. | 96 // Register whether "all" is recognized as all features. |
| 97 void set_supports_feature_type_all(bool supported); | 97 void set_supports_feature_type_all(bool supported); |
| 98 | 98 |
| 99 // Enables logging of control list decisions. | |
| 100 void enable_control_list_logging() { control_list_logging_enabled_ = true; } | |
| 101 | |
| 102 private: | 99 private: |
| 103 friend class GpuControlListEntryTest; | 100 friend class GpuControlListEntryTest; |
| 104 friend class MachineModelInfoTest; | 101 friend class MachineModelInfoTest; |
| 105 friend class NumberInfoTest; | 102 friend class NumberInfoTest; |
| 106 friend class OsInfoTest; | 103 friend class OsInfoTest; |
| 107 friend class StringInfoTest; | 104 friend class StringInfoTest; |
| 108 friend class VersionInfoTest; | 105 friend class VersionInfoTest; |
| 109 | 106 |
| 110 enum BrowserVersionSupport { | 107 enum BrowserVersionSupport { |
| 111 kSupported, | 108 kSupported, |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 class GPU_EXPORT GpuControlListEntry | 285 class GPU_EXPORT GpuControlListEntry |
| 289 : public base::RefCounted<GpuControlListEntry> { | 286 : public base::RefCounted<GpuControlListEntry> { |
| 290 public: | 287 public: |
| 291 // Constructs GpuControlListEntry from DictionaryValue loaded from json. | 288 // Constructs GpuControlListEntry from DictionaryValue loaded from json. |
| 292 // Top-level entry must have an id number. Others are exceptions. | 289 // Top-level entry must have an id number. Others are exceptions. |
| 293 static ScopedGpuControlListEntry GetEntryFromValue( | 290 static ScopedGpuControlListEntry GetEntryFromValue( |
| 294 const base::DictionaryValue* value, bool top_level, | 291 const base::DictionaryValue* value, bool top_level, |
| 295 const FeatureMap& feature_map, | 292 const FeatureMap& feature_map, |
| 296 bool supports_feature_type_all); | 293 bool supports_feature_type_all); |
| 297 | 294 |
| 298 // Logs a control list match for this rule. | |
| 299 void LogControlListMatch() const; | |
| 300 | |
| 301 // Determines if a given os/gc/machine_model/driver is included in the | 295 // Determines if a given os/gc/machine_model/driver is included in the |
| 302 // Entry set. | 296 // Entry set. |
| 303 bool Contains(OsType os_type, const std::string& os_version, | 297 bool Contains(OsType os_type, const std::string& os_version, |
| 304 const GPUInfo& gpu_info) const; | 298 const GPUInfo& gpu_info) const; |
| 305 | 299 |
| 306 // Determines whether we needs more gpu info to make the blacklisting | 300 // Determines whether we needs more gpu info to make the blacklisting |
| 307 // decision. It should only be checked if Contains() returns true. | 301 // decision. It should only be checked if Contains() returns true. |
| 308 bool NeedsMoreInfo(const GPUInfo& gpu_info) const; | 302 bool NeedsMoreInfo(const GPUInfo& gpu_info) const; |
| 309 | 303 |
| 310 // Returns the OsType. | 304 // Returns the OsType. |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 | 488 |
| 495 uint32 max_entry_id_; | 489 uint32 max_entry_id_; |
| 496 | 490 |
| 497 bool contains_unknown_fields_; | 491 bool contains_unknown_fields_; |
| 498 | 492 |
| 499 bool needs_more_info_; | 493 bool needs_more_info_; |
| 500 | 494 |
| 501 // The features a GpuControlList recognizes and handles. | 495 // The features a GpuControlList recognizes and handles. |
| 502 FeatureMap feature_map_; | 496 FeatureMap feature_map_; |
| 503 bool supports_feature_type_all_; | 497 bool supports_feature_type_all_; |
| 504 | |
| 505 bool control_list_logging_enabled_; | |
| 506 }; | 498 }; |
| 507 | 499 |
| 508 } // namespace gpu | 500 } // namespace gpu |
| 509 | 501 |
| 510 #endif // GPU_CONFIG_GPU_CONTROL_LIST_H_ | 502 #endif // GPU_CONFIG_GPU_CONTROL_LIST_H_ |
| 511 | 503 |
| OLD | NEW |