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

Side by Side Diff: pkg/http/lib/src/streamed_response.dart

Issue 196423017: Make BaseRequest.contentType use null rather than -1 as a flag value. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/http/lib/src/response.dart ('k') | pkg/http/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library streamed_response; 5 library streamed_response;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'byte_stream.dart'; 9 import 'byte_stream.dart';
10 import 'base_response.dart'; 10 import 'base_response.dart';
11 import 'base_request.dart'; 11 import 'base_request.dart';
12 import 'utils.dart'; 12 import 'utils.dart';
13 13
14 /// An HTTP response where the response body is received asynchronously after 14 /// An HTTP response where the response body is received asynchronously after
15 /// the headers have been received. 15 /// the headers have been received.
16 class StreamedResponse extends BaseResponse { 16 class StreamedResponse extends BaseResponse {
17 /// The stream from which the response body data can be read. This should 17 /// The stream from which the response body data can be read. This should
18 /// always be a single-subscription stream. 18 /// always be a single-subscription stream.
19 final ByteStream stream; 19 final ByteStream stream;
20 20
21 /// Creates a new streaming response. [stream] should be a single-subscription 21 /// Creates a new streaming response. [stream] should be a single-subscription
22 /// stream. 22 /// stream.
23 StreamedResponse( 23 StreamedResponse(
24 Stream<List<int>> stream, 24 Stream<List<int>> stream,
25 int statusCode, 25 int statusCode,
26 int contentLength, 26 {int contentLength,
27 {BaseRequest request, 27 BaseRequest request,
28 Map<String, String> headers: const {}, 28 Map<String, String> headers: const {},
29 bool isRedirect: false, 29 bool isRedirect: false,
30 bool persistentConnection: true, 30 bool persistentConnection: true,
31 String reasonPhrase}) 31 String reasonPhrase})
32 : super( 32 : super(
33 statusCode, 33 statusCode,
34 contentLength, 34 contentLength: contentLength,
35 request: request, 35 request: request,
36 headers: headers, 36 headers: headers,
37 isRedirect: isRedirect, 37 isRedirect: isRedirect,
38 persistentConnection: persistentConnection, 38 persistentConnection: persistentConnection,
39 reasonPhrase: reasonPhrase), 39 reasonPhrase: reasonPhrase),
40 this.stream = toByteStream(stream); 40 this.stream = toByteStream(stream);
41 } 41 }
OLDNEW
« no previous file with comments | « pkg/http/lib/src/response.dart ('k') | pkg/http/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698