OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 template<bool> | 112 template<bool> |
113 class SupplementTracing; | 113 class SupplementTracing; |
114 | 114 |
115 template<> | 115 template<> |
116 class SupplementTracing<true> : public GarbageCollectedMixin { | 116 class SupplementTracing<true> : public GarbageCollectedMixin { |
117 public: | 117 public: |
118 virtual void trace(Visitor*) = 0; | 118 virtual void trace(Visitor*) = 0; |
119 }; | 119 }; |
120 | 120 |
121 template<> | 121 template<> |
122 class SupplementTracing<false> { }; | 122 class SupplementTracing<false> { |
| 123 public: |
| 124 virtual ~SupplementTracing() { } |
| 125 }; |
123 | 126 |
124 template<typename T, bool isGarbageCollected = false> | 127 template<typename T, bool isGarbageCollected = false> |
125 class SupplementBase : public SupplementTracing<isGarbageCollected> { | 128 class SupplementBase : public SupplementTracing<isGarbageCollected> { |
126 public: | 129 public: |
127 virtual ~SupplementBase() { } | |
128 #if SECURITY_ASSERT_ENABLED | 130 #if SECURITY_ASSERT_ENABLED |
129 virtual bool isRefCountedWrapper() const { return false; } | 131 virtual bool isRefCountedWrapper() const { return false; } |
130 #endif | 132 #endif |
131 | 133 |
132 static void provideTo(SupplementableBase<T, isGarbageCollected>& host, const
char* key, typename SupplementableTraits<T, isGarbageCollected>::SupplementArgu
mentType supplement) | 134 static void provideTo(SupplementableBase<T, isGarbageCollected>& host, const
char* key, typename SupplementableTraits<T, isGarbageCollected>::SupplementArgu
mentType supplement) |
133 { | 135 { |
134 host.provideSupplement(key, supplement); | 136 host.provideSupplement(key, supplement); |
135 } | 137 } |
136 | 138 |
137 static SupplementBase<T, isGarbageCollected>* from(SupplementableBase<T, isG
arbageCollected>& host, const char* key) | 139 static SupplementBase<T, isGarbageCollected>* from(SupplementableBase<T, isG
arbageCollected>& host, const char* key) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 }; | 223 }; |
222 | 224 |
223 template<typename T> | 225 template<typename T> |
224 struct ThreadingTrait<WebCore::SupplementableBase<T, true> > { | 226 struct ThreadingTrait<WebCore::SupplementableBase<T, true> > { |
225 static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity; | 227 static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity; |
226 }; | 228 }; |
227 | 229 |
228 } // namespace WebCore | 230 } // namespace WebCore |
229 | 231 |
230 #endif // Supplementable_h | 232 #endif // Supplementable_h |
OLD | NEW |