OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/service.h" | 5 #include "vm/service.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
10 | 10 |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 return; | 674 return; |
675 } | 675 } |
676 if (!ServiceIsolate::IsRunning()) { | 676 if (!ServiceIsolate::IsRunning()) { |
677 return; | 677 return; |
678 } | 678 } |
679 JSONStream js; | 679 JSONStream js; |
680 const char* stream_id = event->stream_id(); | 680 const char* stream_id = event->stream_id(); |
681 ASSERT(stream_id != NULL); | 681 ASSERT(stream_id != NULL); |
682 { | 682 { |
683 JSONObject jsobj(&js); | 683 JSONObject jsobj(&js); |
684 jsobj.AddProperty("event", event); | 684 jsobj.AddProperty("jsonrpc", "2.0"); |
685 jsobj.AddProperty("streamId", stream_id); | 685 jsobj.AddProperty("method", "streamNotify"); |
| 686 JSONObject params(&jsobj, "params"); |
| 687 params.AddProperty("streamId", stream_id); |
| 688 params.AddProperty("event", event); |
686 } | 689 } |
687 PostEvent(stream_id, event->KindAsCString(), &js); | 690 PostEvent(stream_id, event->KindAsCString(), &js); |
688 } | 691 } |
689 | 692 |
690 | 693 |
691 void Service::PostEvent(const char* stream_id, | 694 void Service::PostEvent(const char* stream_id, |
692 const char* kind, | 695 const char* kind, |
693 JSONStream* event) { | 696 JSONStream* event) { |
694 ASSERT(stream_id != NULL); | 697 ASSERT(stream_id != NULL); |
695 ASSERT(kind != NULL); | 698 ASSERT(kind != NULL); |
(...skipping 2370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3066 ServiceMethodDescriptor& method = service_methods_[i]; | 3069 ServiceMethodDescriptor& method = service_methods_[i]; |
3067 if (strcmp(method_name, method.name) == 0) { | 3070 if (strcmp(method_name, method.name) == 0) { |
3068 return &method; | 3071 return &method; |
3069 } | 3072 } |
3070 } | 3073 } |
3071 return NULL; | 3074 return NULL; |
3072 } | 3075 } |
3073 | 3076 |
3074 | 3077 |
3075 } // namespace dart | 3078 } // namespace dart |
OLD | NEW |