| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 http_server; | 5 library http_server; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert' show HtmlEscape; |
| 8 import 'dart:io'; | 9 import 'dart:io'; |
| 9 | 10 |
| 10 import 'dart:convert' show | 11 import '../vendored_pkg/args/args.dart'; |
| 11 HtmlEscape; | |
| 12 | 12 |
| 13 import 'path.dart'; | 13 import 'path.dart'; |
| 14 import 'test_suite.dart'; // For TestUtils. | 14 import 'test_utils.dart'; |
| 15 // TODO(efortuna): Rewrite to not use the args library and simply take an | |
| 16 // expected number of arguments, so test.dart doesn't rely on the args library? | |
| 17 // See discussion on https://codereview.chromium.org/11931025/. | |
| 18 import 'vendored_pkg/args/args.dart'; | |
| 19 import 'utils.dart'; | 15 import 'utils.dart'; |
| 20 | 16 |
| 21 class DispatchingServer { | 17 class DispatchingServer { |
| 22 HttpServer server; | 18 HttpServer server; |
| 23 Map<String, Function> _handlers = new Map<String, Function>(); | 19 Map<String, Function> _handlers = new Map<String, Function>(); |
| 24 Function _notFound; | 20 Function _notFound; |
| 25 | 21 |
| 26 DispatchingServer(this.server, | 22 DispatchingServer(this.server, |
| 27 void onError(e), | 23 void onError(e), |
| 28 void this._notFound(HttpRequest request)) { | 24 void this._notFound(HttpRequest request)) { |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 class _Entry implements Comparable { | 452 class _Entry implements Comparable { |
| 457 final String name; | 453 final String name; |
| 458 final String displayName; | 454 final String displayName; |
| 459 | 455 |
| 460 _Entry(this.name, this.displayName); | 456 _Entry(this.name, this.displayName); |
| 461 | 457 |
| 462 int compareTo(_Entry other) { | 458 int compareTo(_Entry other) { |
| 463 return name.compareTo(other.name); | 459 return name.compareTo(other.name); |
| 464 } | 460 } |
| 465 } | 461 } |
| OLD | NEW |