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

Unified Diff: runtime/vm/service.cc

Issue 1299493007: Rework service extensions to be safe (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index a517f21c1336952ecd5fd4c8cf688d5d8df1de74..a94fb08b0e786f329ad07c22751a658d445e25fa 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -905,8 +905,14 @@ bool Service::ScheduleExtensionHandler(const String& method_name,
arguments.SetAt(2, parameter_values);
arguments.SetAt(3, reply_port);
arguments.SetAt(4, id);
- return (DartEntry::InvokeFunction(schedule_extension, arguments) ==
- Object::bool_true().raw());
+ const Object& result = Object::Handle(
+ DartEntry::InvokeFunction(schedule_extension, arguments));
Ivan Posva 2015/08/20 20:46:05 This still executes Dart code at an arbitrary loca
Cutch 2015/08/21 14:18:56 I now no longer invoke any Dart code from the OOB.
+ if (result.IsNull()) {
+ return false;
+ }
+ Isolate* isolate = Isolate::Current();
+ isolate->AppendExtensionCall(Instance::Cast(result));
+ return true;
}
« runtime/vm/isolate.cc ('K') | « runtime/vm/isolate.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698