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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 834233003: Fix for issue 21398 (only send "literal like" objects across isolates spawned using spawnURI (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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/vm/raw_object.h ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object_snapshot.cc
===================================================================
--- runtime/vm/raw_object_snapshot.cc (revision 42788)
+++ runtime/vm/raw_object_snapshot.cc (working copy)
@@ -116,7 +116,17 @@
SnapshotWriterVisitor visitor(writer);
visitor.VisitPointers(from(), to());
} else {
- writer->WriteClassId(this);
+ // Until we have maps implemented as internal VM objects we will use
+ // the collections library qualifier to allow maps to be sent across.
+ if (writer->can_send_any_object() ||
+ writer->AllowObjectsInDartLibrary(ptr()->library_)) {
+ writer->WriteClassId(this);
+ } else {
+ // We do not allow regular dart instances in isolate messages.
+ writer->SetWriteException(Exceptions::kArgument,
+ "Illegal argument in isolate message"
+ " : (object is a regular Dart Instance)");
+ }
}
}
@@ -2666,9 +2676,10 @@
intptr_t tags,
Snapshot::Kind kind) {
uint64_t id = reader->Read<uint64_t>();
+ uint64_t origin_id = reader->Read<uint64_t>();
SendPort& result = SendPort::ZoneHandle(reader->isolate(),
- SendPort::New(id));
+ SendPort::New(id, origin_id));
reader->AddBackRef(object_id, &result, kIsDeserialized);
return result.raw();
}
@@ -2685,6 +2696,7 @@
writer->WriteTags(writer->GetObjectTags(this));
writer->Write<uint64_t>(ptr()->id_);
+ writer->Write<uint64_t>(ptr()->origin_id_);
}
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698