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

Issue 10449042: Remove wchar/wstring version of StringPrintf. (Closed)

Created:
8 years, 6 months ago by Hao Zheng
Modified:
4 years, 4 months ago
CC:
chromium-reviews, jochen+watch-content_chromium.org, ncarter (slow), mihaip-chromium-reviews_chromium.org, akalin, Raghu Simha, erikwright (departed), jam, MAD, joi+watch-content_chromium.org, Aaron Boodman, darin-cc_chromium.org, jshin+watch_chromium.org, brettw-cc_chromium.org, Ilya Sherman, tim (not reviewing), jar (doing other things)
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Remove wchar/wstring version of StringPrintf. None of actual usage of StringPrintf(wchar_t*) requires wchar support. All of them can be replaced by char version of StringPrintf, with conversion to wstring by ASCIIToWide(). The original intent of this CL is because Android doesn't support wide characters. But Android suppplies a header wchar.h without a real implementation, which makes code compile on Android. 4 base_unittests fail on Android. BUG=23581 TEST=GeolocationWifiDataProviderCommonTest.MacAddressString

Patch Set 1 #

Patch Set 2 : 'fix clang errors' #

Total comments: 2

Patch Set 3 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -182 lines) Patch
M base/stringprintf.h View 2 chunks +0 lines, -12 lines 0 comments Download
M base/stringprintf.cc View 1 2 5 chunks +5 lines, -43 lines 1 comment Download
M base/stringprintf_unittest.cc View 3 chunks +0 lines, -43 lines 0 comments Download
M build/android/gtest_filter/base_unittests_disabled View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/browser_keyevents_browsertest.cc View 1 12 chunks +45 lines, -43 lines 0 comments Download
M chrome/browser/diagnostics/diagnostics_main.cc View 3 chunks +11 lines, -11 lines 0 comments Download
M chrome/browser/extensions/extension_devtools_browsertests.cc View 4 chunks +7 lines, -6 lines 0 comments Download
M chrome/browser/sync/test/integration/bookmarks_helper.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/sync/test/integration/multiple_client_bookmarks_sync_test.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/common/metrics/experiments_helper.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/geolocation/wifi_data_provider_common.cc View 1 chunk +9 lines, -9 lines 0 comments Download
M content/browser/geolocation/wifi_data_provider_common_unittest.cc View 1 1 chunk +7 lines, -0 lines 0 comments Download
M ui/gl/gl_implementation_win.cc View 1 2 chunks +5 lines, -4 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Hao Zheng
8 years, 6 months ago (2012-05-28 11:48:32 UTC) #1
Hao Zheng
Fixed some clang errors. Now linux and mac trybots are green. win depends on rlz ...
8 years, 6 months ago (2012-05-28 13:19:44 UTC) #2
jar (doing other things)
https://chromiumcodereview.appspot.com/10449042/diff/11001/base/stringprintf.cc File base/stringprintf.cc (right): https://chromiumcodereview.appspot.com/10449042/diff/11001/base/stringprintf.cc#newcode16 base/stringprintf.cc:16: // Overloaded wrapper around vsnprintf. The buf_size parameter nit: ...
8 years, 6 months ago (2012-05-28 16:00:47 UTC) #3
not at google - send to devlin
Hi, what would you like me to review?
8 years, 6 months ago (2012-05-29 00:08:57 UTC) #4
Hao Zheng
Maybe chrome/browser/extensions/ ? Presubmit check suggested me to add you :) ** Presubmit Messages ** ...
8 years, 6 months ago (2012-05-29 02:27:05 UTC) #5
not at google - send to devlin
extensions lgtm However, you shouldn't need OWNERS for chrome/browser/extensions. I will file a bug on ...
8 years, 6 months ago (2012-05-29 02:48:53 UTC) #6
Aaron Boodman
On Mon, May 28, 2012 at 7:48 PM, <kalman@chromium.org> wrote: > extensions lgtm > > ...
8 years, 6 months ago (2012-05-29 03:04:58 UTC) #7
not at google - send to devlin
On 2012/05/29 03:04:58, Aaron Boodman wrote: > On Mon, May 28, 2012 at 7:48 PM, ...
8 years, 6 months ago (2012-05-29 03:15:36 UTC) #8
Aaron Boodman
On Mon, May 28, 2012 at 8:15 PM, <kalman@chromium.org> wrote: > On 2012/05/29 03:04:58, Aaron ...
8 years, 6 months ago (2012-05-29 03:29:14 UTC) #9
Hao Zheng
BTW, rlz CL is at http://codereview.appspot.com/6247057/ . https://chromiumcodereview.appspot.com/10449042/diff/11001/base/stringprintf.cc File base/stringprintf.cc (right): https://chromiumcodereview.appspot.com/10449042/diff/11001/base/stringprintf.cc#newcode16 base/stringprintf.cc:16: // Overloaded ...
8 years, 6 months ago (2012-05-29 08:48:11 UTC) #10
Evan Martin
perhaps bug=23581 https://code.google.com/p/chromium/issues/detail?id=23581
8 years, 6 months ago (2012-05-29 17:07:28 UTC) #11
Hao Zheng
On 2012/05/29 17:07:28, Evan Martin wrote: > perhaps bug=23581 > > https://code.google.com/p/chromium/issues/detail?id=23581 Done. Thanks for ...
8 years, 6 months ago (2012-05-30 02:49:15 UTC) #12
brettw
If it's not too out-of-control (I don't actually know how many places it's used) we're ...
8 years, 6 months ago (2012-05-31 23:53:13 UTC) #13
Hao Zheng
On 2012/05/31 23:53:13, brettw wrote: > If it's not too out-of-control (I don't actually know ...
8 years, 6 months ago (2012-06-01 05:41:08 UTC) #14
brettw
Just one comment: https://chromiumcodereview.appspot.com/10449042/diff/11003/base/stringprintf.cc File base/stringprintf.cc (right): https://chromiumcodereview.appspot.com/10449042/diff/11003/base/stringprintf.cc#newcode21 base/stringprintf.cc:21: inline int vsnprintfT(char* buffer, I think ...
8 years, 6 months ago (2012-06-01 19:27:13 UTC) #15
Hao Zheng
8 years, 6 months ago (2012-06-04 06:35:24 UTC) #16
Reviewers,
Sorry, I have overlooked its use on Windows until trying the Cl on trybot. Did a
grep and found about 60 more uses on Windows only. Most of them are applied to
'%d' or '%x', which could be easily converted to the char version. But there are
still 15 places which look like they need to be wchar* indeed, as they are
dealing with file path, e.g. chrome/installer/util/l10n_string_util.cc.

As Mac/Linux/Android works with the current patch, I'd like to hear your comment
on the following 2 choices:
1. Continue to fix all Windows uses, and replace wide printf with string
concatenation (+)?
2. Make wide printf a Windoes only API?

Powered by Google App Engine
This is Rietveld 408576698