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

Issue 10082003: Start refactoring of the HTTP header handling (Closed)

Created:
8 years, 8 months ago by Søren Gjesse
Modified:
8 years, 8 months ago
Reviewers:
Anders Johnsen
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Start refactoring of the HTTP header handling This change moves the headers into a separate object. There will be follow-up changes for handling whether the headers are read-only or mutable. Also additional tests will be added later. R=ajohnsen@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=6567

Patch Set 1 #

Total comments: 20

Patch Set 2 : Addressed review comments #

Total comments: 2

Patch Set 3 : Addressed second round of comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+384 lines, -147 lines) Patch
M runtime/bin/http.dart View 1 2 5 chunks +161 lines, -18 lines 0 comments Download
M runtime/bin/http_impl.dart View 1 2 14 chunks +186 lines, -99 lines 0 comments Download
M runtime/bin/http_parser.dart View 1 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/io.dart View 1 1 chunk +0 lines, -1 line 0 comments Download
M samples/chat/chat_server_lib.dart View 4 chunks +4 lines, -4 lines 0 comments Download
M tests/standalone/src/io/HttpTest.dart View 6 chunks +32 lines, -25 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Søren Gjesse
8 years, 8 months ago (2012-04-13 11:26:06 UTC) #1
Anders Johnsen
LGTM, This will simplify the http implementation, very neat! :) https://chromiumcodereview.appspot.com/10082003/diff/1/runtime/bin/http.dart File runtime/bin/http.dart (right): https://chromiumcodereview.appspot.com/10082003/diff/1/runtime/bin/http.dart#newcode110 ...
8 years, 8 months ago (2012-04-13 11:47:53 UTC) #2
Søren Gjesse
ptal https://chromiumcodereview.appspot.com/10082003/diff/1/runtime/bin/http.dart File runtime/bin/http.dart (right): https://chromiumcodereview.appspot.com/10082003/diff/1/runtime/bin/http.dart#newcode110 runtime/bin/http.dart:110: interface HttpHeaders default _HttpHeaders { On 2012/04/13 11:47:53, ...
8 years, 8 months ago (2012-04-16 11:37:16 UTC) #3
Anders Johnsen
LGTM, very nice! https://chromiumcodereview.appspot.com/10082003/diff/1/runtime/bin/http.dart File runtime/bin/http.dart (right): https://chromiumcodereview.appspot.com/10082003/diff/1/runtime/bin/http.dart#newcode215 runtime/bin/http.dart:215: List<String> operator[](String name); On 2012/04/16 11:37:16, ...
8 years, 8 months ago (2012-04-16 11:50:46 UTC) #4
Søren Gjesse
8 years, 8 months ago (2012-04-16 12:17:31 UTC) #5
https://chromiumcodereview.appspot.com/10082003/diff/1/runtime/bin/http.dart
File runtime/bin/http.dart (right):

https://chromiumcodereview.appspot.com/10082003/diff/1/runtime/bin/http.dart#...
runtime/bin/http.dart:215: List<String> operator[](String name);
On 2012/04/16 11:50:46, ajohnsen wrote:
> On 2012/04/16 11:37:16, Søren Gjesse wrote:
> > On 2012/04/13 11:47:53, ajohnsen wrote:
> > > Now we have no trivial way of getting the only header available (the most
> > common
> > > case). I'm not saying it's bad, since the user should consider all cases.
> I'm
> > > just not convinced it's ideal. What do you think?
> > 
> > I agree, in the tests I had to use [0] in quite a few places which was
> annoying.
> > However I have no good suggestion other than adding an additional method to
> > return a string.
> 
> I think we should just do that, and throw an exception if we have multiple
> values.

Added method value for now.

https://chromiumcodereview.appspot.com/10082003/diff/4001/runtime/bin/http_im...
File runtime/bin/http_impl.dart (right):

https://chromiumcodereview.appspot.com/10082003/diff/4001/runtime/bin/http_im...
runtime/bin/http_impl.dart:143: String toString() {
On 2012/04/16 11:50:46, ajohnsen wrote:
> Looks good, and yes, let's use \n for line feed here. I do however thing we
> should return 'sb.toString()' :)

Good catch. Added return of sb.toString().

Powered by Google App Engine
This is Rietveld 408576698