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

Side by Side Diff: pkg/shelf/lib/src/shelf_unmodifiable_map.dart

Issue 294123011: pkg/shelf: added `url` and `scriptName` named params to Request.change (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: doc comment tweak Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « pkg/shelf/lib/src/request.dart ('k') | pkg/shelf/pubspec.yaml » ('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.shelf_unmodifiable_map; 5 library shelf.shelf_unmodifiable_map;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 // TODO(kevmoo): use UnmodifiableMapView from SDK once 1.4 ships 9 // TODO(kevmoo): MapView lacks a const ctor, so we have to use DelegatingMap
10 // from pkg/collection - https://codereview.chromium.org/294093003/
10 import 'package:collection/wrappers.dart' as pc; 11 import 'package:collection/wrappers.dart' as pc;
11 12
12 /// A simple wrapper over [pc.UnmodifiableMapView] which avoids re-wrapping 13 /// A simple wrapper over [pc.UnmodifiableMapView] which avoids re-wrapping
13 /// itself. 14 /// itself.
14 class ShelfUnmodifiableMap<V> extends pc.UnmodifiableMapView<String, V> { 15 class ShelfUnmodifiableMap<V> extends UnmodifiableMapView<String, V> {
15 /// If [source] is a [ShelfUnmodifiableMap] with matching [ignoreKeyCase], 16 /// If [source] is a [ShelfUnmodifiableMap] with matching [ignoreKeyCase],
16 /// then [source] is returned. 17 /// then [source] is returned.
17 /// 18 ///
18 /// If [source] is `null` it is treated like an empty map. 19 /// If [source] is `null` it is treated like an empty map.
19 /// 20 ///
20 /// If [ignoreKeyCase] is `true`, the keys will have case-insensitive access. 21 /// If [ignoreKeyCase] is `true`, the keys will have case-insensitive access.
21 /// 22 ///
22 /// [source] is copied to a new [Map] to ensure changes to the paramater value 23 /// [source] is copied to a new [Map] to ensure changes to the paramater value
23 /// after constructions are not reflected. 24 /// after constructions are not reflected.
24 factory ShelfUnmodifiableMap(Map<String, V> source, 25 factory ShelfUnmodifiableMap(Map<String, V> source,
(...skipping 24 matching lines...) Expand all
49 } 50 }
50 51
51 ShelfUnmodifiableMap._(Map<String, V> source) : super(source); 52 ShelfUnmodifiableMap._(Map<String, V> source) : super(source);
52 } 53 }
53 54
54 /// An const empty implementation of [ShelfUnmodifiableMap]. 55 /// An const empty implementation of [ShelfUnmodifiableMap].
55 class _EmptyShelfUnmodifiableMap<V> extends pc.DelegatingMap<String, V> 56 class _EmptyShelfUnmodifiableMap<V> extends pc.DelegatingMap<String, V>
56 implements ShelfUnmodifiableMap<V> { 57 implements ShelfUnmodifiableMap<V> {
57 const _EmptyShelfUnmodifiableMap() : super(const {}); 58 const _EmptyShelfUnmodifiableMap() : super(const {});
58 } 59 }
OLDNEW
« no previous file with comments | « pkg/shelf/lib/src/request.dart ('k') | pkg/shelf/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698