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

Unified Diff: samples/chat/chat_stress_client.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, 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
Index: samples/chat/chat_stress_client.dart
diff --git a/samples/chat/chat_stress_client.dart b/samples/chat/chat_stress_client.dart
index b5dc325dc6ba6694ffca2508e7a807ef9863c287..4465c1399c906c28b0efe8046608ed5fbc35a807 100644
--- a/samples/chat/chat_stress_client.dart
+++ b/samples/chat/chat_stress_client.dart
@@ -4,7 +4,7 @@
library chat_stress_client;
import 'dart:io';
-import 'dart:json' as json;
+import "dart:convert";
class ChatStressClient {
@@ -34,7 +34,7 @@ class ChatStressClient {
printServerError(response);
return null;
}
- var responseData = json.parse(data);
+ var responseData = JSON.decode(data);
if (responseData["response"] != expected ) {
printProtocolError();
return null;
@@ -52,7 +52,7 @@ class ChatStressClient {
leaveRequest["sessionId"] = sessionId;
httpClient.post("127.0.0.1", port, "/leave")
.then((HttpClientRequest request) {
- request.addString(json.stringify(leaveRequest));
+ request.addString(JSON.encode(leaveRequest));
return request.close();
})
.then((HttpClientResponse response) {
@@ -80,7 +80,7 @@ class ChatStressClient {
messageRequest["maxMessages"] = 100;
httpClient.post("127.0.0.1", port, "/receive")
.then((HttpClientRequest request) {
- request.addString(json.stringify(messageRequest));
+ request.addString(JSON.encode(messageRequest));
return request.close();
})
.then((HttpClientResponse response) {
@@ -115,7 +115,7 @@ class ChatStressClient {
messageRequest["message"] = "message $sendMessageCount";
httpClient.post("127.0.0.1", port, "/message")
.then((HttpClientRequest request) {
- request.addString(json.stringify(messageRequest));
+ request.addString(JSON.encode(messageRequest));
return request.close();
})
.then((HttpClientResponse response) {
@@ -143,7 +143,7 @@ class ChatStressClient {
joinRequest["handle"] = "test1";
httpClient.post("127.0.0.1", port, "/join")
.then((HttpClientRequest request) {
- request.addString(json.stringify(joinRequest));
+ request.addString(JSON.encode(joinRequest));
return request.close();
})
.then((HttpClientResponse response) {

Powered by Google App Engine
This is Rietveld 408576698