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

Unified Diff: runtime/vm/service/message.dart

Issue 897193002: Finish moving service protocol to json rpc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 5 years, 10 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 | « runtime/vm/service.cc ('k') | runtime/vm/service/running_isolates.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service/message.dart
diff --git a/runtime/vm/service/message.dart b/runtime/vm/service/message.dart
index 4b2f80a9bb4d7c0c954ef7ee08b7b349f295652e..011d57d2ac124706051217e790fa71b6cff5658d 100644
--- a/runtime/vm/service/message.dart
+++ b/runtime/vm/service/message.dart
@@ -10,8 +10,6 @@ class Message {
/// Future of response.
Future<String> get response => _completer.future;
- final bool isOld;
-
// In new messages.
final String method;
@@ -32,29 +30,10 @@ class Message {
});
}
- Message.fromUri(Uri uri) : isOld = true {
- var split = uri.path.split('/');
- if (split.length == 0) {
- setErrorResponse('Invalid uri: $uri.');
- return;
- }
- _setPath(split);
- params.addAll(uri.queryParameters);
- }
-
- Message.fromJsonRpc(this.method, Map rpcParams)
- : isOld = false {
+ Message.fromJsonRpc(this.method, Map rpcParams) {
params.addAll(rpcParams);
}
- Message.fromMap(Map map) : isOld = true {
- _setPath(map['path']);
- // TODO - turnidge - change this to params in sender.
- if (map['options'] != null) {
- params.addAll(map['options']);
- }
- }
-
dynamic toJson() {
return {
'path': path,
@@ -94,7 +73,7 @@ class Message {
var request = new List(5)
..[0] = 0 // Make room for OOB message type.
..[1] = receivePort.sendPort
- ..[2] = (isOld ? path : method)
+ ..[2] = method
..[3] = keys
..[4] = values;
sendIsolateServiceMessage(sendPort, request);
@@ -116,7 +95,7 @@ class Message {
var request = new List(5)
..[0] = 0 // Make room for OOB message type.
..[1] = receivePort.sendPort
- ..[2] = (isOld ? path : method)
+ ..[2] = method
..[3] = keys
..[4] = values;
sendRootServiceMessage(request);
« no previous file with comments | « runtime/vm/service.cc ('k') | runtime/vm/service/running_isolates.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698