| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 145 |
| 146 static SupplementBase<T, isGarbageCollected>* from(SupplementableBase<T, isG
arbageCollected>* host, const char* key) | 146 static SupplementBase<T, isGarbageCollected>* from(SupplementableBase<T, isG
arbageCollected>* host, const char* key) |
| 147 { | 147 { |
| 148 return host ? host->requireSupplement(key) : 0; | 148 return host ? host->requireSupplement(key) : 0; |
| 149 } | 149 } |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 template<typename T, bool isGarbageCollected> | 152 template<typename T, bool isGarbageCollected> |
| 153 class SupplementableTracing; | 153 class SupplementableTracing; |
| 154 | 154 |
| 155 // Using a virtual inheritance to resolve a diamond inheritance |
| 156 // in ExecutionContext. |
| 155 template<typename T> | 157 template<typename T> |
| 156 class SupplementableTracing<T, true> : public GarbageCollectedMixin { | 158 class SupplementableTracing<T, true> : public virtual GarbageCollectedMixin { |
| 157 public: | 159 public: |
| 158 virtual void trace(Visitor* visitor) | 160 virtual void trace(Visitor* visitor) |
| 159 { | 161 { |
| 160 visitor->trace(m_supplements); | 162 visitor->trace(m_supplements); |
| 161 } | 163 } |
| 162 | 164 |
| 163 protected: | 165 protected: |
| 164 typedef HeapHashMap<const char*, Member<SupplementBase<T, true>>, PtrHash<co
nst char*>> SupplementMap; | 166 typedef HeapHashMap<const char*, Member<SupplementBase<T, true>>, PtrHash<co
nst char*>> SupplementMap; |
| 165 SupplementMap m_supplements; | 167 SupplementMap m_supplements; |
| 166 }; | 168 }; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 }; | 231 }; |
| 230 | 232 |
| 231 template<typename T> | 233 template<typename T> |
| 232 struct ThreadingTrait<SupplementableBase<T, true>> { | 234 struct ThreadingTrait<SupplementableBase<T, true>> { |
| 233 static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity; | 235 static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity; |
| 234 }; | 236 }; |
| 235 | 237 |
| 236 } // namespace blink | 238 } // namespace blink |
| 237 | 239 |
| 238 #endif // Supplementable_h | 240 #endif // Supplementable_h |
| OLD | NEW |