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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 8761007: Stop using void* types in the dart embedding api. (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
« no previous file with comments | « runtime/vm/dart_api_impl.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 1987)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -197,6 +197,16 @@
}
+Dart_Isolate Api::CastIsolate(Isolate* isolate) {
+ return reinterpret_cast<Dart_Isolate>(isolate);
+}
+
+
+Dart_Message Api::CastMessage(uint8_t* message) {
+ return reinterpret_cast<Dart_Message>(message);
+}
+
+
Dart_Handle Api::Success() {
Isolate* isolate = Isolate::Current();
ASSERT(isolate != NULL);
@@ -539,7 +549,7 @@
// --- Isolates ---
-DART_EXPORT Dart_Isolate Dart_CreateIsolate(const Dart_Snapshot* snapshot,
+DART_EXPORT Dart_Isolate Dart_CreateIsolate(const uint8_t* snapshot,
void* callback_data,
char** error) {
Isolate* isolate = Dart::CreateIsolate();
@@ -573,7 +583,7 @@
DART_EXPORT Dart_Isolate Dart_CurrentIsolate() {
- return reinterpret_cast<Dart_Isolate>(Isolate::Current());
+ return Api::CastIsolate(Isolate::Current());
}
@@ -725,7 +735,7 @@
writer.WriteMessage(len, data);
// Post the message at the given port.
- return PortMap::PostMessage(port_id, kNoReplyPort, buffer);
+ return PortMap::PostMessage(port_id, kNoReplyPort, Api::CastMessage(buffer));
}
@@ -736,7 +746,7 @@
SnapshotWriter writer(false, &data, &allocator);
writer.WriteObject(object.raw());
writer.FinalizeBuffer();
- return PortMap::PostMessage(port_id, kNoReplyPort, data);
+ return PortMap::PostMessage(port_id, kNoReplyPort, Api::CastMessage(data));
}
« no previous file with comments | « runtime/vm/dart_api_impl.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698