| 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() {}
|
| };
|
|
|