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

Issue 479703004: Ensure syncer::internal::GetComputerName returns a UTF-8 string. (Closed)

Created:
6 years, 3 months ago by maniscalco
Modified:
6 years, 3 months ago
Reviewers:
Nicolas Zea
CC:
chromium-reviews, tim+watch_chromium.org, haitaol+watch_chromium.org, zea+watch_chromium.org, maniscalco+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Ensure syncer::internal::GetComputerName returns a UTF-8 string. Prior to this change, on Windows, GetComputerName resulted in a call to GetComputerNameA, which returns an ANSI string (not ASCII, not UTF-8). Call GetComputerNameW instead and convert the returned wide string to UTF-8. Tested by adding U+00AB to the computer name. Saw in about:sync the name contained a U+FFFD instead (symbol for unrepresentable character). Performed sync dashboard clear, applied patch, saw that the name correctly contained U+00AB. This CL does not address corrupted device info that's already in the field. Depending on impact that may be addressed in a future CL. BUG=406470 Committed: https://crrev.com/58cfacd2313c2a67aa52e02f1eccc352df427502 Cr-Commit-Position: refs/heads/master@{#292466}

Patch Set 1 #

Patch Set 2 : Get things compiling. #

Patch Set 3 : Use the returned size instead of wcslen(). #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -4 lines) Patch
M sync/util/get_session_name.h View 1 chunk +1 line, -0 lines 0 comments Download
M sync/util/get_session_name.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M sync/util/get_session_name_win.cc View 1 2 1 chunk +12 lines, -4 lines 2 comments Download

Messages

Total messages: 9 (0 generated)
maniscalco
maniscalco@chromium.org changed reviewers: + zea@chromium.org
6 years, 3 months ago (2014-08-28 17:23:00 UTC) #1
maniscalco
Nicolas, would you please review this change?
6 years, 3 months ago (2014-08-28 17:23:58 UTC) #2
Nicolas Zea
lgtm https://codereview.chromium.org/479703004/diff/40001/sync/util/get_session_name_win.cc File sync/util/get_session_name_win.cc (right): https://codereview.chromium.org/479703004/diff/40001/sync/util/get_session_name_win.cc#newcode7 sync/util/get_session_name_win.cc:7: #include "base/logging.h" nit: can remove this?
6 years, 3 months ago (2014-08-28 18:58:29 UTC) #3
maniscalco
Thanks for the speedy review. https://codereview.chromium.org/479703004/diff/40001/sync/util/get_session_name_win.cc File sync/util/get_session_name_win.cc (right): https://codereview.chromium.org/479703004/diff/40001/sync/util/get_session_name_win.cc#newcode7 sync/util/get_session_name_win.cc:7: #include "base/logging.h" On 2014/08/28 ...
6 years, 3 months ago (2014-08-28 19:10:59 UTC) #4
maniscalco
The CQ bit was checked by maniscalco@chromium.org
6 years, 3 months ago (2014-08-28 20:12:50 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/maniscalco@chromium.org/479703004/40001
6 years, 3 months ago (2014-08-28 20:13:55 UTC) #6
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_chromium_compile_dbg on tryserver.chromium.win ...
6 years, 3 months ago (2014-08-28 20:53:53 UTC) #7
commit-bot: I haz the power
Committed patchset #3 (id:40001) as 91f7e9e15dd013ba94515d8c5d48ca15ecff1b7a
6 years, 3 months ago (2014-08-28 21:38:57 UTC) #8
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 03:02:23 UTC) #9
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/58cfacd2313c2a67aa52e02f1eccc352df427502
Cr-Commit-Position: refs/heads/master@{#292466}

Powered by Google App Engine
This is Rietveld 408576698