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

Issue 137853026: Basic communication protocol for server (Closed)

Created:
6 years, 11 months ago by Brian Wilkerson
Modified:
6 years, 11 months ago
Reviewers:
devoncarew, scheglov
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 18
Unified diffs Side-by-side diffs Delta from patch set Stats (+576 lines, -0 lines) Patch
A pkg/analysis_server/lib/src/channel.dart View 1 chunk +84 lines, -0 lines 4 comments Download
A pkg/analysis_server/lib/src/protocol.dart View 1 chunk +363 lines, -0 lines 9 comments Download
A pkg/analysis_server/test/mocks.dart View 1 chunk +17 lines, -0 lines 3 comments Download
A pkg/analysis_server/test/protocol_test.dart View 1 chunk +112 lines, -0 lines 2 comments Download

Messages

Total messages: 6 (0 generated)
Brian Wilkerson
6 years, 11 months ago (2014-01-18 21:23:50 UTC) #1
scheglov
LGTM
6 years, 11 months ago (2014-01-19 19:26:20 UTC) #2
devoncarew
lgtm lgtm, w/ some things to consider https://codereview.chromium.org/137853026/diff/1/pkg/analysis_server/lib/src/channel.dart File pkg/analysis_server/lib/src/channel.dart (right): https://codereview.chromium.org/137853026/diff/1/pkg/analysis_server/lib/src/channel.dart#newcode25 pkg/analysis_server/lib/src/channel.dart:25: void listen(void ...
6 years, 11 months ago (2014-01-20 22:35:01 UTC) #3
Brian Wilkerson
Committed patchset #1 manually as r31951 (presubmit successful).
6 years, 11 months ago (2014-01-21 03:21:04 UTC) #4
Brian Wilkerson
https://codereview.chromium.org/137853026/diff/1/pkg/analysis_server/lib/src/channel.dart File pkg/analysis_server/lib/src/channel.dart (right): https://codereview.chromium.org/137853026/diff/1/pkg/analysis_server/lib/src/channel.dart#newcode25 pkg/analysis_server/lib/src/channel.dart:25: void listen(void onRequest(Request request), {void onError(), void onDone()}); > ...
6 years, 11 months ago (2014-01-21 03:21:19 UTC) #5
devoncarew
6 years, 11 months ago (2014-01-21 04:16:08 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/137853026/diff/1/pkg/analysis_server/lib/src/...
File pkg/analysis_server/lib/src/protocol.dart (right):

https://codereview.chromium.org/137853026/diff/1/pkg/analysis_server/lib/src/...
pkg/analysis_server/lib/src/protocol.dart:72: var result =
DECODER.convert(data);
On 2014/01/21 03:21:20, Brian Wilkerson wrote:
> > var result = JSON.decode(data);
> 
> I considered this, but this method creates a new decoder every time it's
called.
> I thought it would be more efficient to create one instance of re-use it,
> especially given the number of requests that I expect most servers will get.

Hmm, I was not aware that a new decoder is created each time. I've always seen
the JSON.decode() form; it'd be a shame if it was less efficient.

https://codereview.chromium.org/137853026/diff/1/pkg/analysis_server/test/moc...
File pkg/analysis_server/test/mocks.dart (right):

https://codereview.chromium.org/137853026/diff/1/pkg/analysis_server/test/moc...
pkg/analysis_server/test/mocks.dart:7: import '../lib/src/channel.dart';
On 2014/01/21 03:21:20, Brian Wilkerson wrote:
> > You can also use a self-reference here:
> 
> That does seem somewhat cleaner, though. What's the prefered style for imports
> such as
> 
> import 'protocol.dart';
> 
> (such as the one in channel.dart)? Should it be
> 
> import 'package:analysis_server/src/protocol.dart';
> 
> Done.

Within lib, I've only ever used relative file references. When referencing into
lib (from test, bin, web, ...) I generally use self references.

Powered by Google App Engine
This is Rietveld 408576698