Chromium Code Reviews| Index: chrome/browser/about_flags.cc |
| diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc |
| index 7577556a0b3e3a97ca013d70cf3a88c938e8c25c..3f25c3a918404c43bc116e91e5ba9a486a3b2049 100644 |
| --- a/chrome/browser/about_flags.cc |
| +++ b/chrome/browser/about_flags.cc |
| @@ -2144,17 +2144,32 @@ void ConvertFlagsToSwitches(FlagsStorage* flags_storage, |
| } |
| bool AreSwitchesIdenticalToCurrentCommandLine( |
| - const CommandLine& new_cmdline, const CommandLine& active_cmdline) { |
| + const CommandLine& new_cmdline, |
| + const CommandLine& active_cmdline, |
| + std::set<CommandLine::StringType>* out_difference) { |
| std::set<CommandLine::StringType> new_flags = |
| ExtractFlagsFromCommandLine(new_cmdline); |
| std::set<CommandLine::StringType> active_flags = |
| ExtractFlagsFromCommandLine(active_cmdline); |
| + bool result = true; |
| // Needed because std::equal doesn't check if the 2nd set is empty. |
| - if (new_flags.size() != active_flags.size()) |
| - return false; |
| + if (new_flags.size() != active_flags.size()) { |
| + result = false; |
| + } else { |
| + std::equal(new_flags.begin(), new_flags.end(), active_flags.begin()); |
|
Nikita (slow)
2014/06/19 17:08:07
result =
Alexander Alekseev
2014/06/19 18:17:47
Done.
|
| + } |
| - return std::equal(new_flags.begin(), new_flags.end(), active_flags.begin()); |
| + if (out_difference && !result) { |
| + std::set_symmetric_difference( |
| + new_flags.begin(), |
| + new_flags.end(), |
| + active_flags.begin(), |
| + active_flags.end(), |
| + std::inserter(*out_difference, out_difference->begin())); |
| + } |
| + |
| + return result; |
| } |
| void GetFlagsExperimentsData(FlagsStorage* flags_storage, |