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

Unified Diff: Source/platform/heap/Handle.h

Issue 1339043002: Simplify SelfKeepAlive<T>'s representation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Handle.h
diff --git a/Source/platform/heap/Handle.h b/Source/platform/heap/Handle.h
index 842c87f881236ba5dd229a3b1351f85d47066d8d..9f5054639238ac610cdb9ddde3f912119268e26c 100644
--- a/Source/platform/heap/Handle.h
+++ b/Source/platform/heap/Handle.h
@@ -1155,20 +1155,18 @@ public:
m_keepAlive.clear();
}
- typedef OwnPtr<Persistent<Self>> (SelfKeepAlive::*UnspecifiedBoolType);
+ typedef Persistent<Self> (SelfKeepAlive::*UnspecifiedBoolType);
operator UnspecifiedBoolType() const { return m_keepAlive ? &SelfKeepAlive::m_keepAlive : 0; }
private:
void assign(Self* self)
{
- ASSERT(!m_keepAlive || m_keepAlive->get() == self);
- if (!m_keepAlive)
- m_keepAlive = adoptPtr(new Persistent<Self>);
- *m_keepAlive = self;
+ ASSERT(!m_keepAlive || m_keepAlive.get() == self);
+ m_keepAlive = self;
}
GC_PLUGIN_IGNORE("420515")
- OwnPtr<Persistent<Self>> m_keepAlive;
+ Persistent<Self> m_keepAlive;
};
template<typename T>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698