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