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

Unified Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 2505473002: Don't forbid GPU process if WebGL/WebGL2 is disabled on GPU but not browser. (Closed)
Patch Set: adding TODO Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/gpu/gpu_data_manager_impl_private_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_data_manager_impl_private.cc
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index 2ebba27be59ac3d858b9549732c2f164a78c254e..0f517cefa2636c29e7e8cf4da2fdd94d696f26ad 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -4,6 +4,8 @@
#include "content/browser/gpu/gpu_data_manager_impl_private.h"
+#include <algorithm>
+#include <iterator>
#include <memory>
#include <utility>
@@ -347,12 +349,23 @@ bool GpuDataManagerImplPrivate::GpuAccessAllowed(
// We only need to block GPU process if more features are disallowed other
// than those in the preliminary gpu feature flags because the latter work
- // through renderer commandline switches.
- std::set<int> features = preliminary_blacklisted_features_;
- gpu::MergeFeatureSets(&features, blacklisted_features_);
- if (features.size() > preliminary_blacklisted_features_.size()) {
+ // through renderer commandline switches. WebGL and WebGL2 should not matter
+ // because their context creation can always be rejected on the GPU process
+ // side.
+ std::set<int> feature_diffs;
+ std::set_difference(blacklisted_features_.begin(),
+ blacklisted_features_.end(),
+ preliminary_blacklisted_features_.begin(),
+ preliminary_blacklisted_features_.end(),
+ std::inserter(feature_diffs, feature_diffs.begin()));
+ if (feature_diffs.size()) {
+ // TODO(zmo): Other features might also be OK to ignore here.
+ feature_diffs.erase(gpu::GPU_FEATURE_TYPE_WEBGL);
+ feature_diffs.erase(gpu::GPU_FEATURE_TYPE_WEBGL2);
+ }
+ if (feature_diffs.size()) {
if (reason) {
- *reason = "Features are disabled upon full but not preliminary GPU info.";
+ *reason = "Features are disabled on full but not preliminary GPU info.";
}
return false;
}
« no previous file with comments | « no previous file | content/browser/gpu/gpu_data_manager_impl_private_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698