scoped_command_line.cc 623 B

12345678910111213141516171819202122
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "base/test/scoped_command_line.h"
  5. namespace base {
  6. namespace test {
  7. ScopedCommandLine::ScopedCommandLine()
  8. : original_command_line_(*base::CommandLine::ForCurrentProcess()) {}
  9. ScopedCommandLine::~ScopedCommandLine() {
  10. *base::CommandLine::ForCurrentProcess() = original_command_line_;
  11. }
  12. CommandLine* ScopedCommandLine::GetProcessCommandLine() {
  13. return base::CommandLine::ForCurrentProcess();
  14. }
  15. } // namespace test
  16. } // namespace base