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

Unified Diff: runtime/vm/dart_api_message.cc

Issue 1267603003: Support sending and receiving Capability objects from C code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
Index: runtime/vm/dart_api_message.cc
diff --git a/runtime/vm/dart_api_message.cc b/runtime/vm/dart_api_message.cc
index 90604483ae3e71e76aeb18230409ea1295515f07..aa0809915f208449c199f6ce556b45b85fbe01e9 100644
--- a/runtime/vm/dart_api_message.cc
+++ b/runtime/vm/dart_api_message.cc
@@ -681,6 +681,13 @@ Dart_CObject* ApiMessageReader::ReadInternalVMObject(intptr_t class_id,
AddBackRef(object_id, object, kIsDeserialized);
return object;
}
+ case kCapabilityCid: {
+ int64_t id = Read<int64_t>();
+ Dart_CObject* object = AllocateDartCObject(Dart_CObject_kCapability);
+ object->value.as_capability.id = id;
+ AddBackRef(object_id, object, kIsDeserialized);
+ return object;
+ }
#define READ_TYPED_DATA_HEADER(type) \
intptr_t len = ReadSmiValue(); \
@@ -1268,6 +1275,13 @@ bool ApiMessageWriter::WriteCObjectInlined(Dart_CObject* object,
WriteRawPointerValue(reinterpret_cast<intptr_t>(callback));
break;
}
+ case Dart_CObject_kCapability: {
+ WriteInlinedHeader(object);
+ WriteIndexedObject(kCapabilityCid);
+ WriteTags(0);
+ Write<uint64_t>(object->value.as_capability.id);
+ break;
+ }
default:
UNREACHABLE();
}

Powered by Google App Engine
This is Rietveld 408576698