Index: base/command_line.h |
diff --git a/base/command_line.h b/base/command_line.h |
index 91eb8926fce7be70ba83de089b9c1eb2ab72de3c..37a6a4ea439dbfa7b4d259c2d4339cb337a2d1c3 100644 |
--- a/base/command_line.h |
+++ b/base/command_line.h |
@@ -32,10 +32,19 @@ class InProcessBrowserTest; |
class CommandLine { |
public: |
+ // A constructor for CommandLines that are used only to carry arguments. |
+ enum ArgumentsOnly { ARGUMENTS_ONLY }; |
+ explicit CommandLine(ArgumentsOnly args_only); |
+ |
#if defined(OS_WIN) |
// Initialize by parsing the given command-line string. |
// The program name is assumed to be the first item in the string. |
void ParseFromString(const std::wstring& command_line); |
+ static CommandLine FromString(const std::wstring& command_line) { |
+ CommandLine cmd; |
+ cmd.ParseFromString(command_line); |
+ return cmd; |
+ } |
#elif defined(OS_POSIX) |
// Initialize from an argv vector. |
void InitFromArgv(int argc, const char* const* argv); |
@@ -53,9 +62,6 @@ class CommandLine { |
// |program| is the name of the program to run (aka argv[0]). |
explicit CommandLine(const FilePath& program); |
- // Deprecated in favor of FilePath version. |
- explicit CommandLine(const std::wstring& program); |
- |
// Initialize the current process CommandLine singleton. On Windows, |
// ignores its arguments (we instead parse GetCommandLineW() |
// directly) because we don't trust the CRT's parsing of the command |