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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/lib/async_patch.dart

Issue 11784018: Skeleton API for lazy library loading. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Dummy implementations and tests of basic API, but not functionality 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Patch file for the dart:async library. 5 // Patch file for the dart:async library.
6 6
7 import 'dart:_isolate_helper' show TimerImpl; 7 import 'dart:_isolate_helper' show TimerImpl;
8 8
9 typedef void _TimerCallback0(); 9 typedef void _TimerCallback0();
10 typedef void _TimerCallback1(Timer timer); 10 typedef void _TimerCallback1(Timer timer);
(...skipping 20 matching lines...) Expand all
31 * [milliseconds] millisecond until cancelled. 31 * [milliseconds] millisecond until cancelled.
32 */ 32 */
33 patch factory Timer.repeating(var duration, void callback(Timer timer)) { 33 patch factory Timer.repeating(var duration, void callback(Timer timer)) {
34 // TODO(floitsch): remove this check when we remove the deprecated 34 // TODO(floitsch): remove this check when we remove the deprecated
35 // millisecond argument. 35 // millisecond argument.
36 int milliseconds = duration is int ? duration : duration.inMilliseconds; 36 int milliseconds = duration is int ? duration : duration.inMilliseconds;
37 if (milliseconds < 0) milliseconds = 0; 37 if (milliseconds < 0) milliseconds = 0;
38 return new TimerImpl.repeating(milliseconds, callback); 38 return new TimerImpl.repeating(milliseconds, callback);
39 } 39 }
40 } 40 }
41
42 final Set<String> _loadedLibraries = new Set<String>();
43
44 patch class DeferredLibrary {
45 patch Future<bool> load() {
46 // TODO(ahe): Implement this.
47 Future future =
48 new Future<bool>.immediate(!_loadedLibraries.contains(libraryName));
49 _loadedLibraries.add(libraryName);
50 return future;
51 }
52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698