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

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));
+ if (result.IsNull()) {
+ return false;
+ }
+ Isolate* isolate = Isolate::Current();
+ isolate->AppendExtensionCall(Instance::Cast(result));
+ return true;
}

Powered by Google App Engine
This is Rietveld 408576698