| 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. |
| 11 | 11 |
| 12 #ifndef TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ | 12 #ifndef TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ |
| 13 #define TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ | 13 #define TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ |
| 14 | 14 |
| 15 #include "clang/AST/AST.h" | 15 #include "clang/AST/AST.h" |
| 16 #include "clang/AST/Attr.h" | 16 #include "clang/AST/Attr.h" |
| 17 | 17 |
| 18 const char kNewOperatorName[] = "operator new"; | 18 const char kNewOperatorName[] = "operator new"; |
| 19 const char kCreateName[] = "create"; | 19 const char kCreateName[] = "create"; |
| 20 const char kTraceName[] = "trace"; | 20 const char kTraceName[] = "trace"; |
| 21 const char kTraceImplName[] = "traceImpl"; | 21 const char kTraceImplName[] = "traceImpl"; |
| 22 const char kFinalizeName[] = "finalizeGarbageCollectedObject"; | 22 const char kFinalizeName[] = "finalizeGarbageCollectedObject"; |
| 23 const char kTraceAfterDispatchName[] = "traceAfterDispatch"; | 23 const char kTraceAfterDispatchName[] = "traceAfterDispatch"; |
| 24 const char kRegisterWeakMembersName[] = "registerWeakMembers"; | 24 const char kRegisterWeakMembersName[] = "registerWeakMembers"; |
| 25 const char kHeapAllocatorName[] = "HeapAllocator"; | 25 const char kHeapAllocatorName[] = "HeapAllocator"; |
| 26 const char kTraceIfNeededName[] = "TraceIfNeeded"; | 26 const char kTraceIfNeededName[] = "TraceIfNeeded"; |
| 27 const char kVisitorDispatcherName[] = "VisitorDispatcher"; | 27 const char kVisitorDispatcherName[] = "VisitorDispatcher"; |
| 28 const char kAdjustAndMarkName[] = "adjustAndMark"; |
| 29 const char kIsHeapObjectAliveName[] = "isHeapObjectAlive"; |
| 28 | 30 |
| 29 class Config { | 31 class Config { |
| 30 public: | 32 public: |
| 31 static bool IsMember(const std::string& name) { | 33 static bool IsMember(const std::string& name) { |
| 32 return name == "Member"; | 34 return name == "Member"; |
| 33 } | 35 } |
| 34 | 36 |
| 35 static bool IsWeakMember(const std::string& name) { | 37 static bool IsWeakMember(const std::string& name) { |
| 36 return name == "WeakMember"; | 38 return name == "WeakMember"; |
| 37 } | 39 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 233 } |
| 232 | 234 |
| 233 static bool EndsWith(const std::string& str, const std::string& suffix) { | 235 static bool EndsWith(const std::string& str, const std::string& suffix) { |
| 234 if (suffix.size() > str.size()) | 236 if (suffix.size() > str.size()) |
| 235 return false; | 237 return false; |
| 236 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; | 238 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; |
| 237 } | 239 } |
| 238 }; | 240 }; |
| 239 | 241 |
| 240 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ | 242 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ |
| OLD | NEW |