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

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

Issue 12021022: Stop supporting map literals with 1 type argument (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 | « no previous file | pkg/http/lib/src/base_response.dart » ('j') | pkg/http/lib/src/base_response.dart » ('J')
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 base_request; 5 library base_request;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:isolate'; 9 import 'dart:isolate';
10 import 'dart:uri'; 10 import 'dart:uri';
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // TODO(nweiz): make this a HttpHeaders object 75 // TODO(nweiz): make this a HttpHeaders object
76 /// The headers for this request. 76 /// The headers for this request.
77 final Map<String, String> headers; 77 final Map<String, String> headers;
78 78
79 /// Whether the request has been finalized. 79 /// Whether the request has been finalized.
80 bool get finalized => _finalized; 80 bool get finalized => _finalized;
81 bool _finalized = false; 81 bool _finalized = false;
82 82
83 /// Creates a new HTTP request. 83 /// Creates a new HTTP request.
84 BaseRequest(this.method, this.url) 84 BaseRequest(this.method, this.url)
85 : headers = <String>{}; 85 : headers = {};
regis 2013/01/18 22:29:42 You are relaxing the map by making it raw. Why not
86 86
87 /// Finalizes the HTTP request in preparation for it being sent. This freezes 87 /// Finalizes the HTTP request in preparation for it being sent. This freezes
88 /// all mutable fields and returns a single-subscription [ByteStream] that 88 /// all mutable fields and returns a single-subscription [ByteStream] that
89 /// emits the body of the request. 89 /// emits the body of the request.
90 /// 90 ///
91 /// The base implementation of this returns null rather than a [ByteStream]; 91 /// The base implementation of this returns null rather than a [ByteStream];
92 /// subclasses are responsible for creating the return value, which should be 92 /// subclasses are responsible for creating the return value, which should be
93 /// single-subscription to ensure that no data is dropped. They should also 93 /// single-subscription to ensure that no data is dropped. They should also
94 /// freeze any additional mutable fields they add that don't make sense to 94 /// freeze any additional mutable fields they add that don't make sense to
95 /// change after the request headers are sent. 95 /// change after the request headers are sent.
(...skipping 30 matching lines...) Expand all
126 } 126 }
127 127
128 /// Throws an error if this request has been finalized. 128 /// Throws an error if this request has been finalized.
129 void _checkFinalized() { 129 void _checkFinalized() {
130 if (!finalized) return; 130 if (!finalized) return;
131 throw new StateError("Can't modify a finalized Request."); 131 throw new StateError("Can't modify a finalized Request.");
132 } 132 }
133 133
134 String toString() => "$method $url"; 134 String toString() => "$method $url";
135 } 135 }
OLDNEW
« no previous file with comments | « no previous file | pkg/http/lib/src/base_response.dart » ('j') | pkg/http/lib/src/base_response.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698