Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Issue 2261903002: Fix race condition in MD Settings Languages page causing inconsistent settings (Closed)

Created:
4 years, 4 months ago by michaelpg
Modified:
4 years, 4 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, michaelpg+watch-md-settings_chromium.org, jlklein+watch-closure_chromium.org, michaelpg+watch-md-ui_chromium.org, arv+watch_chromium.org, vitalyp+closure_chromium.org, chromium-apps-reviews_chromium.org, dbeam+watch-settings_chromium.org, stevenjb+watch-md-settings_chromium.org, dbeam+watch-closure_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix 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 #

Messages

Total messages: 25 (7 generated)
michaelpg
PTAL.
4 years, 4 months ago (2016-08-20 00:10:26 UTC) #3
stevenjb
lgtm https://codereview.chromium.org/2261903002/diff/20001/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc File chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc (right): https://codereview.chromium.org/2261903002/diff/20001/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc#newcode270 chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc:270: parameters->language_code) == languages.end()) { We should invert this ...
4 years, 4 months ago (2016-08-22 17:03:50 UTC) #4
michaelpg
PTAL - devlin: chrome/common/extensions/api/language_settings_private.idl isherman: extensions/browser/extension_function_histogram_value.h Thanks! https://codereview.chromium.org/2261903002/diff/20001/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc File chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc (right): https://codereview.chromium.org/2261903002/diff/20001/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc#newcode270 chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc:270: parameters->language_code) == ...
4 years, 4 months ago (2016-08-22 18:24:46 UTC) #6
Devlin
idl lgtm, feel free to ignore my random drive-bys in the api.cc if they don't ...
4 years, 4 months ago (2016-08-22 18:38:20 UTC) #7
stevenjb
https://codereview.chromium.org/2261903002/diff/40001/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc File chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc (right): https://codereview.chromium.org/2261903002/diff/40001/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc#newcode276 chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc:276: return RespondNow(Error(kErrorLanguageAlreadyEnabled)); On 2016/08/22 18:38:19, Devlin wrote: > drive-by: ...
4 years, 4 months ago (2016-08-22 18:41:31 UTC) #8
Devlin
https://codereview.chromium.org/2261903002/diff/40001/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc File chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc (right): https://codereview.chromium.org/2261903002/diff/40001/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc#newcode276 chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc:276: return RespondNow(Error(kErrorLanguageAlreadyEnabled)); On 2016/08/22 18:41:30, stevenjb wrote: > On ...
4 years, 4 months ago (2016-08-22 19:01:00 UTC) #9
michaelpg
On 2016/08/22 19:01:00, Devlin wrote: > https://codereview.chromium.org/2261903002/diff/40001/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc > File > chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc > (right): > > ...
4 years, 4 months ago (2016-08-22 19:06:28 UTC) #10
stevenjb
On 2016/08/22 19:06:28, michaelpg wrote: > On 2016/08/22 19:01:00, Devlin wrote: > > > https://codereview.chromium.org/2261903002/diff/40001/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc ...
4 years, 4 months ago (2016-08-22 19:18:28 UTC) #11
michaelpg
On 2016/08/22 19:18:28, stevenjb wrote: > On 2016/08/22 19:06:28, michaelpg wrote: > > On 2016/08/22 ...
4 years, 4 months ago (2016-08-22 19:28:10 UTC) #12
stevenjb
Oh, right, yes, it would need a void callback (which I guess could also have ...
4 years, 4 months ago (2016-08-22 19:35:22 UTC) #13
michaelpg
Patchset 4 uses logging instead of error callbacks.
4 years, 4 months ago (2016-08-22 20:35:08 UTC) #14
stevenjb
lgtm++
4 years, 4 months ago (2016-08-22 20:37:34 UTC) #15
Ilya Sherman
https://codereview.chromium.org/2261903002/diff/60001/extensions/browser/extension_function_histogram_value.h File extensions/browser/extension_function_histogram_value.h (right): https://codereview.chromium.org/2261903002/diff/60001/extensions/browser/extension_function_histogram_value.h#newcode1209 extensions/browser/extension_function_histogram_value.h:1209: // python tools/metrics/histograms/update_extension_histograms.py ^^^ Please run the script to ...
4 years, 4 months ago (2016-08-22 20:54:05 UTC) #16
michaelpg
https://codereview.chromium.org/2261903002/diff/60001/extensions/browser/extension_function_histogram_value.h File extensions/browser/extension_function_histogram_value.h (right): https://codereview.chromium.org/2261903002/diff/60001/extensions/browser/extension_function_histogram_value.h#newcode1209 extensions/browser/extension_function_histogram_value.h:1209: // python tools/metrics/histograms/update_extension_histograms.py On 2016/08/22 20:54:05, Ilya Sherman wrote: ...
4 years, 4 months ago (2016-08-22 22:36:15 UTC) #17
Ilya Sherman
histograms.xml lgtm, thanks
4 years, 4 months ago (2016-08-22 22:58:55 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2261903002/80001
4 years, 4 months ago (2016-08-23 00:02:52 UTC) #21
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 4 months ago (2016-08-23 01:50:45 UTC) #23
commit-bot: I haz the power
4 years, 4 months ago (2016-08-23 01:53:44 UTC) #25
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/6de7389ad5a4245ea4d3a8c4aa7e9584725511a7
Cr-Commit-Position: refs/heads/master@{#413624}

Powered by Google App Engine
This is Rietveld 408576698