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

Side by Side Diff: runtime/vm/service/message.dart

Issue 1258733004: Include a "jsonrpc" property in all VM service responses. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add for error 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 unified diff | Download patch
« no previous file with comments | « CHANGELOG.md ('k') | runtime/vm/service/vmservice.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 part of vmservice; 5 part of vmservice;
6 6
7 class Message { 7 class Message {
8 final Completer _completer = new Completer.sync(); 8 final Completer _completer = new Completer.sync();
9 bool get completed => _completer.isCompleted; 9 bool get completed => _completer.isCompleted;
10 /// Future of response. 10 /// Future of response.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 sendRootServiceMessage(request); 136 sendRootServiceMessage(request);
137 return _completer.future; 137 return _completer.future;
138 } 138 }
139 139
140 void setResponse(String response) { 140 void setResponse(String response) {
141 _completer.complete(response); 141 _completer.complete(response);
142 } 142 }
143 143
144 void setErrorResponse(String message) { 144 void setErrorResponse(String message) {
145 var response = { 145 var response = {
146 'jsonrpc': '2.0',
146 'id': serial, 147 'id': serial,
147 'result' : { 148 'result' : {
148 'type': 'Error', 149 'type': 'Error',
149 'message': message, 150 'message': message,
150 'request': { 151 'request': {
151 'method': method, 152 'method': method,
152 'params': params 153 'params': params
153 } 154 }
154 } 155 }
155 }; 156 };
156 _completer.complete(JSON.encode(response)); 157 _completer.complete(JSON.encode(response));
157 } 158 }
158 } 159 }
159 160
160 bool sendIsolateServiceMessage(SendPort sp, List m) 161 bool sendIsolateServiceMessage(SendPort sp, List m)
161 native "VMService_SendIsolateServiceMessage"; 162 native "VMService_SendIsolateServiceMessage";
162 163
163 void sendRootServiceMessage(List m) 164 void sendRootServiceMessage(List m)
164 native "VMService_SendRootServiceMessage"; 165 native "VMService_SendRootServiceMessage";
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | runtime/vm/service/vmservice.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698