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

Issue 10546139: Do the ReloadLocaleResources() call on the IO thread to avoid synchronization issues. (Closed)

Created:
8 years, 6 months ago by Sheridan Rawlins
Modified:
8 years, 6 months ago
Reviewers:
tony, Evan Stade
CC:
chromium-reviews, Joao da Silva
Visibility:
Public.

Description

Do the ReloadLocaleResources() call on the IO thread to avoid synchronization issues. Followup to https://chromiumcodereview.appspot.com/10543015/ Forced the Reload on the same thread (IO) that was racing with the call. Since Tony doesn't want us to add synchronization to ResourceBundle from a case that's only exercised in test, we'll go this route to stop the race. R=tony@chromium.org, estade@chromium.org BUG=95425 TEST=browser_tests --gtest_filter=WebUIBidiCheckerBrowserTestRTL.*TestSettingsFrameStartup --gtest_also_run_disabled_tests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=141964

Patch Set 1 #

Total comments: 2

Patch Set 2 : Created ui_test_util for WaitEventSignaled to run the idle tasks until signaled. Used ScopedAllowIO. #

Patch Set 3 : Remove ui_test_utils:: for call within same namespace. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -2 lines) Patch
M chrome/browser/ui/webui/bidi_checker_web_ui_test.h View 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/bidi_checker_web_ui_test.cc View 1 4 chunks +25 lines, -2 lines 2 comments Download
M chrome/test/base/ui_test_utils.h View 1 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/test/base/ui_test_utils.cc View 1 2 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Sheridan Rawlins
8 years, 6 months ago (2012-06-13 00:58:38 UTC) #1
tony
Clever, this seems like it should work since the UI thread won't be accessing ResourceBundle. ...
8 years, 6 months ago (2012-06-13 16:38:15 UTC) #2
Sheridan Rawlins
https://chromiumcodereview.appspot.com/10546139/diff/1/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc File chrome/browser/ui/webui/bidi_checker_web_ui_test.cc (right): https://chromiumcodereview.appspot.com/10546139/diff/1/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc#newcode80 chrome/browser/ui/webui/bidi_checker_web_ui_test.cc:80: base::ThreadRestrictions::SetIOAllowed(false); On 2012/06/13 16:38:15, tony wrote: > Nit: Can ...
8 years, 6 months ago (2012-06-13 20:10:34 UTC) #3
tony
New patch LGTM.
8 years, 6 months ago (2012-06-13 20:14:34 UTC) #4
Evan Stade
lgtm
8 years, 6 months ago (2012-06-13 20:47:21 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/scr@chromium.org/10546139/12001
8 years, 6 months ago (2012-06-13 20:51:58 UTC) #6
commit-bot: I haz the power
Presubmit check for 10546139-12001 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 6 months ago (2012-06-13 20:52:00 UTC) #7
Joao da Silva
http://codereview.chromium.org/10546139/diff/12001/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc File chrome/browser/ui/webui/bidi_checker_web_ui_test.cc (right): http://codereview.chromium.org/10546139/diff/12001/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc#newcode105 chrome/browser/ui/webui/bidi_checker_web_ui_test.cc:105: ui_test_utils::WaitEventSignaled(&event); Why not PostTaskAndReply to IO? The posted task ...
8 years, 6 months ago (2012-06-13 22:09:16 UTC) #8
Sheridan Rawlins
8 years, 6 months ago (2012-06-15 00:36:23 UTC) #9
http://codereview.chromium.org/10546139/diff/12001/chrome/browser/ui/webui/bi...
File chrome/browser/ui/webui/bidi_checker_web_ui_test.cc (right):

http://codereview.chromium.org/10546139/diff/12001/chrome/browser/ui/webui/bi...
chrome/browser/ui/webui/bidi_checker_web_ui_test.cc:105:
ui_test_utils::WaitEventSignaled(&event);
This was already committed, but I'll try this on a followup.

On 2012/06/13 22:09:16, Joao da Silva wrote:
> Why not PostTaskAndReply to IO? The posted task does the SetUpOnIOThread, and
> the reply is MessageLoop::QuitClosure. Then call Run() on the current loop (or
> maybe ui_test_utils::RunMessageLoop()). The reply task will make that return.

Powered by Google App Engine
This is Rietveld 408576698