| 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 static_assert(IsGarbageCollectedType<T>::value, "T needs to be a garbage
collected object"); | 132 static_assert(IsGarbageCollectedType<T>::value, "T needs to be a garbage
collected object"); |
| 133 if (!t) | 133 if (!t) |
| 134 return; | 134 return; |
| 135 TraceTrait<T>::mark(Derived::fromHelper(this), t); | 135 TraceTrait<T>::mark(Derived::fromHelper(this), t); |
| 136 } | 136 } |
| 137 | 137 |
| 138 // Member version of the one-argument templated trace method. | 138 // Member version of the one-argument templated trace method. |
| 139 template<typename T> | 139 template<typename T> |
| 140 void trace(const Member<T>& t) | 140 void trace(const Member<T>& t) |
| 141 { | 141 { |
| 142 mark(t.get()); | 142 mark(t.unsafeGet()); |
| 143 } | 143 } |
| 144 | 144 |
| 145 // Fallback method used only when we need to trace raw pointers of T. | 145 // Fallback method used only when we need to trace raw pointers of T. |
| 146 // This is the case when a member is a union where we do not support members
. | 146 // This is the case when a member is a union where we do not support members
. |
| 147 template<typename T> | 147 template<typename T> |
| 148 void trace(const T* t) | 148 void trace(const T* t) |
| 149 { | 149 { |
| 150 mark(const_cast<T*>(t)); | 150 mark(const_cast<T*>(t)); |
| 151 } | 151 } |
| 152 template<typename T> | 152 template<typename T> |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 static const String get() | 389 static const String get() |
| 390 { | 390 { |
| 391 return WTF::extractTypeNameFromFunctionName(WTF::extractNameFunction<T>(
)); | 391 return WTF::extractTypeNameFromFunctionName(WTF::extractNameFunction<T>(
)); |
| 392 } | 392 } |
| 393 }; | 393 }; |
| 394 #endif | 394 #endif |
| 395 | 395 |
| 396 } // namespace blink | 396 } // namespace blink |
| 397 | 397 |
| 398 #endif // Visitor_h | 398 #endif // Visitor_h |
| OLD | NEW |