| 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 CHROME_BROWSER_GPU_BLACKLIST_H_ | 5 #ifndef CHROME_BROWSER_GPU_BLACKLIST_H_ |
| 6 #define CHROME_BROWSER_GPU_BLACKLIST_H_ | 6 #define CHROME_BROWSER_GPU_BLACKLIST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 class GpuBlacklistEntry; | 223 class GpuBlacklistEntry; |
| 224 typedef scoped_refptr<GpuBlacklistEntry> ScopedGpuBlacklistEntry; | 224 typedef scoped_refptr<GpuBlacklistEntry> ScopedGpuBlacklistEntry; |
| 225 | 225 |
| 226 class GpuBlacklistEntry : public base::RefCounted<GpuBlacklistEntry> { | 226 class GpuBlacklistEntry : public base::RefCounted<GpuBlacklistEntry> { |
| 227 public: | 227 public: |
| 228 // Constructs GpuBlacklistEntry from DictionaryValue loaded from json. | 228 // Constructs GpuBlacklistEntry from DictionaryValue loaded from json. |
| 229 // Top-level entry must have an id number. Others are exceptions. | 229 // Top-level entry must have an id number. Others are exceptions. |
| 230 static ScopedGpuBlacklistEntry GetGpuBlacklistEntryFromValue( | 230 static ScopedGpuBlacklistEntry GetGpuBlacklistEntryFromValue( |
| 231 base::DictionaryValue* value, bool top_level); | 231 const base::DictionaryValue* value, bool top_level); |
| 232 | 232 |
| 233 // Determines if a given os/gc/driver is included in the Entry set. | 233 // Determines if a given os/gc/driver is included in the Entry set. |
| 234 bool Contains(OsType os_type, | 234 bool Contains(OsType os_type, |
| 235 const Version& os_version, | 235 const Version& os_version, |
| 236 const content::GPUInfo& gpu_info) const; | 236 const content::GPUInfo& gpu_info) const; |
| 237 | 237 |
| 238 // Returns the OsType. | 238 // Returns the OsType. |
| 239 OsType GetOsType() const; | 239 OsType GetOsType() const; |
| 240 | 240 |
| 241 // Returns the entry's unique id. 0 is reserved. | 241 // Returns the entry's unique id. 0 is reserved. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 374 |
| 375 bool LoadGpuBlacklist(const base::DictionaryValue& parsed_json, | 375 bool LoadGpuBlacklist(const base::DictionaryValue& parsed_json, |
| 376 OsFilter os_filter); | 376 OsFilter os_filter); |
| 377 | 377 |
| 378 void Clear(); | 378 void Clear(); |
| 379 | 379 |
| 380 // Check if the entry is supported by the current version of browser. | 380 // Check if the entry is supported by the current version of browser. |
| 381 // By default, if there is no browser version information in the entry, | 381 // By default, if there is no browser version information in the entry, |
| 382 // return kSupported; | 382 // return kSupported; |
| 383 BrowserVersionSupport IsEntrySupportedByCurrentBrowserVersion( | 383 BrowserVersionSupport IsEntrySupportedByCurrentBrowserVersion( |
| 384 base::DictionaryValue* value); | 384 const base::DictionaryValue* value); |
| 385 | 385 |
| 386 // GpuDataManager::Observer implementation. | 386 // GpuDataManager::Observer implementation. |
| 387 virtual void OnGpuInfoUpdate() OVERRIDE; | 387 virtual void OnGpuInfoUpdate() OVERRIDE; |
| 388 | 388 |
| 389 // Returns the number of entries. This is only for tests. | 389 // Returns the number of entries. This is only for tests. |
| 390 size_t num_entries() const; | 390 size_t num_entries() const; |
| 391 | 391 |
| 392 // Check if any entries contain unknown fields. This is only for tests. | 392 // Check if any entries contain unknown fields. This is only for tests. |
| 393 bool contains_unknown_fields() const { return contains_unknown_fields_; } | 393 bool contains_unknown_fields() const { return contains_unknown_fields_; } |
| 394 | 394 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 405 std::vector<ScopedGpuBlacklistEntry> active_entries_; | 405 std::vector<ScopedGpuBlacklistEntry> active_entries_; |
| 406 | 406 |
| 407 uint32 max_entry_id_; | 407 uint32 max_entry_id_; |
| 408 | 408 |
| 409 bool contains_unknown_fields_; | 409 bool contains_unknown_fields_; |
| 410 | 410 |
| 411 DISALLOW_COPY_AND_ASSIGN(GpuBlacklist); | 411 DISALLOW_COPY_AND_ASSIGN(GpuBlacklist); |
| 412 }; | 412 }; |
| 413 | 413 |
| 414 #endif // CHROME_BROWSER_GPU_BLACKLIST_H_ | 414 #endif // CHROME_BROWSER_GPU_BLACKLIST_H_ |
| OLD | NEW |