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

Unified Diff: tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp

Issue 318623002: Blink GC plugin: disallow own pointers to GC allocated collections. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/tests/own_ptr_to_gc_managed_class.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
diff --git a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
index 0ea8f4cac36330f042492810e86e52989a56a7ab..d1d3a468ec88b1af5cdd8d145716e059d8239862 100644
--- a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
+++ b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
@@ -486,7 +486,7 @@ class CheckFieldsVisitor : public RecursiveEdgeVisitor {
return !invalid_fields_.empty();
}
- void VisitMember(Member* edge) override {
+ void AtMember(Member* edge) override {
if (managed_host_)
return;
// A member is allowed to appear in the context of a root.
@@ -499,7 +499,7 @@ class CheckFieldsVisitor : public RecursiveEdgeVisitor {
invalid_fields_.push_back(std::make_pair(current_, kMemberInUnmanaged));
}
- void VisitValue(Value* edge) override {
+ void AtValue(Value* edge) override {
// TODO: what should we do to check unions?
if (edge->value()->record()->isUnion())
return;
@@ -540,6 +540,11 @@ class CheckFieldsVisitor : public RecursiveEdgeVisitor {
}
}
+ void AtCollection(Collection* edge) override {
+ if (edge->on_heap() && Parent() && Parent()->IsOwnPtr())
+ invalid_fields_.push_back(std::make_pair(current_, kOwnPtrToGCManaged));
+ }
+
private:
Error InvalidSmartPtr(Edge* ptr) {
if (ptr->IsRawPtr())
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/tests/own_ptr_to_gc_managed_class.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698