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

Unified Diff: samples/sample_extension/sample_extension.cc

Issue 43483004: Remove the reply port form the native isolate handler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated to new isolate API Created 7 years, 2 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 | « samples/sample_extension/sample_asynchronous_extension.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/sample_extension/sample_extension.cc
diff --git a/samples/sample_extension/sample_extension.cc b/samples/sample_extension/sample_extension.cc
index 7880c938f4e01e45c70bcbe499af8a145babdca7..2ea81abc3c298d2222475f7baa4e71d4b8ae4eef 100644
--- a/samples/sample_extension/sample_extension.cc
+++ b/samples/sample_extension/sample_extension.cc
@@ -60,18 +60,20 @@ uint8_t* randomArray(int seed, int length) {
}
void wrappedRandomArray(Dart_Port dest_port_id,
- Dart_Port reply_port_id,
Dart_CObject* message) {
+ Dart_Port reply_port_id = ILLEGAL_PORT;
if (message->type == Dart_CObject_kArray &&
- 2 == message->value.as_array.length) {
+ 3 == message->value.as_array.length) {
// Use .as_array and .as_int32 to access the data in the Dart_CObject.
Dart_CObject* param0 = message->value.as_array.values[0];
Dart_CObject* param1 = message->value.as_array.values[1];
+ Dart_CObject* param2 = message->value.as_array.values[2];
if (param0->type == Dart_CObject_kInt32 &&
- param1->type == Dart_CObject_kInt32) {
+ param1->type == Dart_CObject_kInt32 &&
+ param2->type == Dart_CObject_kSendPort) {
int seed = param0->value.as_int32;
int length = param1->value.as_int32;
-
+ reply_port_id = param2->value.as_send_port;
uint8_t* values = randomArray(seed, length);
if (values != NULL) {
« no previous file with comments | « samples/sample_extension/sample_asynchronous_extension.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698