summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-02 18:11:57 +0000
committerzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-02 18:11:57 +0000
commit9c2985a474815d0fd41b38c8ec418e15d34dc6a8 (patch)
tree118cf02ad918718570eb07614719db8f5303bb32 /chrome/browser
parent398fa730d4d71fc5510fc93e0e832e239eecddfd (diff)
downloadchromium_src-9c2985a474815d0fd41b38c8ec418e15d34dc6a8.zip
chromium_src-9c2985a474815d0fd41b38c8ec418e15d34dc6a8.tar.gz
chromium_src-9c2985a474815d0fd41b38c8ec418e15d34dc6a8.tar.bz2
Change GpuControlList features from bits of int to set.
Before, we limit to manage 32 features. Now we can manage as many as we want. BUG=222857 TEST=content_unittests, waterfall Review URL: https://codereview.chromium.org/13240002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191858 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/component_updater/swiftshader_component_installer.cc4
-rw-r--r--chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc7
-rw-r--r--chrome/browser/gpu/gpu_feature_checker.cc11
3 files changed, 7 insertions, 15 deletions
diff --git a/chrome/browser/component_updater/swiftshader_component_installer.cc b/chrome/browser/component_updater/swiftshader_component_installer.cc
index 6a1a7fd..9b42748 100644
--- a/chrome/browser/component_updater/swiftshader_component_installer.cc
+++ b/chrome/browser/component_updater/swiftshader_component_installer.cc
@@ -19,6 +19,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/browser/gpu_data_manager_observer.h"
+#include "content/public/common/gpu_feature_type.h"
using content::BrowserThread;
using content::GpuDataManager;
@@ -178,8 +179,7 @@ void UpdateChecker::OnGpuInfoUpdate() {
GpuDataManager *gpu_data_manager = GpuDataManager::GetInstance();
if (!gpu_data_manager->GpuAccessAllowed() ||
- (gpu_data_manager->GetBlacklistedFeatures() &
- content::GPU_FEATURE_TYPE_WEBGL) ||
+ gpu_data_manager->IsFeatureBlacklisted(content::GPU_FEATURE_TYPE_WEBGL) ||
gpu_data_manager->ShouldUseSoftwareRendering()) {
gpu_data_manager->RemoveObserver(this);
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
index ca52b00..da1e977 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
@@ -26,6 +26,7 @@
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "content/public/common/gpu_feature_type.h"
#include "content/public/common/gpu_info.h"
#include "content/public/test/browser_test_utils.h"
#include "net/dns/mock_host_resolver.h"
@@ -476,10 +477,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebstoreGetWebGLStatusTest, Blocked) {
content::GPUInfo gpu_info;
content::GpuDataManager::GetInstance()->InitializeForTesting(
json_blacklist, gpu_info);
- GpuFeatureType type =
- content::GpuDataManager::GetInstance()->GetBlacklistedFeatures();
- EXPECT_EQ((type & content::GPU_FEATURE_TYPE_WEBGL),
- content::GPU_FEATURE_TYPE_WEBGL);
+ EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted(
+ content::GPU_FEATURE_TYPE_WEBGL));
bool webgl_allowed = false;
RunTest(webgl_allowed);
diff --git a/chrome/browser/gpu/gpu_feature_checker.cc b/chrome/browser/gpu/gpu_feature_checker.cc
index 123cc49..23e0fb1 100644
--- a/chrome/browser/gpu/gpu_feature_checker.cc
+++ b/chrome/browser/gpu/gpu_feature_checker.cc
@@ -14,15 +14,8 @@ namespace {
// GPU info has been collected in a GPU process.
bool IsFeatureAllowed(content::GpuDataManager* manager,
content::GpuFeatureType feature) {
- bool feature_allowed = true;
- if (!manager->GpuAccessAllowed()) {
- feature_allowed = false;
- } else {
- uint32 blacklist_type = manager->GetBlacklistedFeatures();
- if (blacklist_type & feature)
- feature_allowed = false;
- }
- return feature_allowed;
+ return (manager->GpuAccessAllowed() &&
+ !manager->IsFeatureBlacklisted(feature));
}
} // namespace