Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: third_party/WebKit/Source/platform/heap/Visitor.h

Issue 1411603007: [Oilpan] Add use-after-free detector in Member<> Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698