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

Unified Diff: pkg/shelf/lib/src/message.dart

Issue 226263007: issue 17992 Added extra params to message (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/shelf/lib/src/request.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/shelf/lib/src/message.dart
diff --git a/pkg/shelf/lib/src/message.dart b/pkg/shelf/lib/src/message.dart
index 737c72224f88ee21172239a971e776371ddf7dba..298269a6c5a5232518c48727c2eb9221d69e97c8 100644
--- a/pkg/shelf/lib/src/message.dart
+++ b/pkg/shelf/lib/src/message.dart
@@ -23,8 +23,17 @@ abstract class Message {
/// This can be read via [read] or [readAsString].
final Stream<List<int>> _body;
- Message(UnmodifiableMapView<String, String> headers, this._body)
- : this.headers = headers;
+ /// Extra parameters for handlers to pass data to downstream handlers
nweiz 2014/04/08 21:33:50 I don't know that everyone will have the same intu
andersmholmgren 2014/04/08 22:16:36 My bad, clearly I was thinking of request context
+ /// TODO: less sucky name
+ ///
+ /// The value is immutable.
+ final Map<String, Object> extraParams;
nweiz 2014/04/08 21:33:50 I like "context" as a name here.
andersmholmgren 2014/04/08 22:16:36 +1. That's the best name. It came to me a day afte
+
+
+ Message(UnmodifiableMapView<String, String> headers, this._body,
+ [ UnmodifiableMapView<String, Object> extraParams ])
+ : this.headers = headers,
+ this.extraParams = extraParams;
/// The contents of the content-length field in [headers].
///
« no previous file with comments | « no previous file | pkg/shelf/lib/src/request.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698