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 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 template<typename T> | 884 template<typename T> |
885 struct NeedsTracing<WebCore::Member<T> > { | 885 struct NeedsTracing<WebCore::Member<T> > { |
886 static const bool value = true; | 886 static const bool value = true; |
887 }; | 887 }; |
888 | 888 |
889 template<typename T> | 889 template<typename T> |
890 struct IsWeak<WebCore::WeakMember<T> > { | 890 struct IsWeak<WebCore::WeakMember<T> > { |
891 static const bool value = true; | 891 static const bool value = true; |
892 }; | 892 }; |
893 | 893 |
894 template<typename Key, typename Value, typename Extractor, typename Traits, type
name KeyTraits> | 894 template<typename Table> |
895 struct IsWeak<WebCore::HeapHashTableBacking<Key, Value, Extractor, Traits, KeyTr
aits> > { | 895 struct IsWeak<WebCore::HeapHashTableBacking<Table> > { |
896 static const bool value = Traits::isWeak; | 896 static const bool value = Table::ValueTraits::isWeak; |
897 }; | 897 }; |
898 | 898 |
899 template<typename T> inline T* getPtr(const WebCore::Member<T>& p) | 899 template<typename T> inline T* getPtr(const WebCore::Member<T>& p) |
900 { | 900 { |
901 return p.get(); | 901 return p.get(); |
902 } | 902 } |
903 | 903 |
904 template<typename T, typename U> | 904 template<typename T, typename U> |
905 struct NeedsTracing<std::pair<T, U> > { | 905 struct NeedsTracing<std::pair<T, U> > { |
906 static const bool value = NeedsTracing<T>::value || NeedsTracing<U>::value |
| IsWeak<T>::value || IsWeak<U>::value; | 906 static const bool value = NeedsTracing<T>::value || NeedsTracing<U>::value |
| IsWeak<T>::value || IsWeak<U>::value; |
907 }; | 907 }; |
908 | 908 |
909 // We define specialization of the NeedsTracing trait for off heap collections | 909 // We define specialization of the NeedsTracing trait for off heap collections |
910 // since we don't support tracing them. | 910 // since we don't support tracing them. |
911 template<typename T> | 911 template<typename T, size_t N> |
912 struct NeedsTracing<Vector<T> > { | 912 struct NeedsTracing<Vector<T, N> > { |
913 static const bool value = false; | 913 static const bool value = false; |
914 }; | 914 }; |
915 | 915 |
916 template<typename T, size_t N> | 916 template<typename T, size_t N> |
917 struct NeedsTracing<Deque<T, N> > { | 917 struct NeedsTracing<Deque<T, N> > { |
918 static const bool value = false; | 918 static const bool value = false; |
919 }; | 919 }; |
920 | 920 |
921 template<typename T> | 921 template<typename T> |
922 struct NeedsTracing<HashSet<T> > { | 922 struct NeedsTracing<HashSet<T> > { |
923 static const bool value = false; | 923 static const bool value = false; |
924 }; | 924 }; |
925 | 925 |
926 template<typename T> | 926 template<typename T> |
927 struct NeedsTracing<ListHashSet<T> > { | 927 struct NeedsTracing<ListHashSet<T> > { |
928 static const bool value = false; | 928 static const bool value = false; |
929 }; | 929 }; |
930 | 930 |
931 template<typename T, typename U> | 931 template<typename T, typename U> |
932 struct NeedsTracing<HashMap<T, U> > { | 932 struct NeedsTracing<HashMap<T, U> > { |
933 static const bool value = false; | 933 static const bool value = false; |
934 }; | 934 }; |
935 | 935 |
936 } // namespace WTF | 936 } // namespace WTF |
937 | 937 |
938 #endif | 938 #endif |
OLD | NEW |