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

Issue 595803002: base::CommandLine: Added optional quoting of placeholder arguments. (Closed)

Created:
6 years, 2 months ago by Matt Giuca
Modified:
6 years, 2 months ago
Reviewers:
Mark Mentovai, msw
CC:
chromium-reviews, erikwright+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

base::CommandLine: Added optional quoting of placeholder arguments. Added an optional parameter |quote_placeholder| to GetCommandLineString and GetArgumentsString. If true, placeholder command-line arguments such as "%1" will also be quoted. These need quoting in case the substituted argument has a space in it. It was previously not possible to build a CommandLine that would contain a quoted "%1" when converted to a string. Only affects Windows. BUG=416785 Committed: https://crrev.com/c974d5100e52cdbc33c0d687f80498f34b6f3e35 Cr-Commit-Position: refs/heads/master@{#297617}

Patch Set 1 #

Patch Set 2 : Revert default behaviour; add optional argument to quote placeholder. #

Total comments: 2

Patch Set 3 : Split into two separate methods. #

Total comments: 2

Patch Set 4 : Added a stern warning in the comments about using these methods. #

Patch Set 5 : Rebase off CL 602253006. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+118 lines, -49 lines) Patch
M base/command_line.h View 1 2 3 4 2 chunks +39 lines, -2 lines 0 comments Download
M base/command_line.cc View 1 2 3 4 3 chunks +54 lines, -45 lines 0 comments Download
M base/command_line_unittest.cc View 1 2 4 chunks +25 lines, -2 lines 0 comments Download

Messages

Total messages: 23 (5 generated)
Matt Giuca
msw: Author of code being changed. mark: OWNERS. Not 100% convinced this is a good ...
6 years, 2 months ago (2014-09-23 08:59:34 UTC) #2
Mark Mentovai
This a pretty error-prone area. What if the replacement string has a " character in ...
6 years, 2 months ago (2014-09-23 12:34:26 UTC) #3
Matt Giuca
The problem is that *we* (Chrome) aren't doing the replacing. I'm making a string like: ...
6 years, 2 months ago (2014-09-24 08:23:47 UTC) #4
Mark Mentovai
I’m not really comfortable with this, then. The quoting you’re doing makes sense for stuff ...
6 years, 2 months ago (2014-09-24 12:36:49 UTC) #5
Matt Giuca
On 2014/09/24 12:36:49, Mark Mentovai wrote: > I’m not really comfortable with this, then. The ...
6 years, 2 months ago (2014-09-25 00:19:40 UTC) #6
Matt Giuca
OK I did the change. Now all methods will continue behaving exactly as they were ...
6 years, 2 months ago (2014-09-25 01:19:25 UTC) #7
Mark Mentovai
I'm sure there are some cases where a command has a directory path parameter. It's ...
6 years, 2 months ago (2014-09-25 02:34:41 UTC) #8
Mark Mentovai
I don't think we should do this with a boolean, it should be it's own ...
6 years, 2 months ago (2014-09-25 02:36:58 UTC) #9
Mark Mentovai
Trying to give you fast turnaround because I know our workdays don’t really coincide very ...
6 years, 2 months ago (2014-09-25 03:40:44 UTC) #10
Matt Giuca
OK fair enough. (Although I dislike having to move two medium-sized methods and be the ...
6 years, 2 months ago (2014-09-25 04:35:30 UTC) #12
Mark Mentovai
LGTM otherwise https://codereview.chromium.org/595803002/diff/60001/base/command_line.h File base/command_line.h (right): https://codereview.chromium.org/595803002/diff/60001/base/command_line.h#newcode107 base/command_line.h:107: // argument with a '%' in it. ...
6 years, 2 months ago (2014-09-25 13:14:16 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/595803002/80001
6 years, 2 months ago (2014-09-26 03:42:25 UTC) #15
Matt Giuca
https://codereview.chromium.org/595803002/diff/60001/base/command_line.h File base/command_line.h (right): https://codereview.chromium.org/595803002/diff/60001/base/command_line.h#newcode107 base/command_line.h:107: // argument with a '%' in it. On 2014/09/25 ...
6 years, 2 months ago (2014-09-26 03:49:05 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/13695)
6 years, 2 months ago (2014-09-26 03:50:42 UTC) #18
Matt Giuca
Ugh, presubmit warnings preventing submit. Path of least resistance is just to fix them: https://codereview.chromium.org/602253006/
6 years, 2 months ago (2014-09-30 00:56:35 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/595803002/100001
6 years, 2 months ago (2014-10-01 08:22:28 UTC) #21
commit-bot: I haz the power
Committed patchset #5 (id:100001) as 3c3ea9125d277c8bfff66e581b4291749339583e
6 years, 2 months ago (2014-10-01 09:24:58 UTC) #22
commit-bot: I haz the power
6 years, 2 months ago (2014-10-01 09:25:32 UTC) #23
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/c974d5100e52cdbc33c0d687f80498f34b6f3e35
Cr-Commit-Position: refs/heads/master@{#297617}

Powered by Google App Engine
This is Rietveld 408576698