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

Unified Diff: cc/prioritized_resource_unittest.cc

Issue 11411251: Use a lock to deal with concurrent access to the m_evictedBackings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: cc/prioritized_resource_unittest.cc
diff --git a/cc/prioritized_resource_unittest.cc b/cc/prioritized_resource_unittest.cc
index f983f660007b3cb55360d2236fc6659ca53743df..95bf7f990cec7709a0d2f59a9409a5c5cb3d039a 100644
--- a/cc/prioritized_resource_unittest.cc
+++ b/cc/prioritized_resource_unittest.cc
@@ -89,6 +89,11 @@ public:
return texture->m_backing->wasAbovePriorityCutoffAtLastPriorityUpdate();
}
+ size_t evictedBackingCount(PrioritizedResourceManager* resourceManager)
+ {
+ return resourceManager->m_evictedBackings.size();
+ }
+
protected:
FakeProxy m_proxy;
const gfx::Size m_textureSize;
@@ -232,16 +237,15 @@ TEST_F(PrioritizedResourceTest, changePriorityCutoff)
// Do a one-time eviction for one more texture based on priority cutoff
PrioritizedResourceManager::BackingList evictedBackings;
+ resourceManager->unlinkAndClearEvictedBackings();
{
DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked(&m_proxy);
resourceManager->reduceMemoryOnImplThread(texturesMemorySize(8), 104, resourceProvider());
- resourceManager->getEvictedBackings(evictedBackings);
- EXPECT_EQ(0, evictedBackings.size());
+ EXPECT_EQ(0, evictedBackingCount(resourceManager.get()));
resourceManager->reduceMemoryOnImplThread(texturesMemorySize(8), 103, resourceProvider());
- resourceManager->getEvictedBackings(evictedBackings);
- EXPECT_EQ(1, evictedBackings.size());
+ EXPECT_EQ(1, evictedBackingCount(resourceManager.get()));
}
- resourceManager->unlinkEvictedBackings(evictedBackings);
+ resourceManager->unlinkAndClearEvictedBackings();
EXPECT_EQ(texturesMemorySize(3), resourceManager->memoryUseBytes());
// Re-allocate the the texture after the one-time drop.

Powered by Google App Engine
This is Rietveld 408576698