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

Unified Diff: runtime/vm/handles.h

Issue 8984006: Implement weak persistent handles in the Dart API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments Created 9 years 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
Index: runtime/vm/handles.h
diff --git a/runtime/vm/handles.h b/runtime/vm/handles.h
index acd8153a2a0a486bd051438aaeb55eea6e936e8b..12dbed9c03238ee2b731aff75c9bc3dde964636e 100644
--- a/runtime/vm/handles.h
+++ b/runtime/vm/handles.h
@@ -58,6 +58,15 @@ namespace dart {
class ObjectPointerVisitor;
+class HandleVisitor {
+ public:
+ virtual void Visit(uword* addr) = 0;
+
+ virtual ~HandleVisitor() {
+ }
+};
+
+
template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
class Handles {
public:
@@ -73,6 +82,9 @@ class Handles {
// Visit all object pointers stored in the various handles.
void VisitObjectPointers(ObjectPointerVisitor* visitor);
+ // Visits all of the various handles.
+ void Visit(HandleVisitor* visitor);
+
// Allocates a handle in the current handle scope. This handle is valid only
// in the current handle scope and is destroyed when the current handle
// scope ends.
@@ -142,6 +154,9 @@ class Handles {
// Visit all object pointers in the handle block.
void VisitObjectPointers(ObjectPointerVisitor* visitor);
+ // Visit all of the handles in the handle block.
+ void Visit(HandleVisitor* visitor);
+
#if defined(DEBUG)
// Zaps the free handle area to an uninitialized value.
void ZapFreeHandles();

Powered by Google App Engine
This is Rietveld 408576698