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

Unified Diff: content/public/browser/gpu_data_manager.h

Issue 11366237: Add logic to block the use of client 3D APIs (WebGL, Pepper 3D) if context lost notifications are r… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review feedback from zmo and jam. Created 8 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 | « content/browser/gpu/gpu_data_manager_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/gpu_data_manager.h
diff --git a/content/public/browser/gpu_data_manager.h b/content/public/browser/gpu_data_manager.h
index 8bcea35b0533dd707566da30ee0e1f9e2ba66d40..14b10b7d1ba52c0395911b9151993059a5f2b46b 100644
--- a/content/public/browser/gpu_data_manager.h
+++ b/content/public/browser/gpu_data_manager.h
@@ -12,6 +12,7 @@
#include "content/public/common/gpu_switching_option.h"
class FilePath;
+class GURL;
namespace base {
class ListValue;
@@ -25,6 +26,24 @@ struct GPUInfo;
// This class is fully thread-safe.
class GpuDataManager {
public:
+ // Indicates the guilt level of a domain which caused a GPU reset.
+ // If a domain is 100% known to be guilty of resetting the GPU, then
+ // it will generally not cause other domains' use of 3D APIs to be
+ // blocked, unless system stability would be compromised.
+ enum DomainGuilt {
+ DOMAIN_GUILT_KNOWN,
+ DOMAIN_GUILT_UNKNOWN
+ };
+
+ // Indicates the reason that access to a given client API (like
+ // WebGL or Pepper 3D) was blocked or not. This state is distinct
+ // from blacklisting of an entire feature.
+ enum DomainBlockStatus {
+ DOMAIN_BLOCK_STATUS_BLOCKED,
+ DOMAIN_BLOCK_STATUS_ALL_DOMAINS_BLOCKED,
+ DOMAIN_BLOCK_STATUS_NOT_BLOCKED
+ };
+
// Getter for the singleton.
CONTENT_EXPORT static GpuDataManager* GetInstance();
@@ -84,6 +103,21 @@ class GpuDataManager {
virtual void SetWindowCount(uint32 count) = 0;
virtual uint32 GetWindowCount() const = 0;
+ // Maintenance of domains requiring explicit user permission before
+ // using client-facing 3D APIs (WebGL, Pepper 3D), either because
+ // the domain has caused the GPU to reset, or because too many GPU
+ // resets have been observed globally recently, and system stability
+ // might be compromised.
+ //
+ // The given URL may be a partial URL (including at least the host)
+ // or a full URL to a page.
+ virtual void BlockDomainFrom3DAPIs(const GURL& url, DomainGuilt guilt) = 0;
+ virtual DomainBlockStatus Are3DAPIsBlocked(
+ const GURL& url) const = 0;
+ virtual void UnblockDomainFrom3DAPIs(const GURL& url) = 0;
+ // Disables domain blocking. For use only in tests.
+ virtual void DisableDomainBlockingFor3DAPIsForTesting() = 0;
+
protected:
virtual ~GpuDataManager() {}
};
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698