summaryrefslogtreecommitdiffstats
path: root/base/command_line.cc
Commit message (Collapse)AuthorAgeFilesLines
* Switch to standard integer types in base/.avi2015-12-261-1/+1
| | | | | | | | | | BUG=138542 TBR=mark@chromium.org NOPRESUBMIT=true Review URL: https://codereview.chromium.org/1538743002 Cr-Commit-Position: refs/heads/master@{#366910}
* base: get rid of deprecated TrimWhitespace() functiontfarina2015-12-061-0/+8
| | | | | | | | | | | This patch updates the callers to call TrimWhitespaceASCII() when possible. BUG=None R=brettw@chromium.org Review URL: https://codereview.chromium.org/1493503002 Cr-Commit-Position: refs/heads/master@{#363369}
* Replace ToLower calls to the new formatbrettw2015-08-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces base::StringToLowerASCII(string) with base::ToLowerASCII(string) This form is 1:1 search and replace. A bunch of places did something like this: std::string foo(something_else); base::StringToLowerASCII(&foo); which became: foo = base::ToLowerASCII(something_else); A couple places really wanted in-place changing and they became: foo = base::ToLowerASCII(foo); There was pretty trivial cleanup in chrome_main_delegate.cc chrome/test/chromedriver/server/http_handler.cc (fix indenting). There was more cleanup in: chrome/installer/util/language_selector.cc and components/plugins/renderer/mobile_youtube_plugin.cc In components/history/core/browser/url_utils.cc I removed the call since it was calling ToLower on the host name out of a GURL, which is already guaranteed to be lower-case. NOPRESUBMIT=true (due to touching code with wstrings) Review URL: https://codereview.chromium.org/1279123004 Cr-Commit-Position: refs/heads/master@{#342659}
* Update SplitString calls to new formbrettw2015-08-081-2/+3
| | | | | | | | | | | | Uses the new form for most (but not quite all) of the remaining users of the old form. Reland of https://codereview.chromium.org/1272823003 but with no changes to the way media parses codec lists. The previous landing attempted to simplify some handling but there are layout tests that expect the old behavior, and I'm not qualified to tell if it's OK to change. TBR=sky Review URL: https://codereview.chromium.org/1274123003 Cr-Commit-Position: refs/heads/master@{#342489}
* Revert of Update SplitString calls to new form (patchset #5 id:80001 of ↵pkasting2015-08-071-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1272823003/ ) Reason for revert: Caused Blink layout test failures in media/encrypted-media/encrypted-media-requestmediakeysystemaccess.html : http://test-results.appspot.com/dashboards/flakiness_dashboard.html#showExpectations=true&tests=media%2Fencrypted-media%2Fencrypted-media-requestmediakeysystemaccess.html Original issue's description: > Update SplitString calls to new form > > Uses the new form for most (but not quite all) of the remaining users of the old form. > > Changes media mime util codec list parsing to expect no result from the string "," rather than two empty strings. The old SplitString call had a special case where if the input was empty, it would return empty, but if it had one split character, it would return two empty strings as results. > > The new one lets you choose but the options are either (1) empty string -> one empty string and "," -> two empty strings, or (2) map both to no results for when you don't want empty results. I'm pretty sure media codec parsing actually wants the latter behavior, so I updated the call to discard empty results and MimeUtilTest.ParseCodecString is updated. > > Committed: https://crrev.com/0aa7c64253cca8b636d52d1d01d94f96ab9c13fa > Cr-Commit-Position: refs/heads/master@{#342238} TBR=sky@chromium.org,dalecurtis@chromium.org,brettw@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1278973003 Cr-Commit-Position: refs/heads/master@{#342257}
* Update SplitString calls to new formbrettw2015-08-071-2/+3
| | | | | | | | | | | | Uses the new form for most (but not quite all) of the remaining users of the old form. Changes media mime util codec list parsing to expect no result from the string "," rather than two empty strings. The old SplitString call had a special case where if the input was empty, it would return empty, but if it had one split character, it would return two empty strings as results. The new one lets you choose but the options are either (1) empty string -> one empty string and "," -> two empty strings, or (2) map both to no results for when you don't want empty results. I'm pretty sure media codec parsing actually wants the latter behavior, so I updated the call to discard empty results and MimeUtilTest.ParseCodecString is updated. Review URL: https://codereview.chromium.org/1272823003 Cr-Commit-Position: refs/heads/master@{#342238}
* Take a StringPiece when looking up CommandLine switches.jackhou2015-05-211-26/+43
| | | | | | | | | | | | | | | | | | | | | | | | | This avoids the string allocation when searching for a char* in a std::map<std::string>. CommandLine now maintains a parallel map of StringPieces that reference the strings in |switches_|. StringPiece is trivial to construct from a string, and only requires a strlen to construct from a char*. On a profile with 2 extensions, HasSwitch is called ~12k times during startup. In an ideal situation (no paging/cache pressure), the string allocation under Windows takes ~137ns on a Xeon E5-2690 @ 2.9Ghz. A strlen on a typical switch takes about 50ns, and 91% of calls pass a char*, so there's a net saving of at least (137 - 0.9 * 50)ns * 12k = 1.1ms from a typical startup with this hardware. For context, Startup.BrowserMessageLoopStartTimeFromMainEntry is typically 280-300ms on the same hardware, so we should get a ~0.4% improvement. BUG=472383 Review URL: https://codereview.chromium.org/1063933002 Cr-Commit-Position: refs/heads/master@{#330902}
* Enforce lowercase switches when calling CommandLine::HasSwitch.jackhou2015-04-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | At the moment, all compile-time switches are lowercase. By enforcing this, we can skip converting it to lowercase on Windows, which saves one string allocation per call. On a profile with 2 extensions, HasSwitch is called ~12k times during startup. In an ideal situation (no paging/cache pressure), the string allocation under Windows takes ~137ns on an Xeon E5-2690 @ 2.9Ghz. So this should shave off at least 1.6ms off a typical startup with this hardware. For context, Startup.BrowserMessageLoopStartTimeFromMainEntry is typically 280-300ms on the same hardware, so we should get a ~0.5% improvement. BUG=472383 Committed: https://crrev.com/f58961749a980032241fe6c3fc829ac2e6652030 Cr-Commit-Position: refs/heads/master@{#325576} Review URL: https://codereview.chromium.org/1046363002 Cr-Commit-Position: refs/heads/master@{#326219}
* Revert of Enforce lowercase switches when calling ↵yoichio2015-04-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CommandLine::HasSwitch(const char*). (patchset #5 id:80001 of https://codereview.chromium.org/1046363002/) Reason for revert: This causes test fails on Android: https://build.chromium.org/p/chromium.linux/builders/Android%20Tests%20%28dbg%29/builds/27294 The test uses upper case with HasSwitch(): https://code.google.com/p/chromium/codesearch#chromium/src/content/public/android/javatests/src/org/chromium/content/browser/ContentCommandLineTest.java&q=testJavaNativeTransition&sq=package:chromium&type=cs&l=96 Original issue's description: > Enforce lowercase switches when calling CommandLine::HasSwitch. > > At the moment, all compile-time switches are lowercase. By enforcing > this, we can skip converting it to lowercase on Windows, which saves > one string allocation per call. > > On a profile with 2 extensions, HasSwitch is called ~12k times during > startup. In an ideal situation (no paging/cache pressure), the > string allocation under Windows takes ~137ns on an Xeon E5-2690 @ > 2.9Ghz. So this should shave off at least 1.6ms off a typical startup > with this hardware. For context, > Startup.BrowserMessageLoopStartTimeFromMainEntry is typically > 280-300ms on the same hardware, so we should get a ~0.5% improvement. > > BUG=472383 > > Committed: https://crrev.com/f58961749a980032241fe6c3fc829ac2e6652030 > Cr-Commit-Position: refs/heads/master@{#325576} TBR=tapted@chromium.org,brettw@chromium.org,jackhou@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=472383 Review URL: https://codereview.chromium.org/1091993002 Cr-Commit-Position: refs/heads/master@{#325610}
* Enforce lowercase switches when calling CommandLine::HasSwitch.jackhou2015-04-171-1/+2
| | | | | | | | | | | | | | | | | | | | At the moment, all compile-time switches are lowercase. By enforcing this, we can skip converting it to lowercase on Windows, which saves one string allocation per call. On a profile with 2 extensions, HasSwitch is called ~12k times during startup. In an ideal situation (no paging/cache pressure), the string allocation under Windows takes ~137ns on an Xeon E5-2690 @ 2.9Ghz. So this should shave off at least 1.6ms off a typical startup with this hardware. For context, Startup.BrowserMessageLoopStartTimeFromMainEntry is typically 280-300ms on the same hardware, so we should get a ~0.5% improvement. BUG=472383 Review URL: https://codereview.chromium.org/1046363002 Cr-Commit-Position: refs/heads/master@{#325576}
* Provide CommandLine::HasSwitch(const char*) to save 76kB in sizes perftapted2015-03-301-0/+4
| | | | | | | | | | | | | | | | | | | | Currently every callsite to CommandLine::HasSwitch() has to generate code to allocate a string on the stack, malloc(), copy characters from the switch constant, and then free things when it goes out of scope. Testing on a Mac release build, this results in about 76kB of generated object code. (about 40 bytes for each of the ~1928 calls in the non-test codebase). Adding a char[] overload allows this codegen to happen only once. And there's no lost inlining benefit since the new overload can inline its call instead. BUG=468184 Review URL: https://codereview.chromium.org/1007283012 Cr-Commit-Position: refs/heads/master@{#322737}
* base: Use more specific CHECK macros for comparisons.danakj2015-03-091-1/+1
| | | | | | | | | | | | | | | Prefer DCHECK_EQ(a, b) over DCHECK(a == b) when possible as this provides more data on a failure. Similar for other operators such as >=, <, !=, etc. This also applies to CHECK, EXPECT, and ASSERT macros. R=Nico BUG=464816 Review URL: https://codereview.chromium.org/985723003 Cr-Commit-Position: refs/heads/master@{#319751}
* Avoid a string copy for every CommandLine::HasSwitch queryjdduke2014-12-171-2/+4
| | | | | | | | | | | | | | | Windows performs a lower-case conversion of all strings passed to CommandLine::HasSwitch. Other platforms require no such conversion, however, currently they pay for an associated string copy on each query. Why? Because compilers aren't as smart as they should be. Remove this string copy for non-Windows platforms. A string copy saved is a string copy earned. BUG=405348 Review URL: https://codereview.chromium.org/815543002 Cr-Commit-Position: refs/heads/master@{#308839}
* Cleanup: Get rid of more base::ASCIIToWide usage.thestig2014-12-041-22/+20
| | | | | | | | | | Also do some lint cleanups. BUG=23581 Review URL: https://codereview.chromium.org/777623002 Cr-Commit-Position: refs/heads/master@{#306905}
* base::CommandLine: Added optional quoting of placeholder arguments.mgiuca2014-10-011-45/+54
| | | | | | | | | | | | | | | | 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 Review URL: https://codereview.chromium.org/595803002 Cr-Commit-Position: refs/heads/master@{#297617}
* base::CommandLine: Replace use of wstring with string16.mgiuca2014-10-011-6/+6
| | | | | | | | | | | | | | wstring is deprecated in Chromium. Since all the code in CommandLine using wstring is Windows-only, string16 is equivalent. This change is necessary to avoid a presubmit warning when touching the CommandLine code. BUG=416785 Review URL: https://codereview.chromium.org/602253006 Cr-Commit-Position: refs/heads/master@{#297608}
* Move StringToLowerASCII to base namespacebrettw@chromium.org2014-08-071-1/+1
| | | | | | | | TBR=sky Review URL: https://codereview.chromium.org/448853002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288085 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 257524 "Move IsStringASCII/UTF8 to base namespace."brettw@chromium.org2014-03-171-3/+3
| | | | | | | | | | | | | | | | > Move IsStringASCII/UTF8 to base namespace. > > Use StringPiece for IsStringUTF8. > > TBR=sky > > Review URL: https://codereview.chromium.org/196793010 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/198163004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257533 0039d316-1c4b-4281-b951-d872f2087c98
* Move IsStringASCII/UTF8 to base namespace.brettw@chromium.org2014-03-171-3/+3
| | | | | | | | | | Use StringPiece for IsStringUTF8. TBR=sky Review URL: https://codereview.chromium.org/196793010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257524 0039d316-1c4b-4281-b951-d872f2087c98
* Move CommandLine to base namespace.brettw@chromium.org2014-03-171-11/+14
| | | | | | | | | | | | Fix all forward-declares and header files referencing CommandLine. This keeps a "using base::CommandLine" in the command line header file so that the rest of the source files can be changes in a follow-up. TBR=sky Review URL: https://codereview.chromium.org/196413016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257514 0039d316-1c4b-4281-b951-d872f2087c98
* Move UTF16ToASCII, remove WideToASCII.brettw@chromium.org2014-03-141-2/+3
| | | | | | | | | | | | | | | | This removes WideToASCII and changes all callers to use UTF16ToASCII instead. Moves UTF16ToASCII from base/strings/string_util.h to base/strings/utf_string_conversions.h and into the base namespace. Convert a few related string_util functions to take a StringPiece16 instead of a string16. Remove IsStringASCII(std::wstring) which was unused. Updates callers' includes and namespace usage accordingly. TBR=sky Review URL: https://codereview.chromium.org/176843022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257200 0039d316-1c4b-4281-b951-d872f2087c98
* Move TrimWhitespace to the base namespace.brettw@chromium.org2014-03-031-3/+3
| | | | | | | | R=viettrungluu@chromium.org, viettrungluu Review URL: https://codereview.chromium.org/183853011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254521 0039d316-1c4b-4281-b951-d872f2087c98
* Remove UTF string conversion functions from the global namespace.avi@chromium.org2013-12-261-3/+3
| | | | | | | | | | BUG=330556 TEST=no change TBR=ben@chromium.org Review URL: https://codereview.chromium.org/102993018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242519 0039d316-1c4b-4281-b951-d872f2087c98
* Remove redundant call to switches_.end() in ↵vivek.vg@samsung.com2013-11-211-2/+2
| | | | | | | | base::CommandLine::GetSwitchValueNative(). Review URL: https://codereview.chromium.org/78853005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236503 0039d316-1c4b-4281-b951-d872f2087c98
* Allow typing label names on Windows by not treating things that start with ↵brettw@chromium.org2013-09-251-1/+15
| | | | | | | | | | | | | | | slashes as arguments rather than switches. The old command line parsing is still run so some code could get confused later since / will also be treated as a switch if you ask for it. This seems not as likely to happen that the label will match a switch. If it does, we'll have to change the CommandLine class to make the "/" behavior optional. Fix a "desc" crash attributing blame due to a null pointer. BUG= R=scottmg@chromium.org, thakis@chromium.org Review URL: https://codereview.chromium.org/24613003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225277 0039d316-1c4b-4281-b951-d872f2087c98
* Allow tracing to console everywhere.vollick@chromium.org2013-07-111-0/+5
| | | | | | | | | | | | This patch gets rid of the cc-only trace-to-vlog stuff and replaces it with a general trace-to-console approach that can be used everywhere, even the browser. BUG=None Review URL: https://chromiumcodereview.appspot.com/18174006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211245 0039d316-1c4b-4281-b951-d872f2087c98
* Do not show sync promo when RestoreOnStartupURLs policy is setbartfab@chromium.org2013-06-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | When first_run_tabs are set through master_preferences, the sync promo should be shown if not explicitly suppressed. When RestoreOnStartupURLs is set through policy, the sync promo should never be shown. This is long-standing behavior, as evidenced here: http://crbug.com/125467#c26 That behavior recently regressed with the sync promo appearing even if RestoreOnStartupURLs are set. The regression happened here: https://chromiumcodereview.appspot.com/12638005 This CL fixes the regression by ensuring that when RestoreOnStartup=4 and RestoreOnStartupURLs are set, the sync promo is not shown. The CL also adds browser tests to protect against similar regressions in the future. BUG=244849 TEST=Manual and new browser_tests Review URL: https://chromiumcodereview.appspot.com/16141008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206915 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of strings headers in base/.avi@chromium.org2013-06-111-1/+1
| | | | | | | | | | BUG=247723 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/16745002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205530 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of utf_string_conversions.h in android_webview/, apps/, ↵avi@chromium.org2013-06-071-1/+1
| | | | | | | | | | | ash/, base/. BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/15735027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204874 0039d316-1c4b-4281-b951-d872f2087c98
* Move file_path.h to base/files.brettw@chromium.org2013-02-241-1/+1
| | | | | | TBR=sky git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184344 0039d316-1c4b-4281-b951-d872f2087c98
* Make base compile with no "using base::FilePath".brettw@chromium.org2013-02-161-0/+2
| | | | | | | | | | | | For base .cc files not using the base namespace, I added a using since theses files should be moved to the base namespace, and then explicit qualification will no longer be necessary. Original review URL: https://codereview.chromium.org/12226121 (reland of r182040). Review URL: https://codereview.chromium.org/12278014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182916 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 182032brettw@chromium.org2013-02-121-2/+0
| | | | | | | | | | | | | | | > Make base compile with no "using base::FilePath". > > For base .cc files not using the base namespace, I added a using since theses > files should be moved to the base namespace, and then explicit qualification > will no longer be necessary. > > Review URL: https://codereview.chromium.org/12226121 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/12207132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182040 0039d316-1c4b-4281-b951-d872f2087c98
* Make base compile with no "using base::FilePath".brettw@chromium.org2013-02-121-0/+2
| | | | | | | | | | For base .cc files not using the base namespace, I added a using since theses files should be moved to the base namespace, and then explicit qualification will no longer be necessary. Review URL: https://codereview.chromium.org/12226121 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182032 0039d316-1c4b-4281-b951-d872f2087c98
* Move string_split to base/strings.tfarina@chromium.org2013-02-071-1/+1
| | | | | | | | | R=brettw@chromium.org Review URL: https://chromiumcodereview.appspot.com/12218059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181380 0039d316-1c4b-4281-b951-d872f2087c98
* Extract arguments reconstruction logic out of GetCommandLineString() into ↵gab@chromium.org2012-10-291-8/+19
| | | | | | | | | | | | GetArgumentsString(). BUG=To get arguments we had to GetCommandLineString() and piece out the program: http://code.google.com/searchframe#OAMlx_jo-ck/src/chrome/installer/util/install_util.cc&exact_package=chromium&q=GetCommandLineString&type=cs&l=125 TEST=base_unittests.exe --gtest_filter=CommandLineTest* Review URL: https://chromiumcodereview.appspot.com/11305010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164740 0039d316-1c4b-4281-b951-d872f2087c98
* [content shell] add support for getting tests from the command line.jochen@chromium.org2012-10-191-1/+2
| | | | | | | | | | | | Related to this, parse a single dash on the command line as argument, instead of a switch with no value and name BUG=111316 TEST=out/Debug/content_shell --dump-render-tree path/to/test.html works Review URL: https://chromiumcodereview.appspot.com/11184050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162947 0039d316-1c4b-4281-b951-d872f2087c98
* Allow callers of CommandLine::Init to know whether they were the first caller.erikwright@chromium.org2012-02-271-3/+5
| | | | | | | | | | | | | | | | If there are multiple callers to Init, only one should call Reset. The boolean return value tells the caller whether they are the one responsible for the destruction. As long as the lifetimes of clients are strictly nested (i.e., a client X who uses CommandLine after client Y has initialized it always ceases its use before client Y destroys it) this secures access to this singleton object. One client in particular is updated to follow this model. I will submit follow-up CLs for remaining clients (at least, those who currently do call Reset). This is motivated by a crash in the chrome_frame_net_tests. This test executable nests a TestSuite within the lifetime of a ContentMainRunner (i.e., the engine that is typically used to run Chrome). The content layer initializes CommandLine and Resets it, but the TestSuite also resets it, leading to a DCHECK. This is currently the last remaining issue keeping the chrome_frame_net_tests off the waterfall, and I am very eager to get them back there to reduce the likelihood of further issues being introduced. BUG=114369 TEST=A test has been modified to reflect this change. Review URL: http://codereview.chromium.org/9477001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123763 0039d316-1c4b-4281-b951-d872f2087c98
* Replace most LOG/CHECK statements with DLOG/DCHECK statements in base.brettw@chromium.org2011-10-261-4/+4
| | | | | | | | | | | [ Reland of 107042 http://codereview.chromium.org/8368009 ] I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8341026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107434 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 107042 - Replace most LOG/CHECK statements with DLOG/DCHECK ↵brettw@chromium.org2011-10-251-4/+4
| | | | | | | | | | | | | | statements in base. I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8368009 TBR=brettw@chromium.org Review URL: http://codereview.chromium.org/8351025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107051 0039d316-1c4b-4281-b951-d872f2087c98
* Replace most LOG/CHECK statements with DLOG/DCHECK statements in base.brettw@chromium.org2011-10-251-4/+4
| | | | | | | | | I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8368009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107042 0039d316-1c4b-4281-b951-d872f2087c98
* micro optimize CommandLine.GetSwitchPrefixLengthjoth@chromium.org2011-09-131-1/+1
| | | | | | | | | | | | avoid searching the entire length of each switch for the -- prefix, as we know it can only exist at the start. BUG=None TEST=None Review URL: http://codereview.chromium.org/7866036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100918 0039d316-1c4b-4281-b951-d872f2087c98
* Rename CommandLine::GetCommandLineString().msw@chromium.org2011-07-201-1/+1
| | | | | | | | | | | | Fix string hackery in net/tools/dump_cache/dump_cache.cc Fix const casts in chrome/installer/util/product.cc and base/process_util_win.cc. BUG=73195 TEST=none Review URL: http://codereview.chromium.org/7386002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93165 0039d316-1c4b-4281-b951-d872f2087c98
* Rename CommandLine::GetArgs(), update callers.msw@chromium.org2011-07-131-1/+1
| | | | | | | | | BUG=73195 TEST=none Review URL: http://codereview.chromium.org/7352006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92448 0039d316-1c4b-4281-b951-d872f2087c98
* Nix CommandLine::GetSwitchCount.msw@chromium.org2011-07-131-4/+0
| | | | | | | | | BUG=73195 TEST=none Review URL: http://codereview.chromium.org/7342024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92423 0039d316-1c4b-4281-b951-d872f2087c98
* Base: Don't delete the previous command line when callingrvargas@google.com2011-07-131-1/+7
| | | | | | | | | | | | | | CommandLine::Init() In the multi-DLL build, we can end up initializing the object twice at startup (once in chrome.exe and once in chrome.dll). It should be harmless. BUG=76996 TEST=base_unittests Review URL: http://codereview.chromium.org/7273053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92380 0039d316-1c4b-4281-b951-d872f2087c98
* Consolidate most CommandLine code across platforms.msw@chromium.org2011-05-141-250/+167
| | | | | | | | | | | | | | | | | | | | | | Significant refactoring with some notable behavior changes: 1. Switches are appended preceding existing arguments (after other swtiches). 2. (Windows) command_line_string() is generated and properly quoted/escaped. 3. Appended switches will retain their (optional) included prefixes (--,-,/). Notable internal changes (shouldn't affect behavior): 1. (Windows) Generate the cl string, instead of storing&updating the original. 2. Explicitly retain switch prefixes (--,-,/) (was automatic in init*/ctor). Update (obvious) code expecting switches to be appended antecedent to args. Add Nico's test from: codereview.chromium.org/6728016/. An intermediary CL landed between patch set 3 and 4, see: http://codereview.chromium.org/6596020 BUG=73195,67764 TEST=Commandline usage. Review URL: http://codereview.chromium.org/6526040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85360 0039d316-1c4b-4281-b951-d872f2087c98
* iwyu: Cleanup in the following files:jhawkins@chromium.org2011-04-041-7/+2
| | | | | | | | | | | | | | | | | | | | | * at_exit.cc * atomicops.h * base_paths.h * bzip2_error_handler.cc * callback_internal.h * command_line.cc * cpu.cc * environment.h * event_recorder.cc * file_descriptor_shuffle.cc * file_path.cc BUG=none TEST=none Review URL: http://codereview.chromium.org/6759017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80340 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw_scoped_refptr_mismatch_checker.h ref_counted.cc ref_counted.h ref_counted_memory.cc ref_counted_memory.h ref_counted_unittest.cc scoped_callback_factory.h scoped_comptr_win.h scoped_handle.h scoped_native_library.cc scoped_native_library.h scoped_native_library_unittest.cc scoped_nsobject.h scoped_open_process.h scoped_ptr.h scoped_ptr_unittest.cc scoped_temp_dir.cc scoped_temp_dir.h scoped_temp_dir_unittest.cc scoped_vector.h singleton.h singleton_objc.h singleton_unittest.cc linked_ptr.h linked_ptr_unittest.cc weak_ptr.cc weak_ptr.h weak_ptr_unittest.cc BUG=None TEST=Compile Review URL: http://codereview.chromium.org/6714032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98
* Out-of-line default Commandline ctor and provide dtor.msw@chromium.org2011-03-011-0/+6
| | | | | | | | | BUG=73195 TEST=none Review URL: http://codereview.chromium.org/6588087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76419 0039d316-1c4b-4281-b951-d872f2087c98
* Reorganize CommandLine code.msw@chromium.org2011-03-011-236/+217
| | | | | | | | | | | | The majority of these changes are purely moving code. Conducted some minor (and hopefully straightforward) refactoring. BUG=73195 TEST=none Review URL: http://codereview.chromium.org/6596020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76339 0039d316-1c4b-4281-b951-d872f2087c98