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

Issue 124753002: Code cleanup (mostly io lib and some http lib). (Closed)

Created:
6 years, 11 months ago by vicb
Modified:
6 years, 10 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Code cleanup (mostly io lib and some http lib). - Unused function removed, - Make properties always appear before methods, - Use dart idioms where possible. BUG= R=ajohnsen@google.com Committed: https://code.google.com/p/dart/source/detail?r=31602

Patch Set 1 #

Total comments: 26

Patch Set 2 : integrate code review feedback #

Total comments: 4

Patch Set 3 : more fixes #

Patch Set 4 : more fixes #

Patch Set 5 : use => for 1 liner #

Patch Set 6 : fix indentation for latest patch set #

Patch Set 7 : Merge to head. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+775 lines, -863 lines) Patch
M pkg/http/lib/src/io_client.dart View 1 1 chunk +5 lines, -4 lines 0 comments Download
M pkg/http/lib/src/mock_client.dart View 1 1 chunk +7 lines, -7 lines 0 comments Download
M pkg/http/lib/src/utils.dart View 1 chunk +0 lines, -17 lines 0 comments Download
M runtime/include/dart_api.h View 1 2 3 4 5 6 3 chunks +3 lines, -3 lines 0 comments Download
M sdk/lib/io/common.dart View 2 chunks +22 lines, -23 lines 0 comments Download
M sdk/lib/io/crypto.dart View 4 chunks +21 lines, -21 lines 0 comments Download
M sdk/lib/io/directory.dart View 2 chunks +5 lines, -5 lines 0 comments Download
M sdk/lib/io/directory_impl.dart View 3 chunks +4 lines, -7 lines 0 comments Download
M sdk/lib/io/file.dart View 2 chunks +3 lines, -4 lines 0 comments Download
M sdk/lib/io/file_impl.dart View 6 chunks +9 lines, -14 lines 0 comments Download
M sdk/lib/io/file_system_entity.dart View 1 2 3 chunks +38 lines, -37 lines 0 comments Download
M sdk/lib/io/http.dart View 1 13 chunks +130 lines, -131 lines 0 comments Download
M sdk/lib/io/http_date.dart View 1 2 chunks +16 lines, -18 lines 1 comment Download
M sdk/lib/io/http_headers.dart View 1 7 chunks +108 lines, -108 lines 0 comments Download
M sdk/lib/io/http_impl.dart View 1 2 3 4 5 6 36 chunks +136 lines, -175 lines 0 comments Download
M sdk/lib/io/http_parser.dart View 1 4 chunks +42 lines, -43 lines 0 comments Download
M sdk/lib/io/http_session.dart View 6 chunks +10 lines, -16 lines 0 comments Download
M sdk/lib/io/io_sink.dart View 2 chunks +3 lines, -4 lines 0 comments Download
M sdk/lib/io/link.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/io/platform_impl.dart View 1 2 3 4 5 6 4 chunks +5 lines, -4 lines 0 comments Download
M sdk/lib/io/process.dart View 5 chunks +34 lines, -36 lines 0 comments Download
M sdk/lib/io/secure_server_socket.dart View 3 chunks +7 lines, -10 lines 0 comments Download
M sdk/lib/io/secure_socket.dart View 1 2 3 4 5 7 chunks +28 lines, -36 lines 0 comments Download
M sdk/lib/io/socket.dart View 9 chunks +73 lines, -74 lines 0 comments Download
M sdk/lib/io/stdio.dart View 3 chunks +3 lines, -3 lines 0 comments Download
M sdk/lib/io/websocket.dart View 3 chunks +18 lines, -18 lines 0 comments Download
M sdk/lib/io/websocket_impl.dart View 1 11 chunks +44 lines, -44 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
Lasse Reichstein Nielsen
This is great stuff. Are you testing a linter, or was this manual work? :) ...
6 years, 11 months ago (2014-01-06 09:29:29 UTC) #1
vicb
On 2014/01/06 09:29:29, Lasse Reichstein Nielsen wrote: > This is great stuff. Are you testing ...
6 years, 11 months ago (2014-01-06 09:41:03 UTC) #2
Søren Gjesse
On 2014/01/06 09:29:29, Lasse Reichstein Nielsen wrote: > This is great stuff. Are you testing ...
6 years, 11 months ago (2014-01-06 10:00:39 UTC) #3
Lasse Reichstein Nielsen
On 2014/01/06 10:00:39, Søren Gjesse wrote: > As far as I can see mailto:victor.berchet@gmail.com already ...
6 years, 11 months ago (2014-01-06 13:53:39 UTC) #4
vicb
On 2014/01/06 13:53:39, Lasse Reichstein Nielsen wrote: > > Right you are! In that case, ...
6 years, 11 months ago (2014-01-06 13:57:15 UTC) #5
Anders Johnsen
Hi Victor, I did the ZLib impl, so I suppose you could just upload a ...
6 years, 11 months ago (2014-01-06 14:01:52 UTC) #6
vicb
On 2014/01/06 14:01:52, Anders Johnsen wrote: > Hi Victor, > > I did the ZLib ...
6 years, 11 months ago (2014-01-06 14:16:14 UTC) #7
vicb
I forgot to mention that I am done with this patch in my latest msg.
6 years, 11 months ago (2014-01-06 14:52:25 UTC) #8
Søren Gjesse
On 2014/01/06 13:53:39, Lasse Reichstein Nielsen wrote: > On 2014/01/06 10:00:39, Søren Gjesse wrote: > ...
6 years, 11 months ago (2014-01-06 14:57:38 UTC) #9
Lasse Reichstein Nielsen
On 2014/01/06 14:16:14, vicb wrote: > On 2014/01/06 14:01:52, Anders Johnsen wrote: > https://codereview.chromium.org/124753002/diff/150001/sdk/lib/io/secure_socket.dart#newcode1103 > ...
6 years, 11 months ago (2014-01-07 12:31:28 UTC) #10
vicb
let's use the shorter version (included in set 5)
6 years, 11 months ago (2014-01-07 12:39:29 UTC) #11
Lasse Reichstein Nielsen
Committed patchset #7 manually as r31602 (presubmit successful).
6 years, 11 months ago (2014-01-08 12:03:34 UTC) #12
Ivan Posva
https://codereview.chromium.org/124753002/diff/510001/sdk/lib/io/http_date.dart File sdk/lib/io/http_date.dart (right): https://codereview.chromium.org/124753002/diff/510001/sdk/lib/io/http_date.dart#newcode46 sdk/lib/io/http_date.dart:46: StringBuffer sb = new StringBuffer() Lasse, Can you please ...
6 years, 11 months ago (2014-01-08 17:35:37 UTC) #13
vicb
On 2014/01/08 17:35:37, Ivan Posva wrote: > Can you please explain the motivation of this ...
6 years, 11 months ago (2014-01-08 18:44:19 UTC) #14
nweiz
Please don't commit changes to Bob's and my pkg packages without including us on the ...
6 years, 10 months ago (2014-01-28 20:56:54 UTC) #15
vicb
Is there any place where package owners are listed ? I had trouble ccing a ...
6 years, 10 months ago (2014-01-28 21:23:27 UTC) #16
ahe
Hi Victor, I think it is great that you corrected spelling errors and removed dead ...
6 years, 10 months ago (2014-02-13 04:04:14 UTC) #17
vicb
6 years, 10 months ago (2014-02-13 08:55:46 UTC) #18
Message was sent while issue was closed.
On 2014/02/13 04:04:14, ahe wrote:
> Hi Victor,
> 
> I think it is great that you corrected spelling errors and removed dead code.
> Thank you for doing that!

