Chromium Code Reviews| Index: base/command_line.cc |
| diff --git a/base/command_line.cc b/base/command_line.cc |
| index 873da813483651bc9e74b0510e17fa925225b5bd..1b319ec814f3782c28d45936265cb2b8818b7f57 100644 |
| --- a/base/command_line.cc |
| +++ b/base/command_line.cc |
| @@ -365,6 +365,20 @@ void CommandLine::AppendSwitchASCII(const std::string& switch_string, |
| #endif |
| } |
| +void CommandLine::RemoveSwitchASCIIForTesting( |
| + const std::string& switch_string) { |
| +#if defined(OS_WIN) |
| + const std::string switch_key = ToLowerASCII(switch_string); |
| + StringType combined_switch_string(ASCIIToUTF16(switch_key)); |
| +#elif defined(OS_POSIX) |
| + const std::string& switch_key = switch_string; |
| + StringType combined_switch_string(switch_key); |
| +#endif |
|
Ilya Sherman
2017/06/07 21:32:36
These few lines are duplicated from above. Please
|
| + size_t prefix_length = GetSwitchPrefixLength(combined_switch_string); |
| + switches_by_stringpiece_.erase(switch_key.substr(prefix_length)); |
| + switches_.erase(switch_string.substr(prefix_length)); |
|
Ilya Sherman
2017/06/07 21:32:36
Does argv_ need to be updated as well? (I am not
|
| +} |
| + |
| void CommandLine::CopySwitchesFrom(const CommandLine& source, |
| const char* const switches[], |
| size_t count) { |