| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 class CrossThreadPersistent : public Persistent<T, GlobalPersistents> { | 637 class CrossThreadPersistent : public Persistent<T, GlobalPersistents> { |
| 638 WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(CrossThreadPersistent); | 638 WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(CrossThreadPersistent); |
| 639 WTF_DISALLOW_ZERO_ASSIGNMENT(CrossThreadPersistent); | 639 WTF_DISALLOW_ZERO_ASSIGNMENT(CrossThreadPersistent); |
| 640 public: | 640 public: |
| 641 CrossThreadPersistent(T* raw) : Persistent<T, GlobalPersistents>(raw) { } | 641 CrossThreadPersistent(T* raw) : Persistent<T, GlobalPersistents>(raw) { } |
| 642 | 642 |
| 643 using Persistent<T, GlobalPersistents>::operator=; | 643 using Persistent<T, GlobalPersistents>::operator=; |
| 644 }; | 644 }; |
| 645 | 645 |
| 646 // FIXME: derive affinity based on the collection. | 646 // FIXME: derive affinity based on the collection. |
| 647 template<typename Collection, ThreadAffinity Affinity = AnyThread> | 647 template<typename Collection, ThreadAffinity Affinity = AnyThreadAffinity> |
| 648 class PersistentHeapCollectionBase | 648 class PersistentHeapCollectionBase |
| 649 : public Collection | 649 : public Collection |
| 650 , public PersistentBase<ThreadLocalPersistents<Affinity>, PersistentHeapColl
ectionBase<Collection, Affinity> > { | 650 , public PersistentBase<ThreadLocalPersistents<Affinity>, PersistentHeapColl
ectionBase<Collection, Affinity> > { |
| 651 // We overload the various new and delete operators with using the WTF Defau
ltAllocator to ensure persistent | 651 // We overload the various new and delete operators with using the WTF Defau
ltAllocator to ensure persistent |
| 652 // heap collections are always allocated off-heap. This allows persistent co
llections to be used in | 652 // heap collections are always allocated off-heap. This allows persistent co
llections to be used in |
| 653 // DEFINE_STATIC_LOCAL et. al. | 653 // DEFINE_STATIC_LOCAL et. al. |
| 654 WTF_USE_ALLOCATOR(PersistentHeapCollectionBase, WTF::DefaultAllocator); | 654 WTF_USE_ALLOCATOR(PersistentHeapCollectionBase, WTF::DefaultAllocator); |
| 655 public: | 655 public: |
| 656 PersistentHeapCollectionBase() { } | 656 PersistentHeapCollectionBase() { } |
| 657 | 657 |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1349 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, blink::IsGa
rbageCollectedType<T>::value> { | 1349 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, blink::IsGa
rbageCollectedType<T>::value> { |
| 1350 }; | 1350 }; |
| 1351 | 1351 |
| 1352 template<typename T> | 1352 template<typename T> |
| 1353 struct ParamStorageTraits<RawPtr<T> > : public PointerParamStorageTraits<T*, bli
nk::IsGarbageCollectedType<T>::value> { | 1353 struct ParamStorageTraits<RawPtr<T> > : public PointerParamStorageTraits<T*, bli
nk::IsGarbageCollectedType<T>::value> { |
| 1354 }; | 1354 }; |
| 1355 | 1355 |
| 1356 } // namespace WTF | 1356 } // namespace WTF |
| 1357 | 1357 |
| 1358 #endif | 1358 #endif |
| OLD | NEW |