Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: chrome/browser/about_flags.cc

Issue 23983031: Owner flags storage should not save the flags names but the actual switches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/about_flags.h ('k') | chrome/browser/about_flags_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/about_flags.cc
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index d1e2fe9b0c851a0345bd7b5927fac9af31a449c4..89d43d0a7c695f47d553e000d50e41667cc791de 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1667,7 +1667,8 @@ class FlagsState {
public:
FlagsState() : needs_restart_(false) {}
void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
- CommandLine* command_line);
+ CommandLine* command_line,
+ SentinelsMode sentinels);
bool IsRestartNeededToCommitChanges();
void SetExperimentEnabled(
FlagsStorage* flags_storage,
@@ -1833,9 +1834,11 @@ string16 Experiment::DescriptionForChoice(int index) const {
}
void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
- CommandLine* command_line) {
+ CommandLine* command_line,
+ SentinelsMode sentinels) {
FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage,
- command_line);
+ command_line,
+ sentinels);
}
bool AreSwitchesIdenticalToCurrentCommandLine(
@@ -1971,8 +1974,9 @@ void SetFlagToSwitchMapping(const std::string& key,
(*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
}
-void FlagsState::ConvertFlagsToSwitches(
- FlagsStorage* flags_storage, CommandLine* command_line) {
+void FlagsState::ConvertFlagsToSwitches(FlagsStorage* flags_storage,
+ CommandLine* command_line,
+ SentinelsMode sentinels) {
if (command_line->HasSwitch(switches::kNoExperiments))
return;
@@ -2005,10 +2009,12 @@ void FlagsState::ConvertFlagsToSwitches(
}
}
- command_line->AppendSwitch(switches::kFlagSwitchesBegin);
- flags_switches_.insert(
- std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
- std::string()));
+ if (sentinels == kAddSentinels) {
+ command_line->AppendSwitch(switches::kFlagSwitchesBegin);
+ flags_switches_.insert(
+ std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
+ std::string()));
+ }
for (std::set<std::string>::iterator it = enabled_experiments.begin();
it != enabled_experiments.end();
++it) {
@@ -2028,10 +2034,12 @@ void FlagsState::ConvertFlagsToSwitches(
switch_and_value_pair.second);
flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
}
- command_line->AppendSwitch(switches::kFlagSwitchesEnd);
- flags_switches_.insert(
- std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
- std::string()));
+ if (sentinels == kAddSentinels) {
+ command_line->AppendSwitch(switches::kFlagSwitchesEnd);
+ flags_switches_.insert(
+ std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
+ std::string()));
+ }
}
bool FlagsState::IsRestartNeededToCommitChanges() {
« no previous file with comments | « chrome/browser/about_flags.h ('k') | chrome/browser/about_flags_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698