OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/message.h" | 5 #include "vm/message.h" |
6 | 6 |
7 #include "vm/dart_entry.h" | 7 #include "vm/dart_entry.h" |
8 #include "vm/json_stream.h" | 8 #include "vm/json_stream.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 #include "vm/port.h" | 10 #include "vm/port.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 ASSERT(current != NULL); | 174 ASSERT(current != NULL); |
175 if (current->Id() == id) { | 175 if (current->Id() == id) { |
176 return current; | 176 return current; |
177 } | 177 } |
178 } | 178 } |
179 return NULL; | 179 return NULL; |
180 } | 180 } |
181 | 181 |
182 | 182 |
183 void MessageQueue::PrintJSON(JSONStream* stream) { | 183 void MessageQueue::PrintJSON(JSONStream* stream) { |
| 184 if (!FLAG_support_service) { |
| 185 return; |
| 186 } |
184 JSONArray messages(stream); | 187 JSONArray messages(stream); |
185 | 188 |
186 Object& msg_handler = Object::Handle(); | 189 Object& msg_handler = Object::Handle(); |
187 | 190 |
188 MessageQueue::Iterator it(this); | 191 MessageQueue::Iterator it(this); |
189 intptr_t depth = 0; | 192 intptr_t depth = 0; |
190 while (it.HasNext()) { | 193 while (it.HasNext()) { |
191 Message* current = it.Next(); | 194 Message* current = it.Next(); |
192 JSONObject message(&messages); | 195 JSONObject message(&messages); |
193 message.AddProperty("type", "Message"); | 196 message.AddProperty("type", "Message"); |
(...skipping 20 matching lines...) Expand all Loading... |
214 const Script& script = Script::Handle(function.script()); | 217 const Script& script = Script::Handle(function.script()); |
215 if (!script.IsNull()) { | 218 if (!script.IsNull()) { |
216 message.AddLocation(script, function.token_pos(), | 219 message.AddLocation(script, function.token_pos(), |
217 function.end_token_pos()); | 220 function.end_token_pos()); |
218 } | 221 } |
219 } | 222 } |
220 } | 223 } |
221 } | 224 } |
222 | 225 |
223 } // namespace dart | 226 } // namespace dart |
OLD | NEW |