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

Unified Diff: runtime/vm/message.cc

Issue 1150303004: Switch to using SourceLocation universally in service protocol. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: post merge Created 5 years, 7 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/json_stream.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/message.cc
diff --git a/runtime/vm/message.cc b/runtime/vm/message.cc
index 906a16c035eb69a2c0e3ab34dd578f9bb0d1c059..810a348cefb971a44cc63cafa283cfdad2341d99 100644
--- a/runtime/vm/message.cc
+++ b/runtime/vm/message.cc
@@ -191,6 +191,7 @@ void MessageQueue::PrintJSON(JSONStream* stream) {
while (it.HasNext()) {
Message* current = it.Next();
JSONObject message(&messages);
+ message.AddProperty("type", "Message");
message.AddPropertyF("name", "Isolate Message (%" Px ")", current->Id());
message.AddPropertyF("messageObjectId", "messages/%" Px "",
current->Id());
@@ -207,15 +208,16 @@ void MessageQueue::PrintJSON(JSONStream* stream) {
// Grab function from closure.
msg_handler = Closure::function(Instance::Cast(msg_handler));
}
- if (!msg_handler.IsFunction()) {
- // No handler function.
- continue;
+ if (msg_handler.IsFunction()) {
+ const Function& function = Function::Cast(msg_handler);
+ message.AddProperty("handler", function);
+
+ const Script& script = Script::Handle(function.script());
+ if (!script.IsNull()) {
+ message.AddLocation(script, function.token_pos(),
+ function.end_token_pos());
+ }
}
- const Function& function = Function::Cast(msg_handler);
- const Script& script = Script::Handle(function.script());
- message.AddProperty("handlerFunction", function);
- message.AddProperty("handlerScript", script);
- message.AddProperty("handlerTokenPos", function.token_pos());
}
}
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698