I have just landed a change[1] which changes
Preferences::RegisterCallback/RegisterCallbackAndCall to do an exact,
not prefix, match on the passed-in string.
So if you do:
Preferences::RegisterCallback(MyFunc, "foo");
and the preference named "foobar" changes, MyFunc will no longer be
called. Most consumers did not expect this behavior, and a number were
buggy as a result.
The old behavior is still available via a new
RegisterPrefixCallback/RegisterPrefixCallbackAndCall/UnregisterPrefixCallback
API. These can be used to observe all preferences whose names start
with the given string.
One caveat: It's very important to correctly pair up the registration
and unregistration functions. If you RegisterPrefixCallback but then
UnregisterCallback, it will not actually unregister the callback.
-Boris
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1348331
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform