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

Side by Side Diff: dart/sdk/lib/async/deferred_load.dart

Issue 11784018: Skeleton API for lazy library loading. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Moved to dart:async, delete OnLibraryLoaded, renamed annotation, removed top-level method Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 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
3 // BSD-style license that can be found in the LICENSE file.
4
5 /**
6 * Indicates that loading of [libraryName] is deferred.
7 *
8 * Applies to library imports, when used as metadata.
9 *
10 * Example usage:
11 *
12 * [:
13 * @lazy
kasperl 2013/02/18 13:53:08 So lazy is a user-chosen name now. Neat. Maybe we
ahe 2013/02/18 14:32:11 I would use "lazyFoo", but I'll let other people h
14 * import 'foo.dart' as foo;
15 *
16 * const lazy = const DeferredLibrary('com.example.foo');
17 *
18 * void main() {
19 * foo.method(); // Throws a NoSuchMethodError, foo is not loaded yet.
20 * lazy.load().then(onFooLoaded);
21 * }
22 *
23 * void onFooLoaded(_) {
24 * foo.method();
25 * }
26 * :]
27 */
28 class DeferredLibrary {
29 final String libraryName;
30 final String uri;
31
32 const DeferLoad(this.libraryName, {this.uri});
kasperl 2013/02/18 13:53:08 DeferredLibrary
ahe 2013/02/18 14:32:11 Done.
33
34 /**
35 * Ensure that [libraryName] has been loaded.
36 *
37 * The value of the returned future is true if this invocation of
38 * [load] caused the library to be loaded.
39 */
40 external Future<bool> load();
41 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698