Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: content/browser/gpu/gpu_blacklist.h

Issue 7982034: Add a "disabled" field for GPU Blacklist entries. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_BLACKLIST_H_ 5 #ifndef CONTENT_BROWSER_GPU_GPU_BLACKLIST_H_
6 #define CONTENT_BROWSER_GPU_GPU_BLACKLIST_H_ 6 #define CONTENT_BROWSER_GPU_GPU_BLACKLIST_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 // Collects the entries that set the "feature" flag from the last 62 // Collects the entries that set the "feature" flag from the last
63 // DetermineGpuFeatureFlags() call. This tells which entries are responsible 63 // DetermineGpuFeatureFlags() call. This tells which entries are responsible
64 // for raising a certain flag, i.e, for blacklisting a certain feature. 64 // for raising a certain flag, i.e, for blacklisting a certain feature.
65 // Examples of "feature": 65 // Examples of "feature":
66 // kGpuFeatureAll - any of the supported features; 66 // kGpuFeatureAll - any of the supported features;
67 // kGpuFeatureWebgl - a single feature; 67 // kGpuFeatureWebgl - a single feature;
68 // kGpuFeatureWebgl | kGpuFeatureAcceleratedCompositing - two features. 68 // kGpuFeatureWebgl | kGpuFeatureAcceleratedCompositing - two features.
69 void GetGpuFeatureFlagEntries(GpuFeatureFlags::GpuFeatureType feature, 69 void GetGpuFeatureFlagEntries(GpuFeatureFlags::GpuFeatureType feature,
70 std::vector<uint32>& entry_ids) const; 70 std::vector<uint32>& entry_ids) const;
71 // Collects the entries that will the "feature" flag from the last
72 // DetermineGpuFeatureFlags() call if not disabled.
vangelis 2011/09/21 21:27:17 I don't understand this comment...
Zhenyao Mo 2011/09/22 17:10:39 This comment and its function are removed based on
73 void GetGpuFeatureFlagDisabledEntries(GpuFeatureFlags::GpuFeatureType feature,
74 std::vector<uint32>& entry_ids) const;
71 75
72 // Returns status information on the blacklist. This is two parted: 76 // Returns status information on the blacklist. This is two parted:
73 // { 77 // {
74 // featureStatus: [] 78 // featureStatus: []
75 // problems: [] 79 // problems: []
76 // } 80 // }
77 // 81 //
78 // Each entry in feature_status has: 82 // Each entry in feature_status has:
79 // { 83 // {
80 // name: "name of feature" 84 // name: "name of feature"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 const Version& os_version, 235 const Version& os_version,
232 BrowserChannel channel, 236 BrowserChannel channel,
233 const GPUInfo& gpu_info) const; 237 const GPUInfo& gpu_info) const;
234 238
235 // Returns the OsType. 239 // Returns the OsType.
236 OsType GetOsType() const; 240 OsType GetOsType() const;
237 241
238 // Returns the entry's unique id. 0 is reserved. 242 // Returns the entry's unique id. 0 is reserved.
239 uint32 id() const; 243 uint32 id() const;
240 244
245 // Returns whether the entry is disabled.
246 bool disabled() const;
247
241 // Returns the description of the entry 248 // Returns the description of the entry
242 const std::string& description() const { return description_; } 249 const std::string& description() const { return description_; }
243 250
244 // Returns a list of Chromium and Webkit bugs applicable to this entry 251 // Returns a list of Chromium and Webkit bugs applicable to this entry
245 const std::vector<int>& cr_bugs() const { return cr_bugs_; } 252 const std::vector<int>& cr_bugs() const { return cr_bugs_; }
246 const std::vector<int>& webkit_bugs() const { return webkit_bugs_; } 253 const std::vector<int>& webkit_bugs() const { return webkit_bugs_; }
247 254
248 // Returns the GpuFeatureFlags. 255 // Returns the GpuFeatureFlags.
249 GpuFeatureFlags GetGpuFeatureFlags() const; 256 GpuFeatureFlags GetGpuFeatureFlags() const;
250 257
251 // Returns true if an unknown field is encountered. 258 // Returns true if an unknown field is encountered.
252 bool contains_unknown_fields() const { 259 bool contains_unknown_fields() const {
253 return contains_unknown_fields_; 260 return contains_unknown_fields_;
254 } 261 }
255 // Returns true if an unknown blacklist feature is encountered. 262 // Returns true if an unknown blacklist feature is encountered.
256 bool contains_unknown_features() const { 263 bool contains_unknown_features() const {
257 return contains_unknown_features_; 264 return contains_unknown_features_;
258 } 265 }
259 266
260 private: 267 private:
261 friend class base::RefCounted<GpuBlacklistEntry>; 268 friend class base::RefCounted<GpuBlacklistEntry>;
262 269
263 GpuBlacklistEntry(); 270 GpuBlacklistEntry();
264 ~GpuBlacklistEntry() { } 271 ~GpuBlacklistEntry() { }
265 272
266 bool SetId(uint32 id); 273 bool SetId(uint32 id);
267 274
275 void SetDisabled(bool disabled);
276
268 bool SetOsInfo(const std::string& os, 277 bool SetOsInfo(const std::string& os,
269 const std::string& version_op, 278 const std::string& version_op,
270 const std::string& version_string, 279 const std::string& version_string,
271 const std::string& version_string2); 280 const std::string& version_string2);
272 281
273 bool SetVendorId(const std::string& vendor_id_string); 282 bool SetVendorId(const std::string& vendor_id_string);
274 283
275 bool AddDeviceId(const std::string& device_id_string); 284 bool AddDeviceId(const std::string& device_id_string);
276 285
277 bool SetDriverVendorInfo(const std::string& vendor_op, 286 bool SetDriverVendorInfo(const std::string& vendor_op,
(...skipping 14 matching lines...) Expand all
292 const std::string& renderer_value); 301 const std::string& renderer_value);
293 302
294 bool SetBlacklistedFeatures( 303 bool SetBlacklistedFeatures(
295 const std::vector<std::string>& blacklisted_features); 304 const std::vector<std::string>& blacklisted_features);
296 305
297 void AddException(ScopedGpuBlacklistEntry exception); 306 void AddException(ScopedGpuBlacklistEntry exception);
298 307
299 void AddBrowserChannel(BrowserChannel channel); 308 void AddBrowserChannel(BrowserChannel channel);
300 309
301 uint32 id_; 310 uint32 id_;
311 bool disabled_;
302 std::string description_; 312 std::string description_;
303 std::vector<int> cr_bugs_; 313 std::vector<int> cr_bugs_;
304 std::vector<int> webkit_bugs_; 314 std::vector<int> webkit_bugs_;
305 scoped_ptr<OsInfo> os_info_; 315 scoped_ptr<OsInfo> os_info_;
306 uint32 vendor_id_; 316 uint32 vendor_id_;
307 std::vector<uint32> device_id_list_; 317 std::vector<uint32> device_id_list_;
308 scoped_ptr<StringInfo> driver_vendor_info_; 318 scoped_ptr<StringInfo> driver_vendor_info_;
309 scoped_ptr<VersionInfo> driver_version_info_; 319 scoped_ptr<VersionInfo> driver_version_info_;
310 scoped_ptr<VersionInfo> driver_date_info_; 320 scoped_ptr<VersionInfo> driver_date_info_;
311 scoped_ptr<StringInfo> gl_vendor_info_; 321 scoped_ptr<StringInfo> gl_vendor_info_;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 scoped_ptr<Version> version_; 355 scoped_ptr<Version> version_;
346 std::vector<ScopedGpuBlacklistEntry> blacklist_; 356 std::vector<ScopedGpuBlacklistEntry> blacklist_;
347 357
348 scoped_ptr<Version> browser_version_; 358 scoped_ptr<Version> browser_version_;
349 BrowserChannel browser_channel_; 359 BrowserChannel browser_channel_;
350 360
351 // This records all the blacklist entries that are appliable to the current 361 // This records all the blacklist entries that are appliable to the current
352 // user machine. It is updated everytime DetermineGpuFeatureFlags() is 362 // user machine. It is updated everytime DetermineGpuFeatureFlags() is
353 // called and is used later by GetGpuFeatureFlagEntries(). 363 // called and is used later by GetGpuFeatureFlagEntries().
354 std::vector<ScopedGpuBlacklistEntry> active_entries_; 364 std::vector<ScopedGpuBlacklistEntry> active_entries_;
365 // This records all the disabled blacklist entries that are appliable to the
366 // current user machine. It is updated everytime DetermineGpuFeatureFlags()
367 // is called and is used later by GetGpuFeatureFlagDisabledEntries().
368 std::vector<ScopedGpuBlacklistEntry> active_disabled_entries_;
355 369
356 uint32 max_entry_id_; 370 uint32 max_entry_id_;
357 371
358 bool contains_unknown_fields_; 372 bool contains_unknown_fields_;
359 373
360 DISALLOW_COPY_AND_ASSIGN(GpuBlacklist); 374 DISALLOW_COPY_AND_ASSIGN(GpuBlacklist);
361 }; 375 };
362 376
363 #endif // CONTENT_BROWSER_GPU_GPU_BLACKLIST_H_ 377 #endif // CONTENT_BROWSER_GPU_GPU_BLACKLIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698