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. :(

-Boris
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to