• Lei Zhang's avatar
    Call BrowserProcess::GetApplicationLocale() on the right thread. · 2d9fa0de
    Lei Zhang authored
    GetApplicationLocale() should only be called on the UI thread. In
    r303655, GetApplicationLocale() calls in ResolveUILanguageList() got
    moved off the UI thread but nobody noticed because
    GetApplicationLocale() didn't have any DCHECKs. In the process of adding
    the DCHECKs, this issue now becomes apparent.
    
    Fix the issue by calling GetApplicationLocale() on the UI thread first,
    before posting a task to ResolveLanguageListInThreadPool(). This also
    replaces 4 GetApplicationLocale() calls with 1. Rearrange the logic
    inside ResolveLanguageListInThreadPool() slightly as well.
    
    Bug: 1033644
    Change-Id: I3c350c34cf253052bad18b850381e2c92003b7f7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036373Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
    Commit-Queue: Lei Zhang <thestig@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#738055}
    2d9fa0de
l10n_util.cc 23.4 KB