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

Unified Diff: pkg/analysis_server/lib/src/channel/byte_stream_channel.dart

Issue 666913003: Add timing of serialization (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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 | pkg/analysis_server/lib/src/channel/channel.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/channel/byte_stream_channel.dart
diff --git a/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart b/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart
index 2ab44419a0cf7f1398373c033fe76064e915cb89..cc0274d3b2922465f7694566bda51dba38a7cbf7 100644
--- a/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart
+++ b/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart
@@ -103,7 +103,10 @@ class ByteStreamServerChannel implements ServerCommunicationChannel {
if (_closed.isCompleted) {
return;
}
- output.writeln(JSON.encode(notification.toJson()));
+ ServerCommunicationChannel.ToJson.start();
+ String jsonEncoding = JSON.encode(notification.toJson());
+ ServerCommunicationChannel.ToJson.stop();
+ output.writeln(jsonEncoding);
}
@override
@@ -113,7 +116,10 @@ class ByteStreamServerChannel implements ServerCommunicationChannel {
if (_closed.isCompleted) {
return;
}
- output.writeln(JSON.encode(response.toJson()));
+ ServerCommunicationChannel.ToJson.start();
+ String jsonEncoding = JSON.encode(response.toJson());
+ ServerCommunicationChannel.ToJson.stop();
+ output.writeln(jsonEncoding);
}
/**
@@ -127,7 +133,9 @@ class ByteStreamServerChannel implements ServerCommunicationChannel {
}
// Parse the string as a JSON descriptor and process the resulting
// structure as a request.
+ ServerCommunicationChannel.FromJson.start();
Request request = new Request.fromString(data);
+ ServerCommunicationChannel.FromJson.stop();
if (request == null) {
sendResponse(new Response.invalidRequestFormat());
return;
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/channel/channel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698