Thanks

> However, some of the changes made concern me. For example, changing code to
use
> cascades, moving functions around, and replacing "return" with "=>". I think
it
> is unnecessary. It doesn't fix bugs, and might add new bugs. It also creates
> noise in the version history.

You're right, moving chunks of code might not be a good thing as it could cause
headache when merging changes. However smaller changes should not be a problem 
with version control ? IMO "noise" is inherent to VCS, not a bad thing.

I read the core lib code to learn Dart - I expect it to follow best practices. 
When I think it could be improved, I try to improve. If some(/all) changes
should 
not be merged, let me know and I will revert.

Regarding potential bug introduction, Dart has UTs and wonderful reviewers but
once again, I would be happy to revert any un-relevant changes.
 
> I think we should consider having a policy in Dart that you shouldn't make
> formatting-only changes to code you're not maintaining.

Good point. A CONTRIBUTING[.md] file with guidelines at the repo root would 
be great !
 
> On 2014/01/28 21:23:27, vicb wrote:
> > Is there any place where package owners are listed ?
> 
> I prefer the word "maintainer" to "owner". It is considered polite to CC
> maintainers.
> 
> Most often, the most recent committers or reviewers are the maintainers, and
you
> can find them by browsing the sources via the project page, for example:
> 
>
https://code.google.com/p/dart/source/list?path=/branches/bleeding_edge/dart/...

Thanks for the tip. I'll try to do better in the future, still learning and
you guys are great at providing useful advice. codereview is a bit hard at
th beginning, I really miss some github features (ie a pull request can be
composed of multiple commits, you can see all the PRs related to one project
easily, ...).
 
> Cheers,
> Peter

Thank you Peter and all for being helpful. Let me know what you think about a
CONTRIBUTING[.md] a the root. If it can help, I could draft something.

Cheers,
Victor

Powered by Google App Engine
This is Rietveld 408576698