| 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 #ifndef TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ | 7 #ifndef TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ |
| 8 #define TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ | 8 #define TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ |
| 9 | 9 |
| 10 #include "clang/AST/AST.h" | 10 #include "clang/AST/AST.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 name == "PersistentHeapHashCountedSet" || | 84 name == "PersistentHeapHashCountedSet" || |
| 85 name == "PersistentHeapHashMap"; | 85 name == "PersistentHeapHashMap"; |
| 86 } | 86 } |
| 87 | 87 |
| 88 static bool IsHashMap(const std::string& name) { | 88 static bool IsHashMap(const std::string& name) { |
| 89 return name == "HashMap" || | 89 return name == "HashMap" || |
| 90 name == "HeapHashMap" || | 90 name == "HeapHashMap" || |
| 91 name == "PersistentHeapHashMap"; | 91 name == "PersistentHeapHashMap"; |
| 92 } | 92 } |
| 93 | 93 |
| 94 // Following http://crrev.com/369633033 (Blink r177436), |
| 95 // ignore WebCore::ScriptWrappable's destructor. |
| 96 // FIXME: remove when its non-Oilpan destructor is removed. |
| 97 static bool HasIgnorableDestructor(const std::string& ns, |
| 98 const std::string& name) { |
| 99 return ns == "WebCore" && name == "ScriptWrappable"; |
| 100 } |
| 101 |
| 94 // Assumes name is a valid collection name. | 102 // Assumes name is a valid collection name. |
| 95 static size_t CollectionDimension(const std::string& name) { | 103 static size_t CollectionDimension(const std::string& name) { |
| 96 return (IsHashMap(name) || name == "pair") ? 2 : 1; | 104 return (IsHashMap(name) || name == "pair") ? 2 : 1; |
| 97 } | 105 } |
| 98 | 106 |
| 99 static bool IsGCMixinBase(const std::string& name) { | 107 static bool IsGCMixinBase(const std::string& name) { |
| 100 return name == "GarbageCollectedMixin"; | 108 return name == "GarbageCollectedMixin"; |
| 101 } | 109 } |
| 102 | 110 |
| 103 static bool IsGCFinalizedBase(const std::string& name) { | 111 static bool IsGCFinalizedBase(const std::string& name) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 172 } |
| 165 | 173 |
| 166 static bool EndsWith(const std::string& str, const std::string& suffix) { | 174 static bool EndsWith(const std::string& str, const std::string& suffix) { |
| 167 if (suffix.size() > str.size()) | 175 if (suffix.size() > str.size()) |
| 168 return false; | 176 return false; |
| 169 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; | 177 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; |
| 170 } | 178 } |
| 171 }; | 179 }; |
| 172 | 180 |
| 173 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ | 181 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ |
| OLD | NEW |