Chromium Code Reviews
DescriptionFix race condition in MD Settings Languages page causing inconsistent settings
A theoretical race condition becomes problematic when adding the ability to
enable multiple languages at once (as the new UI mocks specify).
This is easily fixed by replacing SetLanguageList with EnableLanguage and
DisableLanguage.
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 -- but not immediately -- sent back to the WebUI to update
its copy of the pref.
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.
BUG=639523
R=stevenjb@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Committed: https://crrev.com/6de7389ad5a4245ea4d3a8c4aa7e9584725511a7
Cr-Commit-Position: refs/heads/master@{#413624}
Patch Set 1 #Patch Set 2 : git cl format #
Total comments: 4
Patch Set 3 : errors #
Total comments: 4
Patch Set 4 : logging #
Total comments: 2
Patch Set 5 : update histograms #Dependent Patchsets: Messages
Total messages: 25 (7 generated)
|