| 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)
|
| {
|
|
|