From 95a360e3963849d3b5c9a6dfcedd75f17b30683f Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Tue, 27 Feb 2024 17:55:41 +0100 Subject: [PATCH] removed automatic durable storage for important sites --- build/patches/Add-site-engagement-flag.patch | 36 +++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/build/patches/Add-site-engagement-flag.patch b/build/patches/Add-site-engagement-flag.patch index 2e151856..99b43323 100644 --- a/build/patches/Add-site-engagement-flag.patch +++ b/build/patches/Add-site-engagement-flag.patch @@ -8,6 +8,7 @@ Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later. License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- chrome/browser/about_flags.cc | 1 + + .../engagement/important_sites_util.cc | 9 +++++ .../internal/tracker_impl.cc | 3 ++ .../public/feature_configurations.cc | 7 ++++ .../content/site_engagement_score.cc | 5 +++ @@ -15,7 +16,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html components/site_engagement/core/features.cc | 30 ++++++++++++++++ components/site_engagement/core/features.h | 34 +++++++++++++++++++ .../Add-site-engagement-flag.inc | 10 ++++++ - 8 files changed, 96 insertions(+) + 9 files changed, 105 insertions(+) create mode 100644 components/site_engagement/core/features.cc create mode 100644 components/site_engagement/core/features.h create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-site-engagement-flag.inc @@ -31,6 +32,39 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc #include "components/shared_highlighting/core/common/shared_highlighting_features.h" #include "components/signin/core/browser/dice_account_reconcilor_delegate.h" #include "components/signin/public/base/signin_buildflags.h" +diff --git a/chrome/browser/engagement/important_sites_util.cc b/chrome/browser/engagement/important_sites_util.cc +--- a/chrome/browser/engagement/important_sites_util.cc ++++ b/chrome/browser/engagement/important_sites_util.cc +@@ -32,6 +32,7 @@ + #include "components/prefs/scoped_user_pref_update.h" + #include "components/site_engagement/content/site_engagement_score.h" + #include "components/site_engagement/content/site_engagement_service.h" ++#include "components/site_engagement/core/features.h" + #include "components/site_engagement/core/mojom/site_engagement_details.mojom.h" + #include "components/webapps/browser/banners/app_banner_settings_helper.h" + #include "net/base/registry_controlled_domains/registry_controlled_domain.h" +@@ -387,6 +388,10 @@ void ImportantSitesUtil::RegisterProfilePrefs( + // static + std::set ImportantSitesUtil::GetInstalledRegisterableDomains( + Profile* profile) { ++ if (!base::FeatureList::IsEnabled(site_engagement::features::kSiteEngagement)) { ++ std::set empty_list; ++ return empty_list; ++ } + std::set installed_origins = GetOriginsWithInstalledWebApps(profile); + std::set registerable_domains; + +@@ -401,6 +406,10 @@ std::vector + ImportantSitesUtil::GetImportantRegisterableDomains(Profile* profile, + size_t max_results) { + SCOPED_UMA_HISTOGRAM_TIMER("Storage.ImportantSites.GenerationTime"); ++ if (!base::FeatureList::IsEnabled(site_engagement::features::kSiteEngagement)) { ++ std::vector empty_list; ++ return empty_list; ++ } + std::map important_info; + std::map engagement_map; + diff --git a/components/feature_engagement/internal/tracker_impl.cc b/components/feature_engagement/internal/tracker_impl.cc --- a/components/feature_engagement/internal/tracker_impl.cc +++ b/components/feature_engagement/internal/tracker_impl.cc