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

Unified Diff: cc/prioritized_resource.cc

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Apply code review comments 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 | « cc/prioritized_resource.h ('k') | cc/prioritized_resource_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/prioritized_resource.cc
diff --git a/cc/prioritized_resource.cc b/cc/prioritized_resource.cc
index 14e0cd7e885761bb4b51ab0c7b2ed0c1a266341b..280d7b55c32a21278565e75e69af2d6cc3de69de 100644
--- a/cc/prioritized_resource.cc
+++ b/cc/prioritized_resource.cc
@@ -153,7 +153,7 @@ PrioritizedResource::Backing::~Backing()
void PrioritizedResource::Backing::deleteResource(ResourceProvider* resourceProvider)
{
- DCHECK(Proxy::isImplThread());
+ DCHECK(!proxy() || proxy()->isImplThread());
DCHECK(!m_resourceHasBeenDeleted);
#ifndef NDEBUG
DCHECK(resourceProvider == m_resourceProvider);
@@ -166,19 +166,19 @@ void PrioritizedResource::Backing::deleteResource(ResourceProvider* resourceProv
bool PrioritizedResource::Backing::resourceHasBeenDeleted() const
{
- DCHECK(Proxy::isImplThread());
+ DCHECK(!proxy() || proxy()->isImplThread());
return m_resourceHasBeenDeleted;
}
bool PrioritizedResource::Backing::canBeRecycled() const
{
- DCHECK(Proxy::isImplThread());
+ DCHECK(!proxy() || proxy()->isImplThread());
return !m_wasAbovePriorityCutoffAtLastPriorityUpdate && !m_inDrawingImplTree;
}
void PrioritizedResource::Backing::updatePriority()
{
- DCHECK(Proxy::isImplThread() && Proxy::isMainThreadBlocked());
+ DCHECK(!proxy() || proxy()->isImplThread() && proxy()->isMainThreadBlocked());
if (m_owner) {
m_priorityAtLastPriorityUpdate = m_owner->requestPriority();
m_wasAbovePriorityCutoffAtLastPriorityUpdate = m_owner->isAbovePriorityCutoff();
@@ -190,7 +190,7 @@ void PrioritizedResource::Backing::updatePriority()
void PrioritizedResource::Backing::updateInDrawingImplTree()
{
- DCHECK(Proxy::isImplThread() && Proxy::isMainThreadBlocked());
+ DCHECK(!proxy() || proxy()->isImplThread() && proxy()->isMainThreadBlocked());
m_inDrawingImplTree = !!owner();
if (!m_inDrawingImplTree)
DCHECK(m_priorityAtLastPriorityUpdate == PriorityCalculator::lowestPriority());
@@ -203,4 +203,11 @@ void PrioritizedResource::returnBackingTexture()
m_manager->returnBackingTexture(this);
}
+const Proxy* PrioritizedResource::Backing::proxy() const
+{
+ if (!m_owner || !m_owner->resourceManager())
+ return 0;
+ return m_owner->resourceManager()->proxyForDebug();
+}
+
} // namespace cc
« no previous file with comments | « cc/prioritized_resource.h ('k') | cc/prioritized_resource_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698