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

Side by Side Diff: gpu/config/gpu_control_list.h

Issue 1004593005: base::RefCounted now DCHECKs when referenced from multiple threads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix lots of tests using UnsafeRefCounted. Created 5 years, 9 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
OLDNEW
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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 private: 238 private:
239 bool value_; 239 bool value_;
240 }; 240 };
241 241
242 class GpuControlListEntry; 242 class GpuControlListEntry;
243 typedef scoped_refptr<GpuControlListEntry> ScopedGpuControlListEntry; 243 typedef scoped_refptr<GpuControlListEntry> ScopedGpuControlListEntry;
244 244
245 typedef base::hash_map<std::string, int> FeatureMap; 245 typedef base::hash_map<std::string, int> FeatureMap;
246 246
247 // TODO(mgiuca): Avoid using UnsafeRefCounted. http://crbug.com/469952.
247 class GPU_EXPORT GpuControlListEntry 248 class GPU_EXPORT GpuControlListEntry
248 : public base::RefCounted<GpuControlListEntry> { 249 : public base::UnsafeRefCounted<GpuControlListEntry> {
249 public: 250 public:
250 // Constructs GpuControlListEntry from DictionaryValue loaded from json. 251 // Constructs GpuControlListEntry from DictionaryValue loaded from json.
251 // Top-level entry must have an id number. Others are exceptions. 252 // Top-level entry must have an id number. Others are exceptions.
252 static ScopedGpuControlListEntry GetEntryFromValue( 253 static ScopedGpuControlListEntry GetEntryFromValue(
253 const base::DictionaryValue* value, bool top_level, 254 const base::DictionaryValue* value, bool top_level,
254 const FeatureMap& feature_map, 255 const FeatureMap& feature_map,
255 bool supports_feature_type_all); 256 bool supports_feature_type_all);
256 257
257 // Logs a control list match for this rule in the list identified by 258 // Logs a control list match for this rule in the list identified by
258 // |control_list_logging_name|. 259 // |control_list_logging_name|.
(...skipping 27 matching lines...) Expand all
286 287
287 // Returns the blacklisted features in this entry. 288 // Returns the blacklisted features in this entry.
288 const std::set<int>& features() const; 289 const std::set<int>& features() const;
289 290
290 // Returns a list of blacklisted feature names in this entry. 291 // Returns a list of blacklisted feature names in this entry.
291 void GetFeatureNames(base::ListValue* feature_names, 292 void GetFeatureNames(base::ListValue* feature_names,
292 const FeatureMap& feature_map, 293 const FeatureMap& feature_map,
293 bool supports_feature_type_all) const; 294 bool supports_feature_type_all) const;
294 295
295 private: 296 private:
296 friend class base::RefCounted<GpuControlListEntry>; 297 friend class base::UnsafeRefCounted<GpuControlListEntry>;
297 298
298 enum MultiGpuStyle { 299 enum MultiGpuStyle {
299 kMultiGpuStyleOptimus, 300 kMultiGpuStyleOptimus,
300 kMultiGpuStyleAMDSwitchable, 301 kMultiGpuStyleAMDSwitchable,
301 kMultiGpuStyleAMDSwitchableIntegrated, 302 kMultiGpuStyleAMDSwitchableIntegrated,
302 kMultiGpuStyleAMDSwitchableDiscrete, 303 kMultiGpuStyleAMDSwitchableDiscrete,
303 kMultiGpuStyleNone 304 kMultiGpuStyleNone
304 }; 305 };
305 306
306 enum MultiGpuCategory { 307 enum MultiGpuCategory {
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 bool supports_feature_type_all_; 480 bool supports_feature_type_all_;
480 481
481 bool control_list_logging_enabled_; 482 bool control_list_logging_enabled_;
482 std::string control_list_logging_name_; 483 std::string control_list_logging_name_;
483 }; 484 };
484 485
485 } // namespace gpu 486 } // namespace gpu
486 487
487 #endif // GPU_CONFIG_GPU_CONTROL_LIST_H_ 488 #endif // GPU_CONFIG_GPU_CONTROL_LIST_H_
488 489
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698