| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 template<typename T> | 249 template<typename T> |
| 250 class Supplement : public SupplementBase<T, false> { }; | 250 class Supplement : public SupplementBase<T, false> { }; |
| 251 | 251 |
| 252 // This class is used to make an off-heap class supplementable with off-heap | 252 // This class is used to make an off-heap class supplementable with off-heap |
| 253 // supplements (Supplement). | 253 // supplements (Supplement). |
| 254 template<typename T> | 254 template<typename T> |
| 255 class GC_PLUGIN_IGNORE("http://crbug.com/395036") Supplementable : public Supple
mentableBase<T, false> { | 255 class GC_PLUGIN_IGNORE("http://crbug.com/395036") Supplementable : public Supple
mentableBase<T, false> { |
| 256 public: | 256 public: |
| 257 virtual void trace(Visitor* visitor) | 257 virtual void trace(Visitor* visitor) |
| 258 { | 258 { |
| 259 // No tracing of off-heap supplements. We should not have any Supplement
able | |
| 260 // object on the heap. Either the object is HeapSupplementable or if it
is | |
| 261 // off heap it should use PersistentHeapSupplementable to trace any on-h
eap | |
| 262 // supplements. | |
| 263 COMPILE_ASSERT(!IsGarbageCollectedType<T>::value, GarbageCollectedObject
MustBeHeapSupplementable); | |
| 264 SupplementableBase<T, false>::trace(visitor); | |
| 265 } | 259 } |
| 266 }; | 260 }; |
| 267 | 261 |
| 268 template<typename T> | 262 template<typename T> |
| 269 struct ThreadingTrait<SupplementBase<T, true> > { | 263 struct ThreadingTrait<SupplementBase<T, true> > { |
| 270 static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity; | 264 static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity; |
| 271 }; | 265 }; |
| 272 | 266 |
| 273 template<typename T> | 267 template<typename T> |
| 274 struct ThreadingTrait<SupplementableBase<T, true> > { | 268 struct ThreadingTrait<SupplementableBase<T, true> > { |
| 275 static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity; | 269 static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity; |
| 276 }; | 270 }; |
| 277 | 271 |
| 278 } // namespace blink | 272 } // namespace blink |
| 279 | 273 |
| 280 #endif // Supplementable_h | 274 #endif // Supplementable_h |
| OLD | NEW |