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

Side by Side Diff: lib/src/io/resource.dart

Issue 1612003002: Add browser-compatible version. (Closed) Base URL: https://github.com/dart-lang/resource.git@master
Patch Set: Made test run Created 4 years, 10 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/io/loader.dart ('k') | lib/src/loader.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
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.
4
5 import "dart:core" hide Resource;
6
7 import "loader.dart" show ResourceLoader, DefaultLoader;
8
9 // TODO(lrn): Merge with implementation when configured imports removes
10 // the need to share code.
11 import "../resource.dart" as base show Resource;
12
13 class Resource extends base.Resource {
14 /// Creates a resource object with the given [uri] as location.
15 ///
16 /// The [uri] must be either a [Uri] or a string containing a valid URI.
17 /// If the string is not a valid URI, using any of the functions on
18 /// the resource object will fail.
19 ///
20 /// The URI may be relative, in which case it will be resolved
21 /// against [Uri.base] before being used.
22 ///
23 /// The URI may use the `package` scheme, which is always supported.
24 /// Other schemes may also be supported where possible.
25 ///
26 /// If [loader] is provided, it is used to load absolute non-package URIs.
27 /// Package: URIs are resolved to a non-package URI before being loaded, so
28 /// the loader doesn't have to support package: URIs, nor does it need to
29 /// support relative URI references.
30 /// If [loader] is omitted, a default implementation is used which supports
31 /// as many of `http`, `https`, `file` and `data` as are available on the
32 /// current platform.
33 const Resource(uri, {ResourceLoader loader})
34 : super(uri, (loader != null) ? loader : const DefaultLoader());
35 }
OLDNEW
« no previous file with comments | « lib/src/io/loader.dart ('k') | lib/src/loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698