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

Unified Diff: runtime/vm/object.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/object.h ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 33281)
+++ runtime/vm/object.cc (working copy)
@@ -419,8 +419,10 @@
}
-static void DeleteWeakPersistentHandle(Dart_WeakPersistentHandle handle) {
- ApiState* state = Isolate::Current()->api_state();
+static void DeleteWeakPersistentHandle(Dart_Isolate current_isolate,
+ Dart_WeakPersistentHandle handle) {
+ Isolate* isolate = reinterpret_cast<Isolate*>(current_isolate);
+ ApiState* state = isolate->api_state();
ASSERT(state != NULL);
FinalizablePersistentHandle* weak_ref =
reinterpret_cast<FinalizablePersistentHandle*>(handle);
@@ -6655,10 +6657,12 @@
}
-void TokenStream::DataFinalizer(Dart_WeakPersistentHandle handle, void *peer) {
+void TokenStream::DataFinalizer(Dart_Isolate isolate,
+ Dart_WeakPersistentHandle handle,
+ void *peer) {
ASSERT(peer != NULL);
::free(peer);
- DeleteWeakPersistentHandle(handle);
+ DeleteWeakPersistentHandle(isolate, handle);
}
@@ -15894,9 +15898,11 @@
}
-void OneByteString::Finalize(Dart_WeakPersistentHandle handle, void* peer) {
+void OneByteString::Finalize(Dart_Isolate isolate,
+ Dart_WeakPersistentHandle handle,
+ void* peer) {
delete reinterpret_cast<ExternalStringData<uint8_t>*>(peer);
- DeleteWeakPersistentHandle(handle);
+ DeleteWeakPersistentHandle(isolate, handle);
}
@@ -16068,9 +16074,11 @@
}
-void TwoByteString::Finalize(Dart_WeakPersistentHandle handle, void* peer) {
+void TwoByteString::Finalize(Dart_Isolate isolate,
+ Dart_WeakPersistentHandle handle,
+ void* peer) {
delete reinterpret_cast<ExternalStringData<uint16_t>*>(peer);
- DeleteWeakPersistentHandle(handle);
+ DeleteWeakPersistentHandle(isolate, handle);
}
@@ -16105,10 +16113,11 @@
}
-void ExternalOneByteString::Finalize(Dart_WeakPersistentHandle handle,
+void ExternalOneByteString::Finalize(Dart_Isolate isolate,
+ Dart_WeakPersistentHandle handle,
void* peer) {
delete reinterpret_cast<ExternalStringData<uint8_t>*>(peer);
- DeleteWeakPersistentHandle(handle);
+ DeleteWeakPersistentHandle(isolate, handle);
}
@@ -16143,10 +16152,11 @@
}
-void ExternalTwoByteString::Finalize(Dart_WeakPersistentHandle handle,
+void ExternalTwoByteString::Finalize(Dart_Isolate isolate,
+ Dart_WeakPersistentHandle handle,
void* peer) {
delete reinterpret_cast<ExternalStringData<uint16_t>*>(peer);
- DeleteWeakPersistentHandle(handle);
+ DeleteWeakPersistentHandle(isolate, handle);
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698