| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 m_handle = 0; | 125 m_handle = 0; |
| 126 } | 126 } |
| 127 | 127 |
| 128 private: | 128 private: |
| 129 WebCore::Persistent<T>* m_handle; | 129 WebCore::Persistent<T>* m_handle; |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 template<typename T> | 132 template<typename T> |
| 133 class PtrStorageImpl<T, RefCountedGarbageCollectedLifetime> : public PtrStorageI
mpl<T, GarbageCollectedLifetime> { | 133 class PtrStorageImpl<T, RefCountedGarbageCollectedLifetime> : public PtrStorageI
mpl<T, GarbageCollectedLifetime> { |
| 134 public: | 134 public: |
| 135 void assign(const PassRefPtr<T>& val) { PtrStorageImpl<T, GarbageCollectedLi
fetime>::assign(val.get()); } | 135 void assign(const PassRefPtrWillBeRawPtr<T>& val) { PtrStorageImpl<T, Garbag
eCollectedLifetime>::assign(val.get()); } |
| 136 | 136 |
| 137 void assign(const PtrStorageImpl& other) { PtrStorageImpl<T, GarbageCollecte
dLifetime>::assign(other.get()); } | 137 void assign(const PtrStorageImpl& other) { PtrStorageImpl<T, GarbageCollecte
dLifetime>::assign(other.get()); } |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 template<typename T> | 140 template<typename T> |
| 141 class PtrStorage : public PtrStorageImpl<T, LifetimeOf<T>::value> { | 141 class PtrStorage : public PtrStorageImpl<T, LifetimeOf<T>::value> { |
| 142 public: | 142 public: |
| 143 static PtrStorage& fromSlot(void** slot) | 143 static PtrStorage& fromSlot(void** slot) |
| 144 { | 144 { |
| 145 COMPILE_ASSERT(sizeof(PtrStorage) == sizeof(void*), PtrStorage_must_be_p
ointer_size); | 145 COMPILE_ASSERT(sizeof(PtrStorage) == sizeof(void*), PtrStorage_must_be_p
ointer_size); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 // Disable the copy constructor; classes that contain a WebPrivatePtr | 265 // Disable the copy constructor; classes that contain a WebPrivatePtr |
| 266 // should implement their copy constructor using assign(). | 266 // should implement their copy constructor using assign(). |
| 267 WebPrivatePtr(const WebPrivatePtr<T>&); | 267 WebPrivatePtr(const WebPrivatePtr<T>&); |
| 268 | 268 |
| 269 void* m_storage; | 269 void* m_storage; |
| 270 }; | 270 }; |
| 271 | 271 |
| 272 } // namespace blink | 272 } // namespace blink |
| 273 | 273 |
| 274 #endif | 274 #endif |
| OLD | NEW |