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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 186003002: Pass in the isolate parameter to the weak persistent callback handler so that (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/dart_api_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl_test.cc
===================================================================
--- runtime/vm/dart_api_impl_test.cc (revision 33281)
+++ runtime/vm/dart_api_impl_test.cc (working copy)
@@ -1696,9 +1696,10 @@
}
-static void ExternalTypedDataFinalizer(Dart_WeakPersistentHandle handle,
- void* peer) {
- Dart_DeleteWeakPersistentHandle(handle);
+static void ExternalTypedDataFinalizer(Dart_Isolate isolate,
+ Dart_WeakPersistentHandle handle,
+ void* peer) {
+ Dart_DeleteWeakPersistentHandle(isolate, handle);
*static_cast<int*>(peer) = 42;
}
@@ -2051,8 +2052,9 @@
Dart_ExitScope();
}
- Dart_DeleteWeakPersistentHandle(weak_new_ref);
- Dart_DeleteWeakPersistentHandle(weak_old_ref);
+ Dart_Isolate isolate = reinterpret_cast<Dart_Isolate>(Isolate::Current());
+ Dart_DeleteWeakPersistentHandle(isolate, weak_new_ref);
+ Dart_DeleteWeakPersistentHandle(isolate, weak_old_ref);
// Garbage collect one last time to revisit deleted handles.
Isolate::Current()->heap()->CollectGarbage(Heap::kNew);
@@ -2060,8 +2062,9 @@
}
-static void WeakPersistentHandlePeerFinalizer(
- Dart_WeakPersistentHandle handle, void* peer) {
+static void WeakPersistentHandlePeerFinalizer(Dart_Isolate isolate,
+ Dart_WeakPersistentHandle handle,
+ void* peer) {
*static_cast<int*>(peer) = 42;
}
@@ -2083,7 +2086,8 @@
EXPECT(peer == 0);
GCTestHelper::CollectNewSpace(Heap::kIgnoreApiCallbacks);
EXPECT(peer == 42);
- Dart_DeleteWeakPersistentHandle(weak_ref);
+ Dart_Isolate isolate = reinterpret_cast<Dart_Isolate>(Isolate::Current());
+ Dart_DeleteWeakPersistentHandle(isolate, weak_ref);
}
@@ -2100,7 +2104,8 @@
}
// A finalizer is not invoked on a deleted handle. Therefore, the
// peer value should not change after the referent is collected.
- Dart_DeleteWeakPersistentHandle(weak_ref);
+ Dart_Isolate isolate = reinterpret_cast<Dart_Isolate>(Isolate::Current());
+ Dart_DeleteWeakPersistentHandle(isolate, weak_ref);
EXPECT(peer == 0);
Isolate::Current()->heap()->CollectGarbage(Heap::kOld);
EXPECT(peer == 0);
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/dart_api_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698