Index: chrome/browser/about_flags.cc |
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc |
index 7577556a0b3e3a97ca013d70cf3a88c938e8c25c..b56cfb0b3c7b02b68aedc27234c04ad6c1a7c673 100644 |
--- a/chrome/browser/about_flags.cc |
+++ b/chrome/browser/about_flags.cc |
@@ -1933,6 +1933,11 @@ const Experiment kExperiments[] = { |
data_reduction_proxy::switches::kDisableDataReductionProxyDev) |
}, |
#endif |
+ |
+ // Add new choice before this line. |
+ // |
+ // If it can be used on ChromeOS, please also add it to |
+ // chrome/browser/chromeos/login/report_custom_flags.cc |
sky
2014/06/19 20:23:28
This is not maintainable. You need to come up with
Alexander Alekseev
2014/06/20 18:42:45
We need histogram here to know which flags lead to
|
}; |
const Experiment* experiments = kExperiments; |
@@ -2144,17 +2149,33 @@ 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 { |
+ result = |
+ std::equal(new_flags.begin(), new_flags.end(), active_flags.begin()); |
+ } |
- 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, |