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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 8588040: Add a mid-sized integration test for the Dart Embedding Api which (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 1 month 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/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 1518)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -275,12 +275,15 @@
DART_EXPORT void Dart_SetMessageCallbacks(
+ Dart_CreatePortCallback create_port_callback,
Dart_PostMessageCallback post_message_callback,
Dart_ClosePortCallback close_port_callback) {
Isolate* isolate = Isolate::Current();
ASSERT(isolate != NULL);
+ ASSERT(create_port_callback != NULL);
ASSERT(post_message_callback != NULL);
ASSERT(close_port_callback != NULL);
+ isolate->set_create_port_callback(create_port_callback);
isolate->set_post_message_callback(post_message_callback);
isolate->set_close_port_callback(close_port_callback);
}
@@ -1932,6 +1935,18 @@
}
+DART_EXPORT Dart_Port Dart_CreatePort() {
+ return PortMap::CreatePort();
+}
+
+
+DART_EXPORT bool Dart_IsolateHasActivePorts() {
+ Isolate* isolate = Isolate::Current();
+ ASSERT(isolate);
+ return isolate->active_ports() > 0;
+}
+
+
static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size);
return reinterpret_cast<uint8_t*>(new_ptr);

Powered by Google App Engine
This is Rietveld 408576698