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

Side by Side Diff: third_party/pkg/di/lib/src/provider.dart

Issue 257423008: Update all Angular libs (run update_all.sh). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « third_party/pkg/di/lib/src/module.dart ('k') | third_party/pkg/di/lib/static_injector.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 library di.provider;
2
3 import 'injector_delagate.dart';
4 import 'base_injector.dart';
5 import 'package:di/di.dart';
6
7 abstract class ObjectFactory {
8 Object getInstanceByKey(Key key, BaseInjector requester, ResolutionContext res olving);
9 }
10
11 abstract class Provider {
12 final Visibility visibility;
13 final Type type;
14
15 Provider(this.type, this.visibility);
16
17 dynamic get(BaseInjector injector, BaseInjector requestor,
18 ObjectFactory objFactory, resolving);
19 }
20
21 class ValueProvider extends Provider {
22 dynamic value;
23
24 ValueProvider(type, this.value, [Visibility visibility])
25 : super(type, visibility);
26
27 dynamic get(BaseInjector injector, BaseInjector requestor,
28 ObjectFactory objFactory, resolving) => value;
29 }
30
31 class TypeProvider extends Provider {
32 TypeProvider(type, [Visibility visibility]) : super(type, visibility);
33
34 dynamic get(BaseInjector injector, BaseInjector requestor,
35 ObjectFactory objFactory, resolving) {
36 return injector.newInstanceOf(
37 type, objFactory, requestor, resolving);
38 }
39 }
40
41 class FactoryProvider extends Provider {
42 final Function factoryFn;
43
44 FactoryProvider(type, this.factoryFn, [Visibility visibility])
45 : super(type, visibility);
46
47 dynamic get(BaseInjector injector, BaseInjector requestor,
48 ObjectFactory objFactory, resolving) =>
49 factoryFn(new InjectorDelagate(injector, resolving));
50 }
OLDNEW
« no previous file with comments | « third_party/pkg/di/lib/src/module.dart ('k') | third_party/pkg/di/lib/static_injector.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698