OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 |
| 5 #include "extensions/common/test/scoped_command_line_switch.h" |
| 6 |
| 7 ScopedCommandLineSwitch::ScopedCommandLineSwitch( |
| 8 const std::string& switch_string) |
| 9 : original_command_line_(*base::CommandLine::ForCurrentProcess()) { |
| 10 base::CommandLine::ForCurrentProcess()->AppendSwitch(switch_string); |
| 11 } |
| 12 |
| 13 ScopedCommandLineSwitch::ScopedCommandLineSwitch( |
| 14 const std::string& switch_string, |
| 15 const std::string& value) |
| 16 : original_command_line_(*base::CommandLine::ForCurrentProcess()) { |
| 17 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(switch_string, |
| 18 value); |
| 19 } |
| 20 |
| 21 ScopedCommandLineSwitch::~ScopedCommandLineSwitch() { |
| 22 *base::CommandLine::ForCurrentProcess() = original_command_line_; |
| 23 } |
OLD | NEW |