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

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

Issue 2518253002: Move Partition Allocator into Chromium base. (Closed)
Patch Set: Created 4 years, 1 month 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 return *this; 549 return *this;
550 } 550 }
551 }; 551 };
552 552
553 template <typename Collection> 553 template <typename Collection>
554 class PersistentHeapCollectionBase : public Collection { 554 class PersistentHeapCollectionBase : public Collection {
555 // We overload the various new and delete operators with using the WTF 555 // We overload the various new and delete operators with using the WTF
556 // PartitionAllocator to ensure persistent heap collections are always 556 // PartitionAllocator to ensure persistent heap collections are always
557 // allocated off-heap. This allows persistent collections to be used in 557 // allocated off-heap. This allows persistent collections to be used in
558 // DEFINE_STATIC_LOCAL et. al. 558 // DEFINE_STATIC_LOCAL et. al.
559 WTF_USE_ALLOCATOR(PersistentHeapCollectionBase, WTF::PartitionAllocator); 559 USE_ALLOCATOR(PersistentHeapCollectionBase, base::PartitionAllocator);
560 IS_PERSISTENT_REFERENCE_TYPE(); 560 IS_PERSISTENT_REFERENCE_TYPE();
561 561
562 public: 562 public:
563 PersistentHeapCollectionBase() { initialize(); } 563 PersistentHeapCollectionBase() { initialize(); }
564 564
565 PersistentHeapCollectionBase(const PersistentHeapCollectionBase& other) 565 PersistentHeapCollectionBase(const PersistentHeapCollectionBase& other)
566 : Collection(other) { 566 : Collection(other) {
567 initialize(); 567 initialize();
568 } 568 }
569 569
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 static blink::CrossThreadPersistent<T> Unwrap( 816 static blink::CrossThreadPersistent<T> Unwrap(
817 const blink::CrossThreadWeakPersistent<T>& wrapped) { 817 const blink::CrossThreadWeakPersistent<T>& wrapped) {
818 blink::CrossThreadPersistentRegion::LockScope persistentLock( 818 blink::CrossThreadPersistentRegion::LockScope persistentLock(
819 blink::ProcessHeap::crossThreadPersistentRegion()); 819 blink::ProcessHeap::crossThreadPersistentRegion());
820 return blink::CrossThreadPersistent<T>(wrapped.get()); 820 return blink::CrossThreadPersistent<T>(wrapped.get());
821 } 821 }
822 }; 822 };
823 } 823 }
824 824
825 #endif // Persistent_h 825 #endif // Persistent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698