Confirmed users
86
edits
(Add a note about DidSet.) |
(Clarify when the ContentParent is passed to CanSet()) |
||
| Line 50: | Line 50: | ||
# The field index that names it (for overloading) | # The field index that names it (for overloading) | ||
# The value being set | # The value being set | ||
# | # A <syntaxhighlight lang="C++" inline>ContentParent</syntaxhighlight>, if and when it is receiving a transaction from its <syntaxhighlight lang="C++" inline>ContentChild</syntaxhighlight>. | ||
Finally, there will also be field setter callbacks available as <syntaxhighlight lang="C++" inline>DidSet</syntaxhighlight> methods. <syntaxhighlight lang="C++" inline>DidSet</syntaxhighlight> is supposed to be overridden, and can either take only the field index that names it, or the field index and the previous value. | Finally, there will also be field setter callbacks available as <syntaxhighlight lang="C++" inline>DidSet</syntaxhighlight> methods. <syntaxhighlight lang="C++" inline>DidSet</syntaxhighlight> is supposed to be overridden, and can either take only the field index that names it, or the field index and the previous value. | ||
| Line 58: | Line 58: | ||
With this we know everything needed to add synced state to a class, so | With this we know everything needed to add synced state to a class, so | ||
we will show a small | we will show a small contrived example: | ||
<syntaxhighlight lang="C++"> | <syntaxhighlight lang="C++"> | ||
| Line 97: | Line 97: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
(Again note that the returning <syntaxhighlight lang="C++" inline>nsresult</syntaxhighlight> isn't actually in tree yet). | (Again note that the returning <syntaxhighlight lang="C++" inline>nsresult</syntaxhighlight> isn't actually in tree yet). | ||
== Browsing Contexts == | == Browsing Contexts == | ||