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

Side by Side Diff: runtime/vm/service/service.md

Issue 1256023003: Use a "jsonrpc" field rather than "json-rpc" in the VM service. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | « runtime/vm/json_stream.cc ('k') | runtime/vm/service_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Dart VM Service Protocol 1.0 (Draft 1) 1 # Dart VM Service Protocol 1.0 (Draft 1)
2 2
3 > Please post feedback to the [observatory-discuss group][discuss-list] 3 > Please post feedback to the [observatory-discuss group][discuss-list]
4 4
5 This document describes _draft 1_ of _version 1.0_ of the Dart VM 5 This document describes _draft 1_ of _version 1.0_ of the Dart VM
6 Service Protocol. This protocol is used to communicate with a running 6 Service Protocol. This protocol is used to communicate with a running
7 Dart Virtual Machine. 7 Dart Virtual Machine.
8 8
9 To use the Service Protocol, start the VM with the *--observe* flag. 9 To use the Service Protocol, start the VM with the *--observe* flag.
10 The VM will start a webserver which services protocol requests via WebSocket. 10 The VM will start a webserver which services protocol requests via WebSocket.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 optionally accepts requests without the _jsonprc_ property. 101 optionally accepts requests without the _jsonprc_ property.
102 102
103 An RPC response is a JSON object (http://json.org/). The response always specifi es an 103 An RPC response is a JSON object (http://json.org/). The response always specifi es an
104 _id_ property to pair it with the corresponding request. If the RPC 104 _id_ property to pair it with the corresponding request. If the RPC
105 was successful, the _result_ property provides the result. 105 was successful, the _result_ property provides the result.
106 106
107 Here is an example response for our [getVersion](#getversion) request above: 107 Here is an example response for our [getVersion](#getversion) request above:
108 108
109 ``` 109 ```
110 { 110 {
111 "json-rpc": "2.0", 111 "jsonrpc": "2.0",
112 "result": { 112 "result": {
113 "type": "Version", 113 "type": "Version",
114 "major": 1, 114 "major": 1,
115 "minor": 0 115 "minor": 0
116 } 116 }
117 "id": "1" 117 "id": "1"
118 } 118 }
119 ``` 119 ```
120 120
121 Parameters for RPC requests are always provided as _named_ parameters. 121 Parameters for RPC requests are always provided as _named_ parameters.
(...skipping 23 matching lines...) Expand all
145 When an RPC encounters an error, it is provided in the _error_ 145 When an RPC encounters an error, it is provided in the _error_
146 property of the response object. JSON-RPC errors always provide 146 property of the response object. JSON-RPC errors always provide
147 _code_, _message_, and _data_ properties. 147 _code_, _message_, and _data_ properties.
148 148
149 Here is an example error response for our [streamListen](#streamlisten) 149 Here is an example error response for our [streamListen](#streamlisten)
150 request above. This error would be generated if we were attempting to 150 request above. This error would be generated if we were attempting to
151 subscribe to the _GC_ stream multiple times from the same client. 151 subscribe to the _GC_ stream multiple times from the same client.
152 152
153 ``` 153 ```
154 { 154 {
155 "json-rpc": "2.0", 155 "jsonrpc": "2.0",
156 "error": { 156 "error": {
157 "code": 103, 157 "code": 103,
158 "message": "Stream already subscribed", 158 "message": "Stream already subscribed",
159 "data": { 159 "data": {
160 "details": "The stream 'GC' is already subscribed" 160 "details": "The stream 'GC' is already subscribed"
161 } 161 }
162 } 162 }
163 "id": "2" 163 "id": "2"
164 } 164 }
165 ``` 165 ```
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after
1987 ``` 1987 ```
1988 1988
1989 ## Revision History 1989 ## Revision History
1990 1990
1991 version | comments 1991 version | comments
1992 ------- | -------- 1992 ------- | --------
1993 1.0 draft 1 | initial revision 1993 1.0 draft 1 | initial revision
1994 1994
1995 1995
1996 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observato ry-discuss 1996 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observato ry-discuss
OLDNEW
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | runtime/vm/service_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698