| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // the argument to get the TraceTrait. By default, the mark method | 152 // the argument to get the TraceTrait. By default, the mark method |
| 153 // of the TraceTrait just calls the virtual two-argument mark method on this | 153 // of the TraceTrait just calls the virtual two-argument mark method on this |
| 154 // visitor, where the second argument is the static trace method of the trai
t. | 154 // visitor, where the second argument is the static trace method of the trai
t. |
| 155 template<typename T> | 155 template<typename T> |
| 156 void mark(T* t) | 156 void mark(T* t) |
| 157 { | 157 { |
| 158 static_assert(sizeof(T), "T must be fully defined"); | 158 static_assert(sizeof(T), "T must be fully defined"); |
| 159 static_assert(IsGarbageCollectedType<T>::value, "T needs to be a garbage
collected object"); | 159 static_assert(IsGarbageCollectedType<T>::value, "T needs to be a garbage
collected object"); |
| 160 if (!t) | 160 if (!t) |
| 161 return; | 161 return; |
| 162 #if ENABLE(ASSERT) | |
| 163 TraceTrait<T>::checkGCInfo(t); | |
| 164 #endif | |
| 165 TraceTrait<T>::mark(Derived::fromHelper(this), t); | 162 TraceTrait<T>::mark(Derived::fromHelper(this), t); |
| 166 } | 163 } |
| 167 | 164 |
| 168 // Member version of the one-argument templated trace method. | 165 // Member version of the one-argument templated trace method. |
| 169 template<typename T> | 166 template<typename T> |
| 170 void trace(const Member<T>& t) | 167 void trace(const Member<T>& t) |
| 171 { | 168 { |
| 172 mark(t.get()); | 169 mark(t.get()); |
| 173 } | 170 } |
| 174 | 171 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 { | 424 { |
| 428 DEFINE_STATIC_LOCAL(String, typenameString, (WTF::extractTypeNameFromFun
ctionName(WTF::extractNameFunction<T>()))); | 425 DEFINE_STATIC_LOCAL(String, typenameString, (WTF::extractTypeNameFromFun
ctionName(WTF::extractNameFunction<T>()))); |
| 429 return typenameString; | 426 return typenameString; |
| 430 } | 427 } |
| 431 }; | 428 }; |
| 432 #endif | 429 #endif |
| 433 | 430 |
| 434 } // namespace blink | 431 } // namespace blink |
| 435 | 432 |
| 436 #endif // Visitor_h | 433 #endif // Visitor_h |
| OLD | NEW |