On 2017-03-21 10:40 PM, Boris Zbarsky wrote: > On 3/21/17 4:34 PM, Eric Rahm wrote: >> This doesn't affect the behavior of |Preferences::AddStrongObserver| >> which >> does prefix matching, correct? > > That's correct. Same for AddWeakObserver. > > It's a little harder to misuse because it doesn't have a closure arg (so > you can't just associate the totally wrong value with the closure in > some way, which was the main failure mode for RegisterCallback). > > But just for fun, start a debug build, open "about:config", create a new > preference called "intl.accept_languages_are_confusing" with any value > you want, and watch the nice MOZ_ASSERT failure in > nsGlobalWindow::Observe on this line: > > MOZ_ASSERT(!NS_strcmp(aData, u"intl.accept_languages")); > > So maybe we should push the exact/prefix match business down into the > pref observer API. :(
Ugh. Yeah, that looks like a good idea. Also, thank you for fixing RegisterCallback at least! _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform