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

Side by Side Diff: sky/engine/platform/heap/Handle.h

Issue 683703003: Remove various Heap* types. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « sky/engine/platform/Supplementable.h ('k') | sky/engine/platform/heap/Heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 static const bool canInitializeWithMemset = true; 599 static const bool canInitializeWithMemset = true;
600 static const bool canMoveWithMemcpy = true; 600 static const bool canMoveWithMemcpy = true;
601 }; 601 };
602 602
603 template <typename T> struct VectorTraits<blink::WeakMember<T> > : VectorTraitsB ase<blink::WeakMember<T> > { 603 template <typename T> struct VectorTraits<blink::WeakMember<T> > : VectorTraitsB ase<blink::WeakMember<T> > {
604 static const bool needsDestruction = false; 604 static const bool needsDestruction = false;
605 static const bool canInitializeWithMemset = true; 605 static const bool canInitializeWithMemset = true;
606 static const bool canMoveWithMemcpy = true; 606 static const bool canMoveWithMemcpy = true;
607 }; 607 };
608 608
609 template <typename T> struct VectorTraits<blink::HeapVector<T, 0> > : VectorTrai tsBase<blink::HeapVector<T, 0> > {
610 static const bool needsDestruction = false;
611 static const bool canInitializeWithMemset = true;
612 static const bool canMoveWithMemcpy = true;
613 };
614
615 template <typename T> struct VectorTraits<blink::HeapDeque<T, 0> > : VectorTrait sBase<blink::HeapDeque<T, 0> > {
616 static const bool needsDestruction = false;
617 static const bool canInitializeWithMemset = true;
618 static const bool canMoveWithMemcpy = true;
619 };
620
621 template <typename T, size_t inlineCapacity> struct VectorTraits<blink::HeapVect or<T, inlineCapacity> > : VectorTraitsBase<blink::HeapVector<T, inlineCapacity> > {
622 static const bool needsDestruction = VectorTraits<T>::needsDestruction;
623 static const bool canInitializeWithMemset = VectorTraits<T>::canInitializeWi thMemset;
624 static const bool canMoveWithMemcpy = VectorTraits<T>::canMoveWithMemcpy;
625 };
626
627 template <typename T, size_t inlineCapacity> struct VectorTraits<blink::HeapDequ e<T, inlineCapacity> > : VectorTraitsBase<blink::HeapDeque<T, inlineCapacity> > {
628 static const bool needsDestruction = VectorTraits<T>::needsDestruction;
629 static const bool canInitializeWithMemset = VectorTraits<T>::canInitializeWi thMemset;
630 static const bool canMoveWithMemcpy = VectorTraits<T>::canMoveWithMemcpy;
631 };
632
633 template<typename T> struct HashTraits<blink::Member<T> > : SimpleClassHashTrait s<blink::Member<T> > { 609 template<typename T> struct HashTraits<blink::Member<T> > : SimpleClassHashTrait s<blink::Member<T> > {
634 static const bool needsDestruction = false; 610 static const bool needsDestruction = false;
635 // FIXME: The distinction between PeekInType and PassInType is there for 611 // FIXME: The distinction between PeekInType and PassInType is there for
636 // the sake of the reference counting handles. When they are gone the two 612 // the sake of the reference counting handles. When they are gone the two
637 // types can be merged into PassInType. 613 // types can be merged into PassInType.
638 // FIXME: Implement proper const'ness for iterator types. Requires support 614 // FIXME: Implement proper const'ness for iterator types. Requires support
639 // in the marking Visitor. 615 // in the marking Visitor.
640 typedef RawPtr<T> PeekInType; 616 typedef RawPtr<T> PeekInType;
641 typedef RawPtr<T> PassInType; 617 typedef RawPtr<T> PassInType;
642 typedef blink::Member<T>* IteratorGetType; 618 typedef blink::Member<T>* IteratorGetType;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 template<typename T> inline T* getPtr(const blink::Member<T>& p) 710 template<typename T> inline T* getPtr(const blink::Member<T>& p)
735 { 711 {
736 return p.get(); 712 return p.get();
737 } 713 }
738 714
739 template<typename T> inline T* getPtr(const blink::Persistent<T>& p) 715 template<typename T> inline T* getPtr(const blink::Persistent<T>& p)
740 { 716 {
741 return p.get(); 717 return p.get();
742 } 718 }
743 719
744 template<typename T, size_t inlineCapacity>
745 struct NeedsTracing<ListHashSetNode<T, blink::HeapListHashSetAllocator<T, inline Capacity> > *> {
746 // All heap allocated node pointers need visiting to keep the nodes alive,
747 // regardless of whether they contain pointers to other heap allocated
748 // objects.
749 static const bool value = true;
750 };
751
752 // For wtf/Functional.h 720 // For wtf/Functional.h
753 template<typename T, bool isGarbageCollected> struct PointerParamStorageTraits; 721 template<typename T, bool isGarbageCollected> struct PointerParamStorageTraits;
754 722
755 template<typename T> 723 template<typename T>
756 struct PointerParamStorageTraits<T*, false> { 724 struct PointerParamStorageTraits<T*, false> {
757 typedef T* StorageType; 725 typedef T* StorageType;
758 726
759 static StorageType wrap(T* value) { return value; } 727 static StorageType wrap(T* value) { return value; }
760 static T* unwrap(const StorageType& value) { return value; } 728 static T* unwrap(const StorageType& value) { return value; }
761 }; 729 };
762 730
763 template<typename T> 731 template<typename T>
764 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, false> { 732 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, false> {
765 }; 733 };
766 734
767 template<typename T> 735 template<typename T>
768 struct ParamStorageTraits<RawPtr<T> > : public PointerParamStorageTraits<T*, fal se> { 736 struct ParamStorageTraits<RawPtr<T> > : public PointerParamStorageTraits<T*, fal se> {
769 }; 737 };
770 738
771 } // namespace WTF 739 } // namespace WTF
772 740
773 #endif 741 #endif
OLDNEW
« no previous file with comments | « sky/engine/platform/Supplementable.h ('k') | sky/engine/platform/heap/Heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698