diff options
author | haraken@chromium.org <haraken@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-21 23:56:26 +0000 |
---|---|---|
committer | haraken@chromium.org <haraken@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-21 23:56:26 +0000 |
commit | 07d666d1cc53ed255e51263adf8370246468a9f4 (patch) | |
tree | d4784a8e9244aaffca1cd31a451bfc70364be9a6 | |
parent | e27817e48ddc27081ca2ab3d72ec687ce2006ac2 (diff) | |
download | chromium_src-07d666d1cc53ed255e51263adf8370246468a9f4.zip chromium_src-07d666d1cc53ed255e51263adf8370246468a9f4.tar.gz chromium_src-07d666d1cc53ed255e51263adf8370246468a9f4.tar.bz2 |
Revert 212794 "Migrate users from "WebKit" flag to "Web Platform"."
> Migrate users from "WebKit" flag to "Web Platform".
>
> We changed the name of the "Experimental WebKit Features" flag, and changed
> the actual flag at the same time[1]. I decided at the time to simply throw away
> the old flag; I've been reliably informed that developers aren't particularly
> thrilled with that decision. "Why have my experimental features stopped
> working?" they ask. "Didn't you read my G+ post?" isn't a particularly helpful
> answer, especially since most people (unbelievably!) don't follow me on
> The Internets™.
>
> This patch hacks a migration system into about:flags, which I hope we never
> ever have to use again, and can safely throw away after a release cycle or two.
>
> [1]: https://codereview.chromium.org/14940009/
>
> R=jochen@chromium.org,thakis@chromium.org
>
> Review URL: https://chromiumcodereview.appspot.com/19520007
TBR=mkwst@chromium.org
Review URL: https://codereview.chromium.org/19514003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212828 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/about_flags.cc | 39 | ||||
-rw-r--r-- | chrome/browser/about_flags.h | 11 | ||||
-rw-r--r-- | chrome/browser/about_flags_unittest.cc | 22 |
3 files changed, 2 insertions, 70 deletions
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index e239a43..6ca3032 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -309,7 +309,6 @@ const Experiment::Choice kTabCaptureDownscaleQualityChoices[] = { // array of choices. // See the documentation of Experiment for details on the fields. // - // When adding a new choice, add it to the end of the list. const Experiment kExperiments[] = { { @@ -1637,15 +1636,6 @@ const Experiment kExperiments[] = { const Experiment* experiments = kExperiments; size_t num_experiments = arraysize(kExperiments); -const Migration kMigrations[] = { - // TODO(mkwst): Remove this once some reasonable amount of time has passed. - {"enable-experimental-webkit-features", - "enable-experimental-web-platform-features"} -}; - -const Migration* migrations = kMigrations; -size_t num_migrations = arraysize(kMigrations); - // Stores and encapsulates the little state that about:flags has. class FlagsState { public: @@ -1714,17 +1704,6 @@ bool ValidateExperiment(const Experiment& e) { return true; } -// Given the set of currently active experiments, migrate deprecated experiments -// to their shiny new counterparts. -void MigrateExperiments(std::set<std::string>* experimentList) { - for (size_t i = 0; i < num_migrations; ++i) { - if (experimentList->count(migrations[i].from)) { - experimentList->erase(experimentList->find(migrations[i].from)); - experimentList->insert(migrations[i].to); - } - } -} - // Removes all experiments from prefs::kEnabledLabsExperiments that are // unknown, to prevent this list to become very long as experiments are added // and removed. @@ -1735,11 +1714,7 @@ void SanitizeList(FlagsStorage* flags_storage) { AddInternalName(experiments[i], &known_experiments); } - // Store the original list of Experiments, then copy it for processing. - std::set<std::string> unsanitized_experiments = flags_storage->GetFlags(); - std::set<std::string> enabled_experiments = unsanitized_experiments; - - MigrateExperiments(&enabled_experiments); + std::set<std::string> enabled_experiments = flags_storage->GetFlags(); std::set<std::string> new_enabled_experiments; std::set_intersection( @@ -1747,7 +1722,7 @@ void SanitizeList(FlagsStorage* flags_storage) { enabled_experiments.begin(), enabled_experiments.end(), std::inserter(new_enabled_experiments, new_enabled_experiments.begin())); - if (new_enabled_experiments != unsanitized_experiments) + if (new_enabled_experiments != enabled_experiments) flags_storage->SetFlags(new_enabled_experiments); } @@ -2139,16 +2114,6 @@ void SetExperiments(const Experiment* e, size_t count) { } } -void SetMigrations(const Migration* e, size_t count) { - if (!e) { - migrations = kMigrations; - num_migrations = arraysize(kMigrations); - } else { - migrations = e; - num_migrations = count; - } -} - const Experiment* GetExperiments(size_t* count) { *count = num_experiments; return experiments; diff --git a/chrome/browser/about_flags.h b/chrome/browser/about_flags.h index c7fdc53..5d67e97 100644 --- a/chrome/browser/about_flags.h +++ b/chrome/browser/about_flags.h @@ -105,13 +105,6 @@ struct Experiment { string16 DescriptionForChoice(int index) const; }; -// Migration is used internally by about_flags to move users from old, -// busted flags to the new hotness. This is exposed only for testing. -struct Migration { - const char* const from; - const char* const to; -}; - // Reads the Labs |prefs| (called "Labs" for historical reasons) and adds the // commandline flags belonging to the active experiments to |command_line|. void ConvertFlagsToSwitches(FlagsStorage* flags_storage, @@ -170,10 +163,6 @@ void ClearState(); // NOT take ownership of the supplied Experiments. void SetExperiments(const Experiment* e, size_t count); -// Sets the list of migrations. Pass in NULL to use the default set. This does -// NOT take ownership of the supplied Migrations. -void SetMigrations(const Migration* e, size_t count); - // Returns the current set of experiments. const Experiment* GetExperiments(size_t* count); diff --git a/chrome/browser/about_flags_unittest.cc b/chrome/browser/about_flags_unittest.cc index 3d9fbd2..34219c3 100644 --- a/chrome/browser/about_flags_unittest.cc +++ b/chrome/browser/about_flags_unittest.cc @@ -110,13 +110,6 @@ static Experiment kExperiments[] = { }, }; -static Migration kMigrations[] = { - { - kFlags1, - kFlags2 - } -}; - class AboutFlagsTest : public ::testing::Test { protected: AboutFlagsTest() : flags_storage_(&prefs_) { @@ -230,21 +223,6 @@ TEST_F(AboutFlagsTest, ConvertFlagsToSwitches) { EXPECT_TRUE(command_line.HasSwitch(kSwitch1)); } -TEST_F(AboutFlagsTest, ConvertFlagsToSwitchesMigration) { - testing::SetMigrations(kMigrations, arraysize(kMigrations)); - SetExperimentEnabled(&flags_storage_,kFlags1, true); - - CommandLine command_line(CommandLine::NO_PROGRAM); - - EXPECT_FALSE(command_line.HasSwitch(kSwitch1)); - EXPECT_FALSE(command_line.HasSwitch(kSwitch2)); - - ConvertFlagsToSwitches(&flags_storage_, &command_line); - - EXPECT_FALSE(command_line.HasSwitch(kSwitch1)); - EXPECT_TRUE(command_line.HasSwitch(kSwitch2)); -} - TEST_F(AboutFlagsTest, CompareSwitchesToCurrentCommandLine) { SetExperimentEnabled(&flags_storage_, kFlags1, true); |