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

Side by Side Diff: lib/src/middleware.dart

Issue 837193005: pkg/shelf: formatted code (Closed) Base URL: https://github.com/dart-lang/shelf.git@master
Patch Set: nits Created 5 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
« no previous file with comments | « lib/src/message.dart ('k') | lib/src/request.dart » ('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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 shelf.middleware; 5 library shelf.middleware;
6 6
7 import 'request.dart'; 7 import 'request.dart';
8 import 'response.dart'; 8 import 'response.dart';
9 import 'handler.dart'; 9 import 'handler.dart';
10 import 'hijack_exception.dart'; 10 import 'hijack_exception.dart';
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 if (error is HijackException) throw error; 60 if (error is HijackException) throw error;
61 return errorHandler(error, stackTrace); 61 return errorHandler(error, stackTrace);
62 }; 62 };
63 } 63 }
64 64
65 return (Handler innerHandler) { 65 return (Handler innerHandler) {
66 return (request) { 66 return (request) {
67 return syncFuture(() => requestHandler(request)).then((response) { 67 return syncFuture(() => requestHandler(request)).then((response) {
68 if (response != null) return response; 68 if (response != null) return response;
69 69
70 return syncFuture(() => innerHandler(request)) 70 return syncFuture(() => innerHandler(request)).then(
71 .then((response) => responseHandler(response), onError: onError); 71 (response) => responseHandler(response), onError: onError);
72 }); 72 });
73 }; 73 };
74 }; 74 };
75 } 75 }
OLDNEW
« no previous file with comments | « lib/src/message.dart ('k') | lib/src/request.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698