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

Issue 18248: CommandLine API rework (Closed)

Created:
11 years, 11 months ago by Evan Martin
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Make CommandLine into a normal object, with some statics for getting at the current process's command line. One explicit goal of this change is to *not* deal with the string/wstring issues at the API on POSIX; the functions are the same as before, which means they remain as broken as before. (I did try to fix the internals, though, so migrating the callers is now possible by adding platform-appropriate hooks.)

Patch Set 1 #

Patch Set 2 : rewrite #

Patch Set 3 : all builds on linux #

Total comments: 6

Patch Set 4 : ready to go #

Total comments: 16

Patch Set 5 : works on windows #

Total comments: 4

Patch Set 6 : rebased on trunk #

Patch Set 7 : with bugs fixed #

Total comments: 2

Patch Set 8 : fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+714 lines, -745 lines) Patch
M base/command_line.h View 1 2 3 4 5 6 3 chunks +100 lines, -59 lines 0 comments Download
M base/command_line.cc View 2 3 4 5 6 7 3 chunks +223 lines, -245 lines 0 comments Download
M base/command_line_unittest.cc View 2 3 4 5 6 7 chunks +29 lines, -44 lines 0 comments Download
M base/logging.cc View 1 chunk +2 lines, -1 line 0 comments Download
M base/multiprocess_test.h View 2 chunks +12 lines, -19 lines 0 comments Download
M base/perf_test_suite.h View 3 1 chunk +2 lines, -1 line 0 comments Download
M base/process_util.h View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M base/process_util_linux.cc View 1 2 3 chunks +5 lines, -4 lines 0 comments Download
M base/test_suite.h View 2 3 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/app/breakpad.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/app/chrome_dll_main.cc View 4 5 1 chunk +5 lines, -3 lines 0 comments Download
M chrome/app/chrome_exe_main.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/chrome_main_uitest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/browser.cc View 4 5 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/browser_init.cc View 4 5 6 4 chunks +24 lines, -26 lines 0 comments Download
M chrome/browser/browser_main.cc View 4 5 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/browser_process_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/browser_process_impl.cc View 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/browsing_instance.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/chrome_plugin_host.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/debugger/debugger_contents.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/first_run.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/first_run.cc View 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/images_uitest.cc View 5 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/locale_tests_uitest.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/net/chrome_url_request_context.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/plugin_process_host.cc View 4 5 6 4 chunks +21 lines, -21 lines 0 comments Download
M chrome/browser/printing/printing_layout_uitest.cc View 2 chunks +2 lines, -5 lines 0 comments Download
M chrome/browser/render_view_context_menu_controller.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/render_view_host_manager.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/render_widget_host_view_win.cc View 4 5 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/browser_render_process_host.cc View 8 chunks +20 lines, -23 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_database.cc View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_database_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/search_engines/template_url_prepopulate_data.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/sessions/session_restore_uitest.cc View 4 chunks +7 lines, -9 lines 0 comments Download
M chrome/browser/tab_contents/web_contents.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/unload_uitest.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/user_data_manager.cc View 1 chunk +4 lines, -5 lines 0 comments Download
M chrome/browser/views/frame/browser_view.cc View 4 5 1 chunk +3 lines, -1 line 0 comments Download
M chrome/common/child_process.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/chrome_paths.cc View 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/common/chrome_plugin_lib.cc View 4 5 1 chunk +1 line, -2 lines 0 comments Download
M chrome/common/chrome_plugin_util.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/common/common_glue.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/debug_flags.h View 2 chunks +10 lines, -8 lines 0 comments Download
M chrome/common/debug_flags.cc View 3 chunks +7 lines, -10 lines 0 comments Download
M chrome/common/ipc_channel_posix.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/common/ipc_logging.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/ipc_tests.cc View 3 4 3 chunks +7 lines, -4 lines 0 comments Download
M chrome/common/l10n_util.cc View 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/logging_chrome_uitest.cc View 4 3 chunks +3 lines, -6 lines 0 comments Download
M chrome/common/main_function_params.h View 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/common/pref_service_uitest.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/common/temp_scaffolding_stubs.h View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/common/temp_scaffolding_stubs.cpp View 1 chunk +1 line, -1 line 0 comments Download
M chrome/installer/setup/main.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/installer/setup/setup.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/plugin/plugin_main.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/plugin/webplugin_delegate_stub.cc View 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/render_process.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/render_view.cc View 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/renderer/renderer_glue.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/renderer_main.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/automated_ui_tests/automated_ui_tests.cc View 5 6 chunks +6 lines, -6 lines 0 comments Download
M chrome/test/automation/automation_proxy_uitest.cc View 4 5 3 chunks +7 lines, -5 lines 0 comments Download
M chrome/test/memory_test/memory_test.cc View 4 5 2 chunks +7 lines, -8 lines 0 comments Download
M chrome/test/page_cycler/page_cycler_test.cc View 5 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/test/plugin/plugin_test.cpp View 1 chunk +5 lines, -16 lines 0 comments Download
M chrome/test/reliability/reliability_test_suite.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/startup/startup_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/ui/inspector_controller_uitest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/ui/omnibox_uitest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/test/ui/sandbox_uitests.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/test/ui/ui_test.h View 4 5 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/test/ui/ui_test.cc View 3 4 5 6 7 chunks +48 lines, -46 lines 0 comments Download
M chrome/test/ui/ui_test_suite.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/unit/chrome_test_suite.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/tools/test/image_diff/image_diff.cc View 4 2 chunks +8 lines, -14 lines 0 comments Download
M chrome/views/window.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/disk_cache/stress_cache.cc View 1 2 1 chunk +2 lines, -8 lines 0 comments Download
M net/tools/crash_cache/crash_cache.cc View 1 2 1 chunk +2 lines, -8 lines 0 comments Download
M net/tools/tld_cleanup/tld_cleanup.cc View 1 chunk +1 line, -3 lines 0 comments Download
M net/url_request/url_request_http_job.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M net/url_request/url_request_unittest.h View 1 chunk +3 lines, -1 line 0 comments Download
M skia/ext/vector_canvas_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M webkit/activex_shim/activex_shared.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M webkit/glue/plugins/plugin_list_win.cc View 5 6 1 chunk +1 line, -1 line 0 comments Download
M webkit/tools/test_shell/mac/main.mm View 3 chunks +7 lines, -9 lines 0 comments Download
M webkit/tools/test_shell/node_leak_test.cc View 3 chunks +6 lines, -6 lines 0 comments Download
M webkit/tools/test_shell/run_all_tests.cc View 1 chunk +2 lines, -4 lines 0 comments Download
M webkit/tools/test_shell/test_shell.cc View 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M webkit/tools/test_shell/test_shell_main.cc View 3 4 5 6 2 chunks +9 lines, -10 lines 0 comments Download
M webkit/tools/test_shell/test_shell_win.cc View 4 5 6 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 24 (0 generated)
Evan Martin
11 years, 11 months ago (2009-01-14 23:16:05 UTC) #1
Evan Stade
I don't understand why there can't be both (a) a global CommandLine object that represents ...
11 years, 11 months ago (2009-01-14 23:33:29 UTC) #2
Evan Martin
On 2009/01/14 23:33:29, Evan Stade wrote: > I don't understand why there can't be both ...
11 years, 11 months ago (2009-01-15 00:09:06 UTC) #3
Evan Stade
On 2009/01/15 00:09:06, Evan Martin wrote: > On 2009/01/14 23:33:29, Evan Stade wrote: > > ...
11 years, 11 months ago (2009-01-15 00:10:59 UTC) #4
Evan Stade
It looks like the only place the non-default constructors are used is the command line ...
11 years, 11 months ago (2009-01-15 00:55:37 UTC) #5
Evan Stade
(there are actually a couple places the non-default constructors are used: browser_init.cc, shell_integration.cc. Either these ...
11 years, 11 months ago (2009-01-15 01:00:25 UTC) #6
rvargas (doing something else)
I'm also missing what's the problem with using one of the constructors that has arguments. ...
11 years, 11 months ago (2009-01-15 01:01:38 UTC) #7
Evan Martin
On 2009/01/15 01:01:38, rvargas wrote: > I'm also missing what's the problem with using one ...
11 years, 11 months ago (2009-01-15 01:22:59 UTC) #8
rvargas (doing something else)
On 2009/01/15 01:22:59, Evan Martin wrote: > On 2009/01/15 01:01:38, rvargas wrote: > > I'm ...
11 years, 11 months ago (2009-01-15 01:28:25 UTC) #9
Evan Martin
Ok, here's something that builds on Linux. Gonna do the work on Windows too now, ...
11 years, 11 months ago (2009-01-15 22:51:44 UTC) #10
Evan Martin
updated with a better description of what i tried to do
11 years, 11 months ago (2009-01-15 22:59:00 UTC) #11
darin (slow to review)
http://codereview.chromium.org/18248/diff/29/31 File base/command_line.h (right): http://codereview.chromium.org/18248/diff/29/31#newcode44 Line 44: CommandLine(const std::wstring& program); doesn't this signature overlap with ...
11 years, 11 months ago (2009-01-15 23:04:25 UTC) #12
Evan Martin
http://codereview.chromium.org/18248/diff/29/31 File base/command_line.h (right): http://codereview.chromium.org/18248/diff/29/31#newcode44 Line 44: CommandLine(const std::wstring& program); On 2009/01/15 23:04:25, darin wrote: ...
11 years, 11 months ago (2009-01-15 23:10:14 UTC) #13
darin (slow to review)
http://codereview.chromium.org/18248/diff/29/31 File base/command_line.h (right): http://codereview.chromium.org/18248/diff/29/31#newcode50 Line 50: static void Init(int argc, const char* const* argv); ...
11 years, 11 months ago (2009-01-15 23:17:08 UTC) #14
Evan Martin
btw, it looks like i nuked command_line.cc because i reindented some functions, sorry. :( http://codereview.chromium.org/18248/diff/29/31 ...
11 years, 11 months ago (2009-01-15 23:31:17 UTC) #15
Evan Martin
Ok, this basically works on all platforms, and I've re-uploaded with a merge against trunk, ...
11 years, 11 months ago (2009-01-16 02:33:54 UTC) #16
Evan Stade
mainly just nits. LG for the most part http://codereview.chromium.org/18248/diff/246/247 File base/command_line.cc (right): http://codereview.chromium.org/18248/diff/246/247#newcode173 Line 173: ...
11 years, 11 months ago (2009-01-16 18:05:12 UTC) #17
Evan Martin
trybots pass this on mac and linux, and it was working for me on windows ...
11 years, 11 months ago (2009-01-16 23:47:24 UTC) #18
Evan Stade
I'm confused by AppendArguments(). It seems you only want it to be used with CommandLine ...
11 years, 11 months ago (2009-01-17 00:45:38 UTC) #19
Evan Martin
Ok, now passes ui tests on windows. I think this one is ready to commit, ...
11 years, 11 months ago (2009-01-20 23:58:50 UTC) #20
Evan Stade
http://codereview.chromium.org/18248/diff/335/1147 File base/command_line.cc (right): http://codereview.chromium.org/18248/diff/335/1147#newcode325 Line 325: bool include_program) { why don't you DCHECK() here ...
11 years, 11 months ago (2009-01-21 00:18:21 UTC) #21
agl
LGTM
11 years, 11 months ago (2009-01-21 00:28:46 UTC) #22
Evan Martin
estade: fixed
11 years, 11 months ago (2009-01-21 00:32:31 UTC) #23
Evan Stade
11 years, 11 months ago (2009-01-21 00:33:49 UTC) #24
LGTM

Powered by Google App Engine
This is Rietveld 408576698