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

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

Issue 614373007: Oilpan: Remove adoptRefCountedGarbageCollected (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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/Heap.h ('k') | no next file » | 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 c552b3764280e426e09c85bb7eda208ab2fb90b1..9dcfd8d19d3ea408a74076f1fe0ce33f77ed4ee9 100644
--- a/Source/platform/heap/HeapTest.cpp
+++ b/Source/platform/heap/HeapTest.cpp
@@ -822,9 +822,9 @@ int LargeObject::s_destructorCalls = 0;
class RefCountedAndGarbageCollected : public RefCountedGarbageCollected<RefCountedAndGarbageCollected> {
public:
- static PassRefPtr<RefCountedAndGarbageCollected> create()
+ static RefCountedAndGarbageCollected* create()
{
- return adoptRef(new RefCountedAndGarbageCollected());
+ return new RefCountedAndGarbageCollected();
}
~RefCountedAndGarbageCollected()
@@ -853,7 +853,7 @@ class RefCountedAndGarbageCollected2 : public HeapTestOtherSuperClass, public Re
public:
static RefCountedAndGarbageCollected2* create()
{
- return adoptRefCountedGarbageCollected(new RefCountedAndGarbageCollected2());
+ return new RefCountedAndGarbageCollected2();
}
~RefCountedAndGarbageCollected2()
@@ -1267,7 +1267,7 @@ class TransitionRefCounted : public RefCountedWillBeRefCountedGarbageCollected<T
public:
static PassRefPtrWillBeRawPtr<TransitionRefCounted> create()
{
- return adoptRefWillBeRefCountedGarbageCollected(new TransitionRefCounted());
+ return adoptRefWillBeNoop(new TransitionRefCounted());
}
~TransitionRefCounted()
@@ -1441,7 +1441,7 @@ private:
TEST(HeapTest, Transition)
{
{
- RefPtr<TransitionRefCounted> refCounted = TransitionRefCounted::create();
+ RefPtrWillBePersistent<TransitionRefCounted> refCounted = TransitionRefCounted::create();
EXPECT_EQ(1, TransitionRefCounted::s_aliveCount);
Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
EXPECT_EQ(1, TransitionRefCounted::s_aliveCount);
@@ -2742,7 +2742,7 @@ static void heapMapDestructorHelper(bool clearMaps)
clearOutOldGarbage(&initialHeapStats);
ThingWithDestructor::s_liveThingsWithDestructor = 0;
- typedef HeapHashMap<WeakMember<IntWrapper>, RefPtr<RefCountedAndGarbageCollected> > RefMap;
+ typedef HeapHashMap<WeakMember<IntWrapper>, Member<RefCountedAndGarbageCollected> > RefMap;
typedef HeapHashMap<
WeakMember<IntWrapper>,
@@ -3169,8 +3169,8 @@ TEST(HeapTest, RefCountedGarbageCollected)
{
Persistent<RefCountedAndGarbageCollected> persistent;
{
- RefPtr<RefCountedAndGarbageCollected> refPtr1 = RefCountedAndGarbageCollected::create();
- RefPtr<RefCountedAndGarbageCollected> refPtr2 = RefCountedAndGarbageCollected::create();
+ Persistent<RefCountedAndGarbageCollected> refPtr1 = RefCountedAndGarbageCollected::create();
+ Persistent<RefCountedAndGarbageCollected> refPtr2 = RefCountedAndGarbageCollected::create();
Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
EXPECT_EQ(0, RefCountedAndGarbageCollected::s_destructorCalls);
persistent = refPtr1.get();
@@ -3200,8 +3200,8 @@ TEST(HeapTest, RefCountedGarbageCollectedWithStackPointers)
RefCountedAndGarbageCollected* pointer1 = 0;
RefCountedAndGarbageCollected2* pointer2 = 0;
{
- RefPtr<RefCountedAndGarbageCollected> object1 = RefCountedAndGarbageCollected::create();
- RefPtr<RefCountedAndGarbageCollected2> object2 = RefCountedAndGarbageCollected2::create();
+ Persistent<RefCountedAndGarbageCollected> object1 = RefCountedAndGarbageCollected::create();
+ Persistent<RefCountedAndGarbageCollected2> object2 = RefCountedAndGarbageCollected2::create();
pointer1 = object1.get();
pointer2 = object2.get();
void* objects[2] = { object1.get(), object2.get() };
@@ -3225,8 +3225,8 @@ TEST(HeapTest, RefCountedGarbageCollectedWithStackPointers)
EXPECT_TRUE(visitor.validate());
{
- RefPtr<RefCountedAndGarbageCollected> object1(pointer1);
- RefPtr<RefCountedAndGarbageCollected2> object2(pointer2);
+ Persistent<RefCountedAndGarbageCollected> object1(pointer1);
+ Persistent<RefCountedAndGarbageCollected2> object2(pointer2);
void* objects[2] = { object1.get(), object2.get() };
RefCountedGarbageCollectedVisitor visitor(2, objects);
ThreadState::current()->visitPersistents(&visitor);
« no previous file with comments | « Source/platform/heap/Heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698