diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-12 16:11:40 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-12 16:11:40 +0000 |
commit | 02fb75abae043fc1d6c14bebedeb6598dd955ef5 (patch) | |
tree | 47d7ff66aca6716c75f6521c1857e3c918eef6d0 /base | |
parent | 0a9f9d546e2eb56030874c1b644a092a54483b0e (diff) | |
download | chromium_src-02fb75abae043fc1d6c14bebedeb6598dd955ef5.zip chromium_src-02fb75abae043fc1d6c14bebedeb6598dd955ef5.tar.gz chromium_src-02fb75abae043fc1d6c14bebedeb6598dd955ef5.tar.bz2 |
Drop redundant CommandLine::Terminate.
We had two functions that did the same thing.
Though Terminate came first, I think Reset better conveys the intent.
Review URL: http://codereview.chromium.org/267047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28708 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/command_line.cc | 8 | ||||
-rw-r--r-- | base/command_line.h | 10 | ||||
-rw-r--r-- | base/test/test_suite.h | 2 |
3 files changed, 7 insertions, 13 deletions
diff --git a/base/command_line.cc b/base/command_line.cc index bbd25b8..ac8402cb 100644 --- a/base/command_line.cc +++ b/base/command_line.cc @@ -191,12 +191,6 @@ bool CommandLine::IsSwitch(const StringType& parameter_string, } // static -void CommandLine::Reset() { - delete current_process_commandline_; - current_process_commandline_ = NULL; -} - -// static void CommandLine::Init(int argc, const char* const* argv) { #if defined(OS_WIN) current_process_commandline_ = new CommandLine; @@ -240,7 +234,7 @@ void CommandLine::SetTrueArgv(char** argv) { } #endif -void CommandLine::Terminate() { +void CommandLine::Reset() { DCHECK(current_process_commandline_ != NULL); delete current_process_commandline_; current_process_commandline_ = NULL; diff --git a/base/command_line.h b/base/command_line.h index c6aae86..3eb3dbb 100644 --- a/base/command_line.h +++ b/base/command_line.h @@ -48,9 +48,6 @@ class CommandLine { // Deprecated in favor of FilePath version. explicit CommandLine(const std::wstring& program); - // Uninit and free the current process's command line. - static void Reset(); - // 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 @@ -71,9 +68,12 @@ class CommandLine { // Destroys the current process CommandLine singleton. This is necessary if // you want to reset the base library to its initial state (for example in an // outer library that needs to be able to terminate, and be re-initialized). - // If Init is called only once, e.g. in main(), calling Terminate() is not + // If Init is called only once, e.g. in main(), calling Reset() is not // necessary. - static void Terminate(); + static void Reset(); + // The same function snuck into this class under two different names; + // this one remains for backwards compat with the older o3d build. + static void Terminate() { Reset(); } // Get the singleton CommandLine representing the current process's // command line. diff --git a/base/test/test_suite.h b/base/test/test_suite.h index 1203904..863721a 100644 --- a/base/test/test_suite.h +++ b/base/test/test_suite.h @@ -75,7 +75,7 @@ class TestSuite { } virtual ~TestSuite() { - CommandLine::Terminate(); + CommandLine::Reset(); } // Returns true if a string starts with FLAKY_. |