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

Unified Diff: runtime/vm/service/protocol.md

Issue 467183004: Add more types to service/protocol.md (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service/protocol.md
diff --git a/runtime/vm/service/protocol.md b/runtime/vm/service/protocol.md
index 546b2bb75dfc58535a8cc230cd3d001768f91259..c19fbedef1d8c4d054d6b1d4d2f02fe30a083852 100644
--- a/runtime/vm/service/protocol.md
+++ b/runtime/vm/service/protocol.md
@@ -1,5 +1,8 @@
# Dart VM Service Protocol
+NOTE: The service api is still changing rapidly. If you use the
+service api, expect to encounter non-compatible changes.
+
Description
How to start
JSON
@@ -7,9 +10,18 @@ Websocket
## Types
-Every response returned by the VM Service has the <code>type</code> property. This allows the client distinguish between different kinds of responses. For example, global information about the VM is encoded in an response of type [VM](#VM) and information about an isolate is encoded in an response of type [Isolate](#Isolate).
+Every response returned by the VM Service has the <code>type</code>
+property. This allows the client distinguish between different kinds
+of responses. For example, global information about the VM is encoded
+in an response of type [VM](#VM) and information about an isolate is
+encoded in an response of type [Isolate](#Isolate).
-If the type name of a response begins with an <code>@</code> character then that response is a _reference_. If the type name of a response does not begin with an <code>@</code> character then that response is an _object_ (or sometimes _full object_). A reference is meant to be a subset of a full object with just enough information for the client to generate a reasonable-looking link.
+If the type name of a response begins with an <code>@</code> character
+then that response is a _reference_. If the type name of a response
+does not begin with an <code>@</code> character then that response is
+an _object_ (or sometimes _full object_). A reference is meant to be
+a subset of a full object with just enough information for the client
+to generate a reasonable-looking link.
For example, an isolate reference may look like this...
@@ -22,7 +34,7 @@ For example, an isolate reference may look like this...
... and a full isolate object would have additional properties:
{
- type: "@Isolate",
+ type: "Isolate",
id: "isolates/123",
name: "worker"
entry: ...
@@ -33,9 +45,14 @@ For example, an isolate reference may look like this...
## IDs
-Most responses returned by the VM Service have an <code>id</code> property. An id is used to request an object from the VM.
+Most responses returned by the VM Service have an <code>id</code>
+property. An id is used to request an object from the VM. Each id is
+unique; that is to say, If two responses have the same id, they refer
+to the same object. The converse is not true: the same object may
+occasionally be returned with two different ids.
-An id is either _global_ or _relative_. Global ids can be requested from the VM directly by requesting the uri <code>/{global id}</code>.
+An id is either _global_ or _relative_. Global ids can be requested
+from the VM directly by requesting the uri <code>/{global id}</code>.
The following is a list of known, fixed global ids:
@@ -44,19 +61,105 @@ The following is a list of known, fixed global ids:
| vm | /vm | [VM](#VM)
| flags | /flags | [FlagList](#FlagList)
-In addition, all isolates have global ids, but these ids are dynamically generated. An isolate with an id like <code>isolates/123</code> would be available at the uri <code>/isolates/123</code>.
+In addition, all isolates have global ids, but these ids are
+dynamically generated. An isolate with an id like
+<code>isolates/123</code> would be available at the uri
+<code>/isolates/123</code>.
+
+Relative ids are used to refer to objects that are owned by an
+isolate. Relative ids can be requested from the VM directly by
+requesting the uri <code>/{isolate&nbsp;id}/{relative&nbsp;id}</code>.
+
+For example, we can get information about a class with id
+<code>classes/Foo</code> from isolate <code>isolates/123</code> by
+requesting the uri <code>/isolates/123/classes/Foo</code> from the VM.
+
+The client must not parse ids -- they must be treated as opaque
+strings. We reserve the right to change the ids of objects.
-Relative ids are used to refer to objects that are owned by an isolate. Relative ids can be requested from the VM directly by requesting the uri <code>/{isolate&nbsp;id}/{relative&nbsp;id}</code>.
+## Names
-For example, we can get information about a class with id <code>classes/Foo</code> from isolate <code>isolates/123</code> by requesting the uri <code>/isolates/123/classes/Foo</code> from the VM.
+Many responses have the <code>name</code> property. Names are
+provided so that objects can be displayed in a way that a Dart
+language programmer would find sensible.
-The client must not parse ids -- they must be treated as opaque strings. We reserve the right to change the ids of objects.
+Note that names are not in any way unique. Many objects will have the
+same name.
+
+Occasionally responses will have the <code>vmName</code> property.
+This represents the internal names used to refer to an object inside
+the VM itself. The <code>vmName</code> of an object is only provided
+when it differs from the <code>name</code> property; when
+<code>vmName</code> is not present, the client may assume the
+<code>name</code> and <code>vmName</code> are the same.
## Events
TODO
## Catalog of Types
+
+### <a name="Breakpoint"></a>Breakpoint
+
+TODO: Get rid of Location or else use it more generally.
+
+| keys | values | comments
+| --- | --- | ---
+| type | "Breakpoint" |
+| id | String |
+| breakpointNumber | int |
+| enabled | bool |
+| resolved | bool |
+| location | [Location](#Location) |
+
+### <a name="DebuggerEvent"></a>DebuggerEvent
+
+| keys | values | comments
+| --- | --- | ---
+| type | "DebuggerEvent" |
+| id | String | TODO: Remove |
+| eventType | String | One of "BreakpointReached", "BreakpointResolved", "ExceptionThrown", "IsolateCreated", "IsolateShutdown", or "IsolateInterrupted" |
Cutch 2014/08/26 20:38:43 Do we need "One of"?
+| isolate | [@Isolate](#atIsolate) |
+| breakpoint? | [Breakpoint](#atBreakpoint) | for eventTypes "BreakpointResolved" and "BreakpointReached<br><br>TODO: Maybe make this @Breakpoint?
+| exception? | [@Instance](#atInstance) | for eventType "ExceptionThrown"
+
+### <a name="Frame"></a>Frame
+
+TODO: Add type and id?<br>
+
+| keys | values | comments
+| --- | --- | ---
+| script | [@Script](#atScript) |
+| tokenPos | int |
+| function | [@Function](#atFunction) |
+| code | [@Code](#atCode) |
+| vars | List of [FrameVar](#FrameVar) |
+
+### <a name="FrameVar"></a>FrameVar
Cutch 2014/08/26 20:38:43 Document this as a 'format' instead of a type.
+
+| keys | values | comments
+| --- | --- | ---
+| name | String |
+| value | [@Instance](#atInstance) |
+
+### <a name="Location"></a>Location
+
+| keys | values | comments
+| --- | --- | ---
+| type | "Location" |
+| script | [@Script](#atScript) |
+| tokenPos | int |
+
+### <a name="@Null"></a>@Null
+
+TODO: Split Null from the other Sentinel types.
+
+| keys | values | comments
+| --- | --- | ---
+| type | "@Null" |
+| id | String | |
+| valueAsString | String |
+
### <a name="VM"></a>VM
| keys | values | comments
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698