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

Side by Side Diff: runtime/bin/vmservice/service_request.dart

Issue 23596007: Remove usage of dart:json. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 7 years, 3 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 | Annotate | Revision Log
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 ServiceRequest { 7 class ServiceRequest {
8 final List<String> pathSegments = new List<String>(); 8 final List<String> pathSegments = new List<String>();
9 final Map<String, String> parameters = new Map<String, String>(); 9 final Map<String, String> parameters = new Map<String, String>();
10 String _response; 10 String _response;
(...skipping 18 matching lines...) Expand all
29 parameters[k] = v; 29 parameters[k] = v;
30 }); 30 });
31 return true; 31 return true;
32 } 32 }
33 33
34 List toServiceCallMessage() { 34 List toServiceCallMessage() {
35 return [pathSegments, parameters.keys.toList(), parameters.values.toList()]; 35 return [pathSegments, parameters.keys.toList(), parameters.values.toList()];
36 } 36 }
37 37
38 void setErrorResponse(String error) { 38 void setErrorResponse(String error) {
39 _response = JSON.stringify({ 39 _response = JSON.encode({
40 'type': 'error', 40 'type': 'error',
41 'msg': error, 41 'msg': error,
42 'pathSegments': pathSegments, 42 'pathSegments': pathSegments,
43 'parameters': parameters 43 'parameters': parameters
44 }); 44 });
45 } 45 }
46 46
47 void setResponse(String response) { 47 void setResponse(String response) {
48 _response = response; 48 _response = response;
49 } 49 }
50 50
51 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698