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

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

Issue 616463004: pkg/shelf: include the original `onHijack` callback for Request.change (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
Index: pkg/shelf/lib/src/request.dart
diff --git a/pkg/shelf/lib/src/request.dart b/pkg/shelf/lib/src/request.dart
index 26fe011ff8d6b96135599d11574577556d4bdf79..718a5239857de879db3daad583ed1c0027e45921 100644
--- a/pkg/shelf/lib/src/request.dart
+++ b/pkg/shelf/lib/src/request.dart
@@ -116,16 +116,25 @@ class Request extends Message {
///
/// See also [hijack].
// TODO(kevmoo) finish documenting the rest of the arguments.
- Request(this.method, Uri requestedUri, {String protocolVersion,
+ Request(method, Uri requestedUri, {String protocolVersion,
nweiz 2014/10/13 18:43:43 Add a type annotation for [method].
kevmoo 2014/10/14 16:42:38 Done.
+ Map<String, String> headers, Uri url, String scriptName,
+ Stream<List<int>> body, Map<String, Object> context,
+ OnHijackCallback onHijack})
+ : this._(method, requestedUri, protocolVersion: protocolVersion,
+ headers: headers, url: url, scriptName: scriptName,
+ body: body, context: context,
+ onHijack: onHijack == null ? null : new _OnHijack(onHijack));
+
+ Request._(this.method, Uri requestedUri, {String protocolVersion,
nweiz 2014/10/13 18:43:43 Explain how this constructor is different than [ne
kevmoo 2014/10/14 16:42:38 Done.
Map<String, String> headers, Uri url, String scriptName,
Stream<List<int>> body, Map<String, Object> context,
- OnHijackCallback onHijack})
+ _OnHijack onHijack})
: this.requestedUri = requestedUri,
this.protocolVersion = protocolVersion == null ?
'1.1' : protocolVersion,
this.url = _computeUrl(requestedUri, url, scriptName),
this.scriptName = _computeScriptName(requestedUri, url, scriptName),
- this._onHijack = onHijack == null ? null : new _OnHijack(onHijack),
+ this._onHijack = onHijack,
super(body == null ? new Stream.fromIterable([]) : body,
headers: headers, context: context) {
if (method.isEmpty) throw new ArgumentError('method cannot be empty.');
@@ -194,9 +203,10 @@ class Request extends Message {
if (url == null) url = this.url;
if (scriptName == null) scriptName = this.scriptName;
- return new Request(this.method, this.requestedUri,
+ return new Request._(this.method, this.requestedUri,
protocolVersion: this.protocolVersion, headers: headers, url: url,
- scriptName: scriptName, body: this.read(), context: context);
+ scriptName: scriptName, body: this.read(), context: context,
+ onHijack: _onHijack);
}
/// Takes control of the underlying request socket.
« pkg/shelf/CHANGELOG.md ('K') | « pkg/shelf/CHANGELOG.md ('k') | pkg/shelf/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698