Chromium Code Reviews| 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..da84a23f3e398107adfe88f56c328cae7d51ab08 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 { |
| + kKnownGuilty, |
|
jam
2012/11/14 18:21:57
nit: here and below, please use chrome recommended
Ken Russell (switch to Gerrit)
2012/11/14 19:09:14
Will change -- sorry, I'd missed this in the Chrom
|
| + kUnknownGuilt |
| + }; |
| + |
| + // 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 { |
| + kDomainBlocked, |
| + kAllDomainsBlocked, |
| + kNotBlocked |
| + }; |
| + |
| // 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() {} |
| }; |