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

Issue 7669045: Make ChromotingHost::ui_strings() immutable. (Closed)

Created:
9 years, 4 months ago by Sergey Ulanov
Modified:
9 years, 4 months ago
Reviewers:
Jamie
CC:
chromium-reviews, jamiewalch+watch_chromium.org, hclam+watch_chromium.org, simonmorris+watch_chromium.org, wez+watch_chromium.org, dmaclach+watch_chromium.org, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, ajwong+watch_chromium.org, sergeyu+watch_chromium.org
Visibility:
Public.

Description

Make ChromotingHost::ui_strings() immutable. Use string16 for localized strings. There were two issues: - ui_strings() were mutable which creates possibility for race condition. Made it immutable, and added SetUiString() which can be called only before session is started. - strings were loaded after host is started which sometimes leads to non-localized string being shown. Particularly I often saw empty text on Disconnect button. BUG=None TEST=Disconnect button text is always localized. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=97376

Patch Set 1 #

Total comments: 4

Patch Set 2 : string16 #

Patch Set 3 : - #

Total comments: 1

Patch Set 4 : - #

Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -68 lines) Patch
M remoting/host/chromoting_host.h View 1 chunk +4 lines, -1 line 0 comments Download
M remoting/host/chromoting_host.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M remoting/host/continue_window_linux.cc View 1 4 chunks +10 lines, -6 lines 0 comments Download
M remoting/host/disconnect_window.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M remoting/host/disconnect_window_linux.cc View 1 4 chunks +12 lines, -7 lines 0 comments Download
M remoting/host/plugin/host_script_object.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M remoting/host/plugin/host_script_object.cc View 1 6 chunks +24 lines, -28 lines 0 comments Download
M remoting/host/ui_strings.h View 1 2 2 chunks +8 lines, -11 lines 0 comments Download
M remoting/host/ui_strings.cc View 1 2 3 1 chunk +12 lines, -10 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Sergey Ulanov
9 years, 4 months ago (2011-08-18 01:36:32 UTC) #1
Jamie
Your first point is fine, but for the second, please see my comment about not ...
9 years, 4 months ago (2011-08-18 16:28:41 UTC) #2
Sergey Ulanov
I changed DisconnectWindow to substitute username. I believe that UiStrings should not contain any substitutions, ...
9 years, 4 months ago (2011-08-18 18:04:32 UTC) #3
Jamie
LGTM, but please remove the comment I've flagged. http://codereview.chromium.org/7669045/diff/4005/remoting/host/ui_strings.cc File remoting/host/ui_strings.cc (right): http://codereview.chromium.org/7669045/diff/4005/remoting/host/ui_strings.cc#newcode15 remoting/host/ui_strings.cc:15: // ...
9 years, 4 months ago (2011-08-18 18:44:26 UTC) #4
Jamie
9 years, 4 months ago (2011-08-18 18:46:57 UTC) #5
On 2011/08/18 18:04:32, sergeyu wrote:
> I changed DisconnectWindow to substitute username. I believe that UiStrings
> should not contain any substitutions, otherwise, in the future, it will be
hard
> to keep track of what needs to be substituted and when.

I agree with you in principle, but I think it's too restrictive. It's really
just a specific case of a more general problem caused by the fact that the
messages are defined in one file and referenced in another, with equivalent of a
linker to check that they match up. I'm going to submit a CL the addresses part
of this, but it won't solve substitution issues.

Powered by Google App Engine
This is Rietveld 408576698