| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file defines the names used by GC infrastructure. | 5 // This file defines the names used by GC infrastructure. |
| 6 | 6 |
| 7 // TODO: Restructure the name determination to use fully qualified names (ala, | 7 // TODO: Restructure the name determination to use fully qualified names (ala, |
| 8 // blink::Foo) so that the plugin can be enabled for all of chromium. Doing so | 8 // blink::Foo) so that the plugin can be enabled for all of chromium. Doing so |
| 9 // would allow us to catch errors with structures outside of blink that might | 9 // would allow us to catch errors with structures outside of blink that might |
| 10 // have unsafe pointers to GC allocated blink structures. | 10 // have unsafe pointers to GC allocated blink structures. |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 static bool IsRefCountedBase(const std::string& name) { | 126 static bool IsRefCountedBase(const std::string& name) { |
| 127 return name == "RefCounted" || | 127 return name == "RefCounted" || |
| 128 name == "ThreadSafeRefCounted"; | 128 name == "ThreadSafeRefCounted"; |
| 129 } | 129 } |
| 130 | 130 |
| 131 static bool IsGCMixinBase(const std::string& name) { | 131 static bool IsGCMixinBase(const std::string& name) { |
| 132 return name == "GarbageCollectedMixin"; | 132 return name == "GarbageCollectedMixin"; |
| 133 } | 133 } |
| 134 | 134 |
| 135 static bool IsGCFinalizedBase(const std::string& name) { | 135 static bool IsGCFinalizedBase(const std::string& name) { |
| 136 return name == "GarbageCollectedFinalized" || | 136 return name == "GarbageCollectedFinalized"; |
| 137 name == "RefCountedGarbageCollected" || | |
| 138 name == "ThreadSafeRefCountedGarbageCollected"; | |
| 139 } | |
| 140 | |
| 141 static bool IsGCRefCountedBase(const std::string& name) { | |
| 142 return name == "RefCountedGarbageCollected" || | |
| 143 name == "ThreadSafeRefCountedGarbageCollected"; | |
| 144 } | 137 } |
| 145 | 138 |
| 146 static bool IsGCBase(const std::string& name) { | 139 static bool IsGCBase(const std::string& name) { |
| 147 return name == "GarbageCollected" || | 140 return name == "GarbageCollected" || |
| 148 IsGCFinalizedBase(name) || | 141 IsGCFinalizedBase(name) || |
| 149 IsGCMixinBase(name); | 142 IsGCMixinBase(name); |
| 150 } | 143 } |
| 151 | 144 |
| 152 // Returns true of the base classes that do not need a vtable entry for trace | 145 // Returns true of the base classes that do not need a vtable entry for trace |
| 153 // because they cannot possibly initiate a GC during construction. | 146 // because they cannot possibly initiate a GC during construction. |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 if (suffix.size() > str.size()) | 261 if (suffix.size() > str.size()) |
| 269 return false; | 262 return false; |
| 270 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; | 263 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; |
| 271 } | 264 } |
| 272 | 265 |
| 273 // Test if a template specialization is an instantiation. | 266 // Test if a template specialization is an instantiation. |
| 274 static bool IsTemplateInstantiation(clang::CXXRecordDecl* record); | 267 static bool IsTemplateInstantiation(clang::CXXRecordDecl* record); |
| 275 }; | 268 }; |
| 276 | 269 |
| 277 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ | 270 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ |
| OLD | NEW |