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

Unified Diff: sky/engine/public/platform/WebPrivatePtr.h

Issue 655083003: Remove GarbageCollectedFinalized (Closed) Base URL: git@github.com:domokit/mojo.git@master
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 | « sky/engine/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: sky/engine/public/platform/WebPrivatePtr.h
diff --git a/sky/engine/public/platform/WebPrivatePtr.h b/sky/engine/public/platform/WebPrivatePtr.h
index 4d56c5cf75d627b5e72883bb9796245525a682e9..af7adb59ea8eb00afbff4163849a9defde1778b9 100644
--- a/sky/engine/public/platform/WebPrivatePtr.h
+++ b/sky/engine/public/platform/WebPrivatePtr.h
@@ -42,27 +42,8 @@
namespace blink {
#if INSIDE_BLINK
-enum LifetimeManagementType {
- RefCountedLifetime,
- GarbageCollectedLifetime,
- RefCountedGarbageCollectedLifetime
-};
-
-template<typename T>
-class LifetimeOf {
- static const bool isGarbageCollected = WTF::IsSubclassOfTemplate<T, GarbageCollected>::value;
- static const bool isRefCountedGarbageCollected = WTF::IsSubclassOfTemplate<T, RefCountedGarbageCollected>::value;
-public:
- static const LifetimeManagementType value =
- !isGarbageCollected ? RefCountedLifetime :
- isRefCountedGarbageCollected ? RefCountedGarbageCollectedLifetime : GarbageCollectedLifetime;
-};
-
-template<typename T, LifetimeManagementType lifetime>
-class PtrStorageImpl;
-
template<typename T>
-class PtrStorageImpl<T, RefCountedLifetime> {
+class PtrStorageImpl {
public:
typedef PassRefPtr<T> BlinkPtrType;
@@ -93,48 +74,7 @@ private:
};
template<typename T>
-class PtrStorageImpl<T, GarbageCollectedLifetime> {
-public:
- void assign(const RawPtr<T>& val)
- {
- if (!val) {
- release();
- return;
- }
-
- if (!m_handle)
- m_handle = new Persistent<T>();
-
- (*m_handle) = val;
- }
-
- void assign(T* ptr) { assign(RawPtr<T>(ptr)); }
- template<typename U> void assign(const RawPtr<U>& val) { assign(RawPtr<T>(val)); }
-
- void assign(const PtrStorageImpl& other) { assign(other.get()); }
-
- T* get() const { return m_handle ? m_handle->get() : 0; }
-
- void release()
- {
- delete m_handle;
- m_handle = 0;
- }
-
-private:
- Persistent<T>* m_handle;
-};
-
-template<typename T>
-class PtrStorageImpl<T, RefCountedGarbageCollectedLifetime> : public PtrStorageImpl<T, GarbageCollectedLifetime> {
-public:
- void assign(const PassRefPtr<T>& val) { PtrStorageImpl<T, GarbageCollectedLifetime>::assign(val.get()); }
-
- void assign(const PtrStorageImpl& other) { PtrStorageImpl<T, GarbageCollectedLifetime>::assign(other.get()); }
-};
-
-template<typename T>
-class PtrStorage : public PtrStorageImpl<T, LifetimeOf<T>::value> {
+class PtrStorage : public PtrStorageImpl<T> {
public:
static PtrStorage& fromSlot(void** slot)
{
« no previous file with comments | « sky/engine/platform/heap/Heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698