Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 template<typename T> class GarbageCollected; | 132 template<typename T> class GarbageCollected; |
| 133 class GarbageCollectedMixin; | 133 class GarbageCollectedMixin; |
| 134 template<typename T, bool = WTF::IsSubclassOfTemplate<typename WTF::RemoveConst< T>::Type, GarbageCollected>::value> class NeedsAdjustAndMark; | 134 template<typename T, bool = WTF::IsSubclassOfTemplate<typename WTF::RemoveConst< T>::Type, GarbageCollected>::value> class NeedsAdjustAndMark; |
| 135 | 135 |
| 136 template<typename T> | 136 template<typename T> |
| 137 class NeedsAdjustAndMark<T, true> { | 137 class NeedsAdjustAndMark<T, true> { |
| 138 public: | 138 public: |
| 139 static const bool value = false; | 139 static const bool value = false; |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 template <typename T> const bool NeedsAdjustAndMark<T, true>::value; | |
|
Ken Russell (switch to Gerrit)
2014/07/30 22:21:29
Why is this out-of-line definition needed? Will th
Nico
2014/07/30 22:26:02
Yes, that seems wrong.
Nick Bray (chromium)
2014/07/30 22:33:45
It isn't technically "out-of-line" because the inl
| |
| 143 | |
| 142 template<typename T> | 144 template<typename T> |
| 143 class NeedsAdjustAndMark<T, false> { | 145 class NeedsAdjustAndMark<T, false> { |
| 144 public: | 146 public: |
| 145 static const bool value = WTF::IsSubclass<typename WTF::RemoveConst<T>::Type , GarbageCollectedMixin>::value; | 147 static const bool value = WTF::IsSubclass<typename WTF::RemoveConst<T>::Type , GarbageCollectedMixin>::value; |
| 146 }; | 148 }; |
| 147 | 149 |
| 150 template <typename T> const bool NeedsAdjustAndMark<T, false>::value; | |
| 151 | |
| 148 template<typename T, bool = NeedsAdjustAndMark<T>::value> class DefaultTraceTrai t; | 152 template<typename T, bool = NeedsAdjustAndMark<T>::value> class DefaultTraceTrai t; |
| 149 | 153 |
| 150 // The TraceTrait is used to specify how to mark an object pointer and | 154 // The TraceTrait is used to specify how to mark an object pointer and |
| 151 // how to trace all of the pointers in the object. | 155 // how to trace all of the pointers in the object. |
| 152 // | 156 // |
| 153 // By default, the 'trace' method implemented on an object itself is | 157 // By default, the 'trace' method implemented on an object itself is |
| 154 // used to trace the pointers to other heap objects inside the object. | 158 // used to trace the pointers to other heap objects inside the object. |
| 155 // | 159 // |
| 156 // However, the TraceTrait can be specialized to use a different | 160 // However, the TraceTrait can be specialized to use a different |
| 157 // implementation. A common case where a TraceTrait specialization is | 161 // implementation. A common case where a TraceTrait specialization is |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 630 struct GCInfoTrait { | 634 struct GCInfoTrait { |
| 631 static const GCInfo* get() | 635 static const GCInfo* get() |
| 632 { | 636 { |
| 633 return GCInfoAtBase<typename GetGarbageCollectedBase<T>::type>::get(); | 637 return GCInfoAtBase<typename GetGarbageCollectedBase<T>::type>::get(); |
| 634 } | 638 } |
| 635 }; | 639 }; |
| 636 | 640 |
| 637 } | 641 } |
| 638 | 642 |
| 639 #endif | 643 #endif |
| OLD | NEW |