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

Issue 13825003: Fix uninintialized ResourceBundle in ShowUserDataDirDialog. (Closed)

Created:
7 years, 8 months ago by hshi1
Modified:
7 years, 8 months ago
CC:
chromium-reviews, markusheintz_
Visibility:
Public.

Description

Fix uninintialized ResourceBundle in ShowUserDataDirDialog. Make sure ResourceBundle is initialized when showing the user data dir dialog. The dialog needs to access string resources. BUG=230432 TEST=CQ Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193844

Patch Set 1 #

Total comments: 2

Patch Set 2 : Check if a locale override is specified on the command line. #

Patch Set 3 : Fix compile error due to missing switches header include. #

Total comments: 2

Patch Set 4 : Use l10n_util::GetApplicationLocale instead of cmdline switches. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -0 lines) Patch
M chrome/browser/user_data_dir_extractor_win.cc View 1 2 3 3 chunks +14 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
hshi1
Please take a look. It seems necessary to initialize ResourceBundle prior to displaying the UserDataDirDialog ...
7 years, 8 months ago (2013-04-11 18:15:46 UTC) #1
Nico
I'm not terribly familiar with resource bundles. tony@ is, and it looks like markusheintz@ did ...
7 years, 8 months ago (2013-04-11 18:29:29 UTC) #2
hshi1
Yes unfortunately at this moment user prefs is not yet available. Is the switches::kLang typically ...
7 years, 8 months ago (2013-04-11 18:33:12 UTC) #3
Nico
On Thu, Apr 11, 2013 at 11:33 AM, <hshi@chromium.org> wrote: > Yes unfortunately at this ...
7 years, 8 months ago (2013-04-11 19:24:39 UTC) #4
Nico
Tony's ooo responder informs me that we should ask Jungshik about the locale question. Jungshik: ...
7 years, 8 months ago (2013-04-11 19:28:23 UTC) #5
hshi1
https://codereview.chromium.org/13825003/diff/1/chrome/browser/user_data_dir_extractor_win.cc File chrome/browser/user_data_dir_extractor_win.cc (right): https://codereview.chromium.org/13825003/diff/1/chrome/browser/user_data_dir_extractor_win.cc#newcode53 chrome/browser/user_data_dir_extractor_win.cc:53: ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); I've added a check for command line ...
7 years, 8 months ago (2013-04-11 20:23:19 UTC) #6
jungshik at Google
https://codereview.chromium.org/13825003/diff/24001/chrome/browser/user_data_dir_extractor_win.cc File chrome/browser/user_data_dir_extractor_win.cc (right): https://codereview.chromium.org/13825003/diff/24001/chrome/browser/user_data_dir_extractor_win.cc#newcode60 chrome/browser/user_data_dir_extractor_win.cc:60: locale = kDefaultUserDataDirDialogLocale; Can we do better than this? ...
7 years, 8 months ago (2013-04-11 21:57:55 UTC) #7
hshi1
Jungshik - To give you some background: the ShowUserDataDirDialog is a Windows-specific dialog that is ...
7 years, 8 months ago (2013-04-11 22:09:42 UTC) #8
hshi1
BTW Junshik - could you point me to where our UI-language-determination logic is? If there ...
7 years, 8 months ago (2013-04-11 22:17:30 UTC) #9
jungshik at Google
Sorry that I didn't point you where that is. (and also thank you for the ...
7 years, 8 months ago (2013-04-11 22:51:11 UTC) #10
hshi1
https://codereview.chromium.org/13825003/diff/24001/chrome/browser/user_data_dir_extractor_win.cc File chrome/browser/user_data_dir_extractor_win.cc (right): https://codereview.chromium.org/13825003/diff/24001/chrome/browser/user_data_dir_extractor_win.cc#newcode60 chrome/browser/user_data_dir_extractor_win.cc:60: locale = kDefaultUserDataDirDialogLocale; Can you review Patch Set #4? ...
7 years, 8 months ago (2013-04-11 23:05:33 UTC) #11
jungshik at Google
LGTM thanks. On 2013/04/11 23:05:33, hshi1 wrote: > https://codereview.chromium.org/13825003/diff/24001/chrome/browser/user_data_dir_extractor_win.cc > File chrome/browser/user_data_dir_extractor_win.cc (right): > > ...
7 years, 8 months ago (2013-04-11 23:38:41 UTC) #12
Nico
lgtm too then
7 years, 8 months ago (2013-04-11 23:41:28 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hshi@chromium.org/13825003/31001
7 years, 8 months ago (2013-04-12 00:37:49 UTC) #14
commit-bot: I haz the power
Change committed as 193844
7 years, 8 months ago (2013-04-12 04:33:11 UTC) #15
hshi1
7 years, 8 months ago (2013-04-16 17:41:42 UTC) #16
Message was sent while issue was closed.
Jungshik,

The crbug.com is currently down so I'm commenting here. Unfortunately this CL
doesn't work, we're still observing CHECK failures due to uninitialized
ResourceBundle on the latest win-dev builds.

Sample crash report:
https://crash.corp.google.com/reportdetail?reportid=8a2d767ec481a44a

Problem: l10n_util::GetApplicationLocale calls l10n_util::IsLocaleAvailable
which relies on ResourceBundle being already initialized. So it is not safe to
use this.

I suggest to fix this by adding a ResourceBundle::HasSharedInstance() in
l10n_util::IsLocaleAvailable and return false if the ResourceBundle is not
initialized.

Powered by Google App Engine
This is Rietveld 408576698