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

Side by Side Diff: tools/clang/blink_gc_plugin/Config.h

Issue 2060553002: GC plugin: improve error reporting when tracing illegal fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: robustify namespace equality checking instead Created 4 years, 6 months 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 // 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
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 }
59 60
60 static bool IsRefPtr(const std::string& name) { 61 static bool IsRefPtr(const std::string& name) {
61 return name == "RefPtr"; 62 return name == "RefPtr";
62 } 63 }
63 64
64 static bool IsOwnPtr(const std::string& name) { 65 static bool IsOwnPtr(const std::string& name) {
65 return name == "OwnPtr"; 66 return name == "OwnPtr";
66 } 67 }
67 68
69 static bool IsUniquePtr(const std::string& name) {
70 return name == "unique_ptr";
71 }
72
68 static bool IsWTFCollection(const std::string& name) { 73 static bool IsWTFCollection(const std::string& name) {
69 return name == "Vector" || 74 return name == "Vector" ||
70 name == "Deque" || 75 name == "Deque" ||
71 name == "HashSet" || 76 name == "HashSet" ||
72 name == "ListHashSet" || 77 name == "ListHashSet" ||
73 name == "LinkedHashSet" || 78 name == "LinkedHashSet" ||
74 name == "HashCountedSet" || 79 name == "HashCountedSet" ||
75 name == "HashMap"; 80 name == "HashMap";
76 } 81 }
77 82
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 if (suffix.size() > str.size()) 250 if (suffix.size() > str.size())
246 return false; 251 return false;
247 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; 252 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
248 } 253 }
249 254
250 // Test if a template specialization is an instantiation. 255 // Test if a template specialization is an instantiation.
251 static bool IsTemplateInstantiation(clang::CXXRecordDecl* record); 256 static bool IsTemplateInstantiation(clang::CXXRecordDecl* record);
252 }; 257 };
253 258
254 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ 259 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_
OLDNEW
« no previous file with comments | « tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp ('k') | tools/clang/blink_gc_plugin/DiagnosticsReporter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698