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

Side by Side Diff: packages/plugin/notes.txt

Issue 2990843002: Removed fixed dependencies (Closed)
Patch Set: Created 3 years, 4 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 | « packages/plugin/lib/src/plugin_impl.dart ('k') | packages/plugin/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
(Empty)
1 --------------------------------------------------------------------------------
2
3 To provide a psuedo backward compatible layer.
4
5 In plugin.dart:
6
7 /**
8 * A function used to register an extension point with the given simple
9 * [identifier]. If given, the [validator] will be used to validate extensions
10 * to the extension point.
11 *
12 * An [ExtensionError] will be thrown if the extension point cannot be
13 * registered, such as when a plugin attempts to define two extension points
14 * with the same simple identifier.
15 */
16 typedef ExtensionPoint RegisterExtensionPoint(String identifier,
17 [ValidateExtension validateExtension]);
18
19 class Plugin {
20 /**
21 * Use the [register] function to register all of the extension points
22 * contributed by this plugin.
23 *
24 * Clients should not invoke the [register] function after this method has
25 * returned.
26 *
27 * This method is deprecated and will be removed in the next breaking release.
28 * Plugins should migrate to using [registerExtensionPoints2].
29 */
30 void registerExtensionPoints(RegisterExtensionPoint register);
31 }
32
33 In plugin_impl.dart:
34
35 class ExtensionManager {
36
37 In processPlugins:
38
39 for (Plugin plugin in plugins) {
40 plugin.registerExtensionPoints((String identifier,
41 [ValidateExtension validateExtension]) =>
42 registerExtensionPoint(plugin, identifier, validateExtension));
43 }
44
45 /**
46 * Register an extension point being defined by the given [plugin] with the
47 * given simple [identifier] and [validateExtension].
48 */
49 ExtensionPoint registerExtensionPoint(
50 Plugin plugin, String identifier, ValidateExtension validateExtension) {
51 String uniqueIdentifier = Plugin.buildUniqueIdentifier(plugin, identifier);
52 if (extensionPoints.containsKey(uniqueIdentifier)) {
53 throw new ExtensionError(
54 'There is already an extension point with the id "$identifier"');
55 }
56 ExtensionPointImpl extensionPoint =
57 new ExtensionPointImpl(plugin, identifier, validateExtension);
58 extensionPoints[uniqueIdentifier] = extensionPoint;
59 return extensionPoint;
60 }
61 }
62
63 --------------------------------------------------------------------------------
OLDNEW
« no previous file with comments | « packages/plugin/lib/src/plugin_impl.dart ('k') | packages/plugin/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698