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

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

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 years, 9 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
« no previous file with comments | « tools/clang/blink_gc_plugin/CMakeLists.txt ('k') | tools/clang/blink_gc_plugin/Edge.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 return NOT_TRACE_METHOD; 229 return NOT_TRACE_METHOD;
230 } else if (!IsVisitorPtrType(formal_type)) { 230 } else if (!IsVisitorPtrType(formal_type)) {
231 return NOT_TRACE_METHOD; 231 return NOT_TRACE_METHOD;
232 } 232 }
233 233
234 if (name == kTraceName) 234 if (name == kTraceName)
235 return TRACE_METHOD; 235 return TRACE_METHOD;
236 if (name == kTraceAfterDispatchName) 236 if (name == kTraceAfterDispatchName)
237 return TRACE_AFTER_DISPATCH_METHOD; 237 return TRACE_AFTER_DISPATCH_METHOD;
238 if (name == kTraceImplName) 238 if (name == kTraceImplName)
239 return TRACE_AFTER_DISPATCH_METHOD; 239 return TRACE_IMPL_METHOD;
240 if (name == kTraceAfterDispatchImplName) 240 if (name == kTraceAfterDispatchImplName)
241 return TRACE_AFTER_DISPATCH_IMPL_METHOD; 241 return TRACE_AFTER_DISPATCH_IMPL_METHOD;
242 242
243 assert(false && "Should not reach here"); 243 assert(false && "Should not reach here");
244 return NOT_TRACE_METHOD; 244 return NOT_TRACE_METHOD;
245 } 245 }
246 246
247 static bool IsTraceMethod(clang::FunctionDecl* method) { 247 static bool IsTraceMethod(clang::FunctionDecl* method) {
248 return GetTraceMethodType(method) != NOT_TRACE_METHOD; 248 return GetTraceMethodType(method) != NOT_TRACE_METHOD;
249 } 249 }
250 250
251 static bool IsTraceImplName(const std::string& name) { 251 static bool IsTraceImplName(const std::string& name) {
252 return name == kTraceImplName || name == kTraceAfterDispatchImplName; 252 return name == kTraceImplName || name == kTraceAfterDispatchImplName;
253 } 253 }
254 254
255 static bool StartsWith(const std::string& str, const std::string& prefix) { 255 static bool StartsWith(const std::string& str, const std::string& prefix) {
256 if (prefix.size() > str.size()) 256 if (prefix.size() > str.size())
257 return false; 257 return false;
258 return str.compare(0, prefix.size(), prefix) == 0; 258 return str.compare(0, prefix.size(), prefix) == 0;
259 } 259 }
260 260
261 static bool EndsWith(const std::string& str, const std::string& suffix) { 261 static bool EndsWith(const std::string& str, const std::string& suffix) {
262 if (suffix.size() > str.size()) 262 if (suffix.size() > str.size())
263 return false; 263 return false;
264 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; 264 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
265 } 265 }
266 }; 266 };
267 267
268 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_ 268 #endif // TOOLS_BLINK_GC_PLUGIN_CONFIG_H_
OLDNEW
« no previous file with comments | « tools/clang/blink_gc_plugin/CMakeLists.txt ('k') | tools/clang/blink_gc_plugin/Edge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698