summaryrefslogtreecommitdiffstats
path: root/content/browser/gpu/gpu_data_manager_impl.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-26 21:21:22 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-26 21:21:22 +0000
commit4432769ac309c0c14eeed2769cbbfabef7f9e59a (patch)
treed91e06840aa03f0c412077da168be4c0e8b7c682 /content/browser/gpu/gpu_data_manager_impl.cc
parentfef2673b5a02496db07a537143b90a81e6efd055 (diff)
downloadchromium_src-4432769ac309c0c14eeed2769cbbfabef7f9e59a.zip
chromium_src-4432769ac309c0c14eeed2769cbbfabef7f9e59a.tar.gz
chromium_src-4432769ac309c0c14eeed2769cbbfabef7f9e59a.tar.bz2
Fix layering violation in content\browser\renderer_host. That directory shouldn't be including web_contents.
It looks like this regressed because we forgot to update the DEPS exclusion after the tab_contents->web_contents rename. I've fixed the non test case, added exclusion for tests, and put a temporary workaround for the media subdirectory. It seems that the media subdirectory should move to content\browser since it has dependencies on web_contents. Review URL: https://codereview.chromium.org/12319119 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184735 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu/gpu_data_manager_impl.cc')
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.cc27
1 files changed, 24 insertions, 3 deletions
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
index a085bc4..834bf55 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -23,6 +23,7 @@
#include "content/browser/gpu/gpu_util.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/gpu/gpu_info_collector.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/gpu_data_manager_observer.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_constants.h"
@@ -560,9 +561,21 @@ void GpuDataManagerImpl::BlockDomainFrom3DAPIs(
BlockDomainFrom3DAPIsAtTime(url, guilt, base::Time::Now());
}
-GpuDataManagerImpl::DomainBlockStatus
-GpuDataManagerImpl::Are3DAPIsBlocked(const GURL& url) const {
- return Are3DAPIsBlockedAtTime(url, base::Time::Now());
+bool GpuDataManagerImpl::Are3DAPIsBlocked(const GURL& url,
+ int render_process_id,
+ int render_view_id,
+ ThreeDAPIType requester) {
+ bool blocked = Are3DAPIsBlockedAtTime(url, base::Time::Now()) !=
+ GpuDataManagerImpl::DOMAIN_BLOCK_STATUS_NOT_BLOCKED;
+ if (blocked) {
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&GpuDataManagerImpl::Notify3DAPIBlocked,
+ base::Unretained(this), url, render_process_id,
+ render_view_id, requester));
+ }
+
+ return blocked;
}
void GpuDataManagerImpl::DisableDomainBlockingFor3DAPIsForTesting() {
@@ -782,4 +795,12 @@ int64 GpuDataManagerImpl::GetBlockAllDomainsDurationInMs() const {
return kBlockAllDomainsMs;
}
+void GpuDataManagerImpl::Notify3DAPIBlocked(const GURL& url,
+ int render_process_id,
+ int render_view_id,
+ ThreeDAPIType requester) {
+ observer_list_->Notify(&GpuDataManagerObserver::DidBlock3DAPIs,
+ url, render_process_id, render_view_id, requester);
+}
+
} // namespace content