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

Side by Side Diff: chrome/browser/gpu_blacklist.cc

Issue 10891013: Make GpuDataManager thread safe. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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) 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 #include "chrome/browser/gpu_blacklist.h" 5 #include "chrome/browser/gpu_blacklist.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 type |= blacklist_[i]->GetGpuFeatureType(); 1046 type |= blacklist_[i]->GetGpuFeatureType();
1047 active_entries_.push_back(blacklist_[i]); 1047 active_entries_.push_back(blacklist_[i]);
1048 } 1048 }
1049 } 1049 }
1050 return static_cast<GpuFeatureType>(type); 1050 return static_cast<GpuFeatureType>(type);
1051 } 1051 }
1052 1052
1053 void GpuBlacklist::UpdateGpuDataManager() { 1053 void GpuBlacklist::UpdateGpuDataManager() {
1054 content::GpuFeatureType feature_type = DetermineGpuFeatureType( 1054 content::GpuFeatureType feature_type = DetermineGpuFeatureType(
1055 GpuBlacklist::kOsAny, NULL, GpuDataManager::GetInstance()->GetGPUInfo()); 1055 GpuBlacklist::kOsAny, NULL, GpuDataManager::GetInstance()->GetGPUInfo());
1056 GpuDataManager::GetInstance()->SetGpuFeatureType(feature_type); 1056 GpuDataManager::GetInstance()->SetPreliminaryBlacklistedFeatures(
1057 feature_type);
1057 gpu_util::UpdateStats(); 1058 gpu_util::UpdateStats();
1058 } 1059 }
1059 1060
1060 void GpuBlacklist::GetGpuFeatureTypeEntries( 1061 void GpuBlacklist::GetGpuFeatureTypeEntries(
1061 content::GpuFeatureType feature, 1062 content::GpuFeatureType feature,
1062 std::vector<uint32>& entry_ids, 1063 std::vector<uint32>& entry_ids,
1063 bool disabled) const { 1064 bool disabled) const {
1064 entry_ids.clear(); 1065 entry_ids.clear();
1065 for (size_t i = 0; i < active_entries_.size(); ++i) { 1066 for (size_t i = 0; i < active_entries_.size(); ++i) {
1066 if (((feature & active_entries_[i]->GetGpuFeatureType()) != 0) && 1067 if (((feature & active_entries_[i]->GetGpuFeatureType()) != 0) &&
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 if (op == ">") 1179 if (op == ">")
1179 return kGT; 1180 return kGT;
1180 if (op == ">=") 1181 if (op == ">=")
1181 return kGE; 1182 return kGE;
1182 if (op == "any") 1183 if (op == "any")
1183 return kAny; 1184 return kAny;
1184 if (op == "between") 1185 if (op == "between")
1185 return kBetween; 1186 return kBetween;
1186 return kUnknown; 1187 return kUnknown;
1187 } 1188 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698