Making multiple changes in Languages could theoretically discard some changes,
because two different sources are used for the list of enabled languages (JS and
C++). With the new UI mocks, this can *always* happen, so we need to fix it.
Currently, to enable or disable a language, languages.js adds/removes that
language from its copy of the languages pref. It then sends that list to Chrome
via chrome.languageSettingsPrivate.SetLanguageList, which updates the pref; that
update is eventually sent back to the WebUI.
If languages.js tries to enable two languages in a row, it would be using a
stale pref for the second update. This could happen even if languages.js is
invoked asynchronous, but happens deterministically if the calls are made
synchronously because the old pref is used before the new one is updated.
Comment 1 by bugdroid1@chromium.org
, Aug 23 2016