| Index: content/browser/gpu/gpu_blacklist.cc
|
| ===================================================================
|
| --- content/browser/gpu/gpu_blacklist.cc (revision 111230)
|
| +++ content/browser/gpu/gpu_blacklist.cc (working copy)
|
| @@ -427,24 +427,6 @@
|
| dictionary_entry_count++;
|
| }
|
|
|
| - ListValue* channel_list_value = NULL;
|
| - if (value->GetList("browser_channels", &channel_list_value)) {
|
| - for (size_t i = 0; i < channel_list_value->GetSize(); ++i) {
|
| - std::string channel_value;
|
| - if (!channel_list_value->GetString(i, &channel_value)) {
|
| - LOG(WARNING) << "Malformed browser_channels entry " << entry->id();
|
| - return NULL;
|
| - }
|
| - BrowserChannel channel = StringToBrowserChannel(channel_value);
|
| - if (channel == kUnknown) {
|
| - LOG(WARNING) << "Malformed browser_channels entry " << entry->id();
|
| - return NULL;
|
| - }
|
| - entry->AddBrowserChannel(channel);
|
| - }
|
| - dictionary_entry_count++;
|
| - }
|
| -
|
| if (value->size() != dictionary_entry_count) {
|
| LOG(WARNING) << "Entry with unknown fields " << entry->id();
|
| entry->contains_unknown_fields_ = true;
|
| @@ -573,14 +555,8 @@
|
| exceptions_.push_back(exception);
|
| }
|
|
|
| -void GpuBlacklist::GpuBlacklistEntry::AddBrowserChannel(
|
| - BrowserChannel channel) {
|
| - DCHECK(channel != kUnknown);
|
| - browser_channels_.push_back(channel);
|
| -}
|
| -
|
| bool GpuBlacklist::GpuBlacklistEntry::Contains(
|
| - OsType os_type, const Version& os_version, BrowserChannel channel,
|
| + OsType os_type, const Version& os_version,
|
| const content::GPUInfo& gpu_info) const {
|
| DCHECK(os_type != kOsAny);
|
| if (os_info_.get() != NULL && !os_info_->Contains(os_type, os_version))
|
| @@ -621,20 +597,10 @@
|
| !gl_renderer_info_->Contains(gpu_info.gl_renderer))
|
| return false;
|
| for (size_t i = 0; i < exceptions_.size(); ++i) {
|
| - if (exceptions_[i]->Contains(os_type, os_version, channel, gpu_info))
|
| + if (exceptions_[i]->Contains(os_type, os_version, gpu_info))
|
| return false;
|
| }
|
| - bool rt = true;
|
| - if (browser_channels_.size() > 0) {
|
| - rt = false;
|
| - for (size_t i = 0; i < browser_channels_.size(); ++i) {
|
| - if (browser_channels_[i] == channel) {
|
| - rt = true;
|
| - break;
|
| - }
|
| - }
|
| - }
|
| - return rt;
|
| + return true;
|
| }
|
|
|
| GpuBlacklist::OsType GpuBlacklist::GpuBlacklistEntry::GetOsType() const {
|
| @@ -655,10 +621,10 @@
|
| return *feature_flags_;
|
| }
|
|
|
| -GpuBlacklist::GpuBlacklist(const std::string& browser_info_string)
|
| +GpuBlacklist::GpuBlacklist(const std::string& browser_version_string)
|
| : max_entry_id_(0),
|
| contains_unknown_fields_(false) {
|
| - SetBrowserInfo(browser_info_string);
|
| + SetBrowserVersion(browser_version_string);
|
| }
|
|
|
| GpuBlacklist::~GpuBlacklist() {
|
| @@ -758,7 +724,7 @@
|
| DCHECK(os_version != NULL);
|
|
|
| for (size_t i = 0; i < blacklist_.size(); ++i) {
|
| - if (blacklist_[i]->Contains(os, *os_version, browser_channel_, gpu_info)) {
|
| + if (blacklist_[i]->Contains(os, *os_version, gpu_info)) {
|
| if (!blacklist_[i]->disabled())
|
| flags.Combine(blacklist_[i]->GetGpuFeatureFlags());
|
| active_entries_.push_back(blacklist_[i]);
|
| @@ -891,32 +857,8 @@
|
| return kSupported;
|
| }
|
|
|
| -void GpuBlacklist::SetBrowserInfo(const std::string& browser_info_string) {
|
| - std::vector<std::string> pieces;
|
| - base::SplitString(browser_info_string, ' ', &pieces);
|
| - if (pieces.size() != 2) {
|
| - pieces.resize(2);
|
| - pieces[0] = "0";
|
| - pieces[1] = "unknown";
|
| - }
|
| -
|
| - browser_version_.reset(Version::GetVersionFromString(pieces[0]));
|
| +void GpuBlacklist::SetBrowserVersion(const std::string& version_string) {
|
| + browser_version_.reset(Version::GetVersionFromString(version_string));
|
| DCHECK(browser_version_.get() != NULL);
|
| -
|
| - browser_channel_ = StringToBrowserChannel(pieces[1]);
|
| }
|
|
|
| -// static
|
| -GpuBlacklist::BrowserChannel GpuBlacklist::StringToBrowserChannel(
|
| - const std::string& value) {
|
| - if (value == "stable")
|
| - return kStable;
|
| - if (value == "beta")
|
| - return kBeta;
|
| - if (value == "dev")
|
| - return kDev;
|
| - if (value == "canary")
|
| - return kCanary;
|
| - return kUnknown;
|
| -}
|
| -
|
|
|