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

Side by Side Diff: third_party/WebKit/Source/platform/heap/Persistent.h

Issue 2518253002: Move Partition Allocator into Chromium base. (Closed)
Patch Set: Move OOM_CRASH into its own, more specific header. Fixes Windows build. Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef Persistent_h 5 #ifndef Persistent_h
6 #define Persistent_h 6 #define Persistent_h
7 7
8 #include "platform/heap/Heap.h" 8 #include "platform/heap/Heap.h"
9 #include "platform/heap/Member.h" 9 #include "platform/heap/Member.h"
10 #include "platform/heap/PersistentNode.h" 10 #include "platform/heap/PersistentNode.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 return *this; 553 return *this;
554 } 554 }
555 }; 555 };
556 556
557 template <typename Collection> 557 template <typename Collection>
558 class PersistentHeapCollectionBase : public Collection { 558 class PersistentHeapCollectionBase : public Collection {
559 // We overload the various new and delete operators with using the WTF 559 // We overload the various new and delete operators with using the WTF
560 // PartitionAllocator to ensure persistent heap collections are always 560 // PartitionAllocator to ensure persistent heap collections are always
561 // allocated off-heap. This allows persistent collections to be used in 561 // allocated off-heap. This allows persistent collections to be used in
562 // DEFINE_STATIC_LOCAL et. al. 562 // DEFINE_STATIC_LOCAL et. al.
563 WTF_USE_ALLOCATOR(PersistentHeapCollectionBase, WTF::PartitionAllocator); 563 USE_ALLOCATOR(PersistentHeapCollectionBase, WTF::PartitionAllocator);
564 IS_PERSISTENT_REFERENCE_TYPE(); 564 IS_PERSISTENT_REFERENCE_TYPE();
565 565
566 public: 566 public:
567 PersistentHeapCollectionBase() { initialize(); } 567 PersistentHeapCollectionBase() { initialize(); }
568 568
569 PersistentHeapCollectionBase(const PersistentHeapCollectionBase& other) 569 PersistentHeapCollectionBase(const PersistentHeapCollectionBase& other)
570 : Collection(other) { 570 : Collection(other) {
571 initialize(); 571 initialize();
572 } 572 }
573 573
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 static blink::CrossThreadPersistent<T> Unwrap( 820 static blink::CrossThreadPersistent<T> Unwrap(
821 const blink::CrossThreadWeakPersistent<T>& wrapped) { 821 const blink::CrossThreadWeakPersistent<T>& wrapped) {
822 blink::CrossThreadPersistentRegion::LockScope persistentLock( 822 blink::CrossThreadPersistentRegion::LockScope persistentLock(
823 blink::ProcessHeap::crossThreadPersistentRegion()); 823 blink::ProcessHeap::crossThreadPersistentRegion());
824 return blink::CrossThreadPersistent<T>(wrapped.get()); 824 return blink::CrossThreadPersistent<T>(wrapped.get());
825 } 825 }
826 }; 826 };
827 } 827 }
828 828
829 #endif // Persistent_h 829 #endif // Persistent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698