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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 116473004: Add Dart API method Dart_SetPersistentHandle to enable setting the value of (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 12 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/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 31439)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -578,6 +578,20 @@
return reinterpret_cast<Dart_PersistentHandle>(new_ref);
}
+
+DART_EXPORT void Dart_SetPersistentHandle(Dart_PersistentHandle obj1,
+ Dart_Handle obj2) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ ApiState* state = isolate->api_state();
+ ASSERT(state != NULL);
+ ASSERT(state->IsValidPersistentHandle(obj1));
+ const Object& obj2_ref = Object::Handle(isolate, Api::UnwrapHandle(obj2));
+ PersistentHandle* obj1_ref = Api::UnwrapAsPersistentHandle(obj1);
+ obj1_ref->set_raw(obj2_ref);
+}
+
+
static Dart_WeakPersistentHandle AllocateFinalizableHandle(
Isolate* isolate,
FinalizablePersistentHandles* handles,
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698