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

Unified Diff: Source/platform/heap/HeapTest.cpp

Issue 409113003: Revert of [oilpan]: Remove support for tracing off-heap hashmaps. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months 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 | « Source/platform/heap/Handle.h ('k') | Source/platform/heap/Visitor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/HeapTest.cpp
diff --git a/Source/platform/heap/HeapTest.cpp b/Source/platform/heap/HeapTest.cpp
index 1309cddf5f5ba9aba34d6124711fd8468dcc55d5..a50f5361658f0088fa7e032b52315499f2e8b2ef 100644
--- a/Source/platform/heap/HeapTest.cpp
+++ b/Source/platform/heap/HeapTest.cpp
@@ -2017,7 +2017,7 @@
static OffHeapContainer* create() { return new OffHeapContainer(); }
static const int iterations = 300;
- static const int deadWrappers = 1500;
+ static const int deadWrappers = 1800;
OffHeapContainer()
{
@@ -2026,6 +2026,7 @@
m_vector1.append(ShouldBeTraced(IntWrapper::create(i)));
m_deque2.append(IntWrapper::create(i));
m_vector2.append(IntWrapper::create(i));
+ m_hashMap.add(i + 103, IntWrapper::create(i));
m_ownedVector.append(adoptPtr(new ShouldBeTraced(IntWrapper::create(i))));
}
@@ -2033,6 +2034,7 @@
Vector<ShouldBeTraced>::iterator v1Iterator(m_vector1.begin());
Deque<Member<IntWrapper> >::iterator d2Iterator(m_deque2.begin());
Vector<Member<IntWrapper> >::iterator v2Iterator(m_vector2.begin());
+ HashMap<int, Member<IntWrapper> >::iterator mapIterator(m_hashMap.begin());
Vector<OwnPtr<ShouldBeTraced> >::iterator ownedVectorIterator(m_ownedVector.begin());
for (int i = 0; i < iterations; i++) {
@@ -2043,16 +2045,21 @@
EXPECT_EQ(i, d2Iterator->get()->value());
EXPECT_EQ(i, v2Iterator->get()->value());
EXPECT_EQ(i, ownedVectorIterator->get()->m_wrapper->value());
+ int value = mapIterator->value.get()->value();
+ EXPECT_LE(0, value);
+ EXPECT_GT(iterations, value);
++d1Iterator;
++v1Iterator;
++d2Iterator;
++v2Iterator;
+ ++mapIterator;
++ownedVectorIterator;
}
EXPECT_EQ(d1Iterator, m_deque1.end());
EXPECT_EQ(v1Iterator, m_vector1.end());
EXPECT_EQ(d2Iterator, m_deque2.end());
EXPECT_EQ(v2Iterator, m_vector2.end());
+ EXPECT_EQ(mapIterator, m_hashMap.end());
EXPECT_EQ(ownedVectorIterator, m_ownedVector.end());
}
@@ -2062,6 +2069,7 @@
visitor->trace(m_vector1);
visitor->trace(m_deque2);
visitor->trace(m_vector2);
+ visitor->trace(m_hashMap);
visitor->trace(m_ownedVector);
}
@@ -2069,6 +2077,7 @@
Vector<ShouldBeTraced> m_vector1;
Deque<Member<IntWrapper> > m_deque2;
Vector<Member<IntWrapper> > m_vector2;
+ HashMap<int, Member<IntWrapper> > m_hashMap;
Vector<OwnPtr<ShouldBeTraced> > m_ownedVector;
};
« no previous file with comments | « Source/platform/heap/Handle.h ('k') | Source/platform/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698