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

Unified Diff: pkg/analysis_server/lib/src/channel/web_socket_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 | « pkg/analysis_server/lib/src/channel/channel.dart ('k') | pkg/analyzer/lib/src/util/utilities_timing.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/web_socket_channel.dart
diff --git a/pkg/analysis_server/lib/src/channel/web_socket_channel.dart b/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
index 21835da125796e3964894128807b1e9c3c58585f..c661bfb90b51ae359c58ff808ef78889210fdfaf 100644
--- a/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
+++ b/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
@@ -85,12 +85,18 @@ class WebSocketServerChannel implements ServerCommunicationChannel {
@override
void sendNotification(Notification notification) {
- socket.add(JSON.encode(notification.toJson()));
+ ServerCommunicationChannel.ToJson.start();
+ String jsonEncoding = JSON.encode(notification.toJson());
+ ServerCommunicationChannel.ToJson.stop();
+ socket.add(jsonEncoding);
}
@override
void sendResponse(Response response) {
- socket.add(JSON.encode(response.toJson()));
+ ServerCommunicationChannel.ToJson.start();
+ String jsonEncoding = JSON.encode(response.toJson());
+ ServerCommunicationChannel.ToJson.stop();
+ socket.add(jsonEncoding);
}
/**
@@ -101,7 +107,9 @@ class WebSocketServerChannel implements ServerCommunicationChannel {
if (data is String) {
// 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 | « pkg/analysis_server/lib/src/channel/channel.dart ('k') | pkg/analyzer/lib/src/util/utilities_timing.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698