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

Side by Side Diff: lib/src/protobuf/event_plugin.dart

Issue 1282103003: fix inconsistent firing of events for extension fields (Closed) Base URL: git@github.com:dart-lang/dart-protobuf.git@fieldtype
Patch Set: tweak a comment Created 5 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
OLDNEW
1 part of protobuf; 1 part of protobuf;
2 2
3 /// An EventPlugin receives callbacks when the fields of a GeneratedMessage 3 /// An EventPlugin receives callbacks when the fields of a GeneratedMessage
4 /// change. 4 /// change.
5 /// 5 ///
6 /// A GeneratedMessage mixin can install a plugin by overriding the eventPlugin 6 /// A GeneratedMessage mixin can install a plugin by overriding the eventPlugin
7 /// property. The intent is provide mechanism, not policy; each mixin defines 7 /// property. The intent is provide mechanism, not policy; each mixin defines
8 /// its own public API, perhaps using streams. 8 /// its own public API, perhaps using streams.
9 /// 9 ///
10 /// This is a low-level, synchronous API. Event handlers are called in the 10 /// This is a low-level, synchronous API. Event handlers are called in the
11 /// middle of protobuf changes. To avoid exposing half-finished changes 11 /// middle of protobuf changes. To avoid exposing half-finished changes
12 /// to user code, plugins should buffer events and send them asynchronously. 12 /// to user code, plugins should buffer events and send them asynchronously.
13 /// (See event_mixin.dart for an example.) 13 /// (See event_mixin.dart for an example.)
14 abstract class EventPlugin { 14 abstract class EventPlugin {
15 15
16 /// Initializes the plugin. 16 /// Initializes the plugin.
17 /// 17 ///
18 /// GeneratedMessage calls this once in its constructors. 18 /// GeneratedMessage calls this once in its constructors.
19 void attach(GeneratedMessage parent); 19 void attach(GeneratedMessage parent);
20 20
21 /// If false, GeneratedMessage will skip calls to event handlers. 21 /// If false, GeneratedMessage will skip calls to event handlers.
22 bool get hasObservers; 22 bool get hasObservers;
23 23
24 /// Called before setting a field if startGroup returned true. 24 /// Called before setting a non-extension field.
25 /// 25 ///
26 /// For repeated fields, this will be called in getField() when 26 /// For repeated fields, this will be called in getField() when
27 /// the PbList is created. 27 /// the PbList is created.
28 void beforeSetField(int tag, newValue); 28 void beforeSetField(int tag, newValue);
29 29
30 /// Called before clearing a field if startGroup returned true. 30 /// Called before clearing a non-extension field.
31 void beforeClearField(int tag); 31 void beforeClearField(int tag);
32 } 32 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/protobuf/generated_message.dart » ('j') | lib/src/protobuf/generated_message.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698