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

Unified Diff: base/command_line.h

Issue 329017: Remove deprecated CommandLine(std::wstring) ctor. (Closed)
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/command_line.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | base/command_line.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698