| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 static bool IsWeakMember(const std::string& name) { | 42 static bool IsWeakMember(const std::string& name) { |
| 43 return name == "WeakMember"; | 43 return name == "WeakMember"; |
| 44 } | 44 } |
| 45 | 45 |
| 46 static bool IsMemberHandle(const std::string& name) { | 46 static bool IsMemberHandle(const std::string& name) { |
| 47 return IsMember(name) || | 47 return IsMember(name) || |
| 48 IsWeakMember(name); | 48 IsWeakMember(name); |
| 49 } | 49 } |
| 50 | 50 |
| 51 static bool IsPersistent(const std::string& name) { | 51 static bool IsPersistent(const std::string& name) { |
| 52 return name == "Persistent"; | 52 return name == "Persistent" || |
| 53 name == "WeakPersistent" ; |
| 53 } | 54 } |
| 54 | 55 |
| 55 static bool IsPersistentHandle(const std::string& name) { | 56 static bool IsCrossThreadPersistent(const std::string& name) { |
| 56 return IsPersistent(name) || | 57 return name == "CrossThreadPersistent" || |
| 57 IsPersistentGCCollection(name); | 58 name == "CrossThreadWeakPersistent" ; |
| 58 } | |
| 59 | |
| 60 static bool IsRawPtr(const std::string& name) { | |
| 61 return name == "RawPtr"; | |
| 62 } | 59 } |
| 63 | 60 |
| 64 static bool IsRefPtr(const std::string& name) { | 61 static bool IsRefPtr(const std::string& name) { |
| 65 return name == "RefPtr"; | 62 return name == "RefPtr"; |
| 66 } | 63 } |
| 67 | 64 |
| 68 static bool IsOwnPtr(const std::string& name) { | 65 static bool IsOwnPtr(const std::string& name) { |
| 69 return name == "OwnPtr"; | 66 return name == "OwnPtr"; |
| 70 } | 67 } |
| 71 | 68 |
| 69 static bool IsUniquePtr(const std::string& name) { |
| 70 return name == "unique_ptr"; |
| 71 } |
| 72 |
| 72 static bool IsWTFCollection(const std::string& name) { | 73 static bool IsWTFCollection(const std::string& name) { |
| 73 return name == "Vector" || | 74 return name == "Vector" || |
| 74 name == "Deque" || | 75 name == "Deque" || |
| 75 name == "HashSet" || | 76 name == "HashSet" || |
| 76 name == "ListHashSet" || | 77 name == "ListHashSet" || |
| 77 name == "LinkedHashSet" || | 78 name == "LinkedHashSet" || |
| 78 name == "HashCountedSet" || | 79 name == "HashCountedSet" || |
| 79 name == "HashMap"; | 80 name == "HashMap"; |
| 80 } | 81 } |
| 81 | 82 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 if (suffix.size() > str.size()) | 262 if (suffix.size() > str.size()) |
| 262 return false; | 263 return false; |
| 263 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; | 264 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; |
| 264 } | 265 } |
| 265 | 266 |
| 266 // Test if a template specialization is an instantiation. | 267 // Test if a template specialization is an instantiation. |
| 267 static bool IsTemplateInstantiation(clang::CXXRecordDecl* record); | 268 static bool IsTemplateInstantiation(clang::CXXRecordDecl* record); |
| 268 }; | 269 }; |
| 269 | 270 |
| 270 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ | 271 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ |
| OLD | NEW |