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

Side by Side Diff: lib/src/util/path_handler.dart

Issue 1580973002: Get rid of all the library tags. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 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/util/one_off_handler.dart ('k') | lib/src/util/remote_exception.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 test.util.path_handler;
6
7 import 'package:path/path.dart' as p; 5 import 'package:path/path.dart' as p;
8 import 'package:shelf/shelf.dart' as shelf; 6 import 'package:shelf/shelf.dart' as shelf;
9 7
10 /// A handler that routes to sub-handlers based on exact path prefixes. 8 /// A handler that routes to sub-handlers based on exact path prefixes.
11 class PathHandler { 9 class PathHandler {
12 /// A trie of path components to handlers. 10 /// A trie of path components to handlers.
13 final _paths = new _Node(); 11 final _paths = new _Node();
14 12
15 /// The shelf handler. 13 /// The shelf handler.
16 shelf.Handler get handler => _onRequest; 14 shelf.Handler get handler => _onRequest;
(...skipping 30 matching lines...) Expand all
47 return handler(request.change( 45 return handler(request.change(
48 path: p.url.joinAll(components.take(handlerIndex + 1)))); 46 path: p.url.joinAll(components.take(handlerIndex + 1))));
49 } 47 }
50 } 48 }
51 49
52 /// A trie node. 50 /// A trie node.
53 class _Node { 51 class _Node {
54 shelf.Handler handler; 52 shelf.Handler handler;
55 final children = new Map<String, _Node>(); 53 final children = new Map<String, _Node>();
56 } 54 }
OLDNEW
« no previous file with comments | « lib/src/util/one_off_handler.dart ('k') | lib/src/util/remote_exception.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698