| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 #if INSIDE_BLINK | 44 #if INSIDE_BLINK |
| 45 enum LifetimeManagementType { | 45 enum LifetimeManagementType { |
| 46 RefCountedLifetime, | 46 RefCountedLifetime, |
| 47 GarbageCollectedLifetime, | 47 GarbageCollectedLifetime, |
| 48 RefCountedGarbageCollectedLifetime | 48 RefCountedGarbageCollectedLifetime |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 template<typename T> | 51 template<typename T> |
| 52 class LifetimeOf { | 52 class LifetimeOf { |
| 53 static const bool isGarbageCollected = WTF::IsSubclassOfTemplate<T, GarbageC
ollected>::value || WTF::IsSubclass<T, GarbageCollectedMixin>::value; | 53 static const bool isGarbageCollected = WTF::IsSubclassOfTemplate<T, GarbageC
ollected>::value || IsGarbageCollectedMixin<T>::value; |
| 54 static const bool isRefCountedGarbageCollected = WTF::IsSubclassOfTemplate<T
, RefCountedGarbageCollected>::value; | 54 static const bool isRefCountedGarbageCollected = WTF::IsSubclassOfTemplate<T
, RefCountedGarbageCollected>::value; |
| 55 public: | 55 public: |
| 56 static const LifetimeManagementType value = | 56 static const LifetimeManagementType value = |
| 57 !isGarbageCollected ? RefCountedLifetime : | 57 !isGarbageCollected ? RefCountedLifetime : |
| 58 isRefCountedGarbageCollected ? RefCountedGarbageCollectedLifetime : Garb
ageCollectedLifetime; | 58 isRefCountedGarbageCollected ? RefCountedGarbageCollectedLifetime : Garb
ageCollectedLifetime; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 template<typename T, LifetimeManagementType lifetime> | 61 template<typename T, LifetimeManagementType lifetime> |
| 62 class PtrStorageImpl; | 62 class PtrStorageImpl; |
| 63 | 63 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // Disable the copy constructor; classes that contain a WebPrivatePtr | 261 // Disable the copy constructor; classes that contain a WebPrivatePtr |
| 262 // should implement their copy constructor using assign(). | 262 // should implement their copy constructor using assign(). |
| 263 WebPrivatePtr(const WebPrivatePtr<T>&); | 263 WebPrivatePtr(const WebPrivatePtr<T>&); |
| 264 | 264 |
| 265 void* m_storage; | 265 void* m_storage; |
| 266 }; | 266 }; |
| 267 | 267 |
| 268 } // namespace blink | 268 } // namespace blink |
| 269 | 269 |
| 270 #endif | 270 #endif |
| OLD | NEW |