LeOSium_webview/LeOS/patches/Disable-all-predictors-code...

620 lines
30 KiB
Diff
Raw Normal View History

2023-11-18 11:46:19 +01:00
From: uazo <uazo@users.noreply.github.com>
Date: Tue, 25 Jan 2022 12:22:52 +0000
Subject: Disable all predictors code
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
chrome/browser/BUILD.gn | 8 +-
chrome/browser/browser_features.cc | 16 ++--
.../preloading_model_keyed_service.cc | 8 --
.../preloading_model_keyed_service_factory.cc | 4 +-
.../ranking/history_clusters_module_ranker.cc | 3 +-
.../chrome_hints_manager.cc | 1 +
.../optimization_guide_keyed_service.cc | 1 -
.../browser/predictors/loading_predictor.cc | 4 +-
.../predictors/loading_predictor_config.cc | 4 +-
.../browser/predictors/predictors_features.cc | 14 +---
chrome/common/chrome_features.cc | 6 +-
.../browser/autofill_optimization_guide.cc | 5 +-
.../optimization_guide/core/hints_fetcher.cc | 1 +
.../optimization_guide/core/hints_manager.cc | 5 ++
.../core/optimization_guide_features.cc | 74 +++++++------------
.../core/prediction_model_download_manager.cc | 6 +-
.../core/prediction_model_fetcher_impl.cc | 1 +
components/optimization_guide/features.gni | 3 +-
components/permissions/features.cc | 16 ++--
third_party/blink/common/features.cc | 12 +--
.../platform/runtime_enabled_features.json5 | 2 +-
21 files changed, 82 insertions(+), 112 deletions(-)
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -891,10 +891,10 @@ static_library("browser") {
"navigation_predictor/navigation_predictor_metrics_document_data.h",
"navigation_predictor/navigation_predictor_preconnect_client.cc",
"navigation_predictor/navigation_predictor_preconnect_client.h",
- "navigation_predictor/preloading_model_executor.cc",
- "navigation_predictor/preloading_model_executor.h",
- "navigation_predictor/preloading_model_handler.cc",
- "navigation_predictor/preloading_model_handler.h",
+ # "navigation_predictor/preloading_model_executor.cc",
+ # "navigation_predictor/preloading_model_executor.h",
+ # "navigation_predictor/preloading_model_handler.cc",
+ # "navigation_predictor/preloading_model_handler.h",
"navigation_predictor/preloading_model_keyed_service.cc",
"navigation_predictor/preloading_model_keyed_service.h",
"navigation_predictor/preloading_model_keyed_service_factory.cc",
diff --git a/chrome/browser/browser_features.cc b/chrome/browser/browser_features.cc
--- a/chrome/browser/browser_features.cc
+++ b/chrome/browser/browser_features.cc
@@ -255,22 +255,22 @@ BASE_FEATURE(kIncomingCallNotifications,
// Enables omnibox trigger prerendering.
BASE_FEATURE(kOmniboxTriggerForPrerender2,
- "OmniboxTriggerForPrerender2",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ "OmniboxTriggerForPrerender2", // always disabled
+ base::FEATURE_DISABLED_BY_DEFAULT); // in bromite
// Enables bookmark trigger prerendering.
BASE_FEATURE(kBookmarkTriggerForPrerender2,
- "BookmarkTriggerForPrerender2",
- base::FEATURE_DISABLED_BY_DEFAULT);
+ "BookmarkTriggerForPrerender2", // always disabled
+ base::FEATURE_DISABLED_BY_DEFAULT); // in bromite
// Enables New Tab Page trigger prerendering.
BASE_FEATURE(kNewTabPageTriggerForPrerender2,
- "NewTabPageTriggerForPrerender2",
- base::FEATURE_DISABLED_BY_DEFAULT);
+ "NewTabPageTriggerForPrerender2", // always disabled
+ base::FEATURE_DISABLED_BY_DEFAULT); // in bromite
BASE_FEATURE(kSupportSearchSuggestionForPrerender2,
- "SupportSearchSuggestionForPrerender2",
- base::FEATURE_DISABLED_BY_DEFAULT);
+ "SupportSearchSuggestionForPrerender2", // always disabled
+ base::FEATURE_DISABLED_BY_DEFAULT); // in bromite
const base::FeatureParam<SearchSuggestionPrerenderImplementationType>::Option
search_suggestion_implementation_types[] = {
{SearchSuggestionPrerenderImplementationType::kUsePrefetch,
diff --git a/chrome/browser/navigation_predictor/preloading_model_keyed_service.cc b/chrome/browser/navigation_predictor/preloading_model_keyed_service.cc
--- a/chrome/browser/navigation_predictor/preloading_model_keyed_service.cc
+++ b/chrome/browser/navigation_predictor/preloading_model_keyed_service.cc
@@ -10,14 +10,6 @@ PreloadingModelKeyedService::Inputs::Inputs() = default;
PreloadingModelKeyedService::PreloadingModelKeyedService(
OptimizationGuideKeyedService* optimization_guide_keyed_service) {
- auto* model_provider =
- static_cast<optimization_guide::OptimizationGuideModelProvider*>(
- optimization_guide_keyed_service);
-
- if (model_provider) {
- preloading_model_handler_ =
- std::make_unique<PreloadingModelHandler>(model_provider);
- }
}
PreloadingModelKeyedService::~PreloadingModelKeyedService() = default;
diff --git a/chrome/browser/navigation_predictor/preloading_model_keyed_service_factory.cc b/chrome/browser/navigation_predictor/preloading_model_keyed_service_factory.cc
--- a/chrome/browser/navigation_predictor/preloading_model_keyed_service_factory.cc
+++ b/chrome/browser/navigation_predictor/preloading_model_keyed_service_factory.cc
@@ -42,7 +42,5 @@ std::unique_ptr<KeyedService>
blink::features::kPreloadingHeuristicsMLModel)) {
return nullptr;
}
- auto* profile = Profile::FromBrowserContext(context);
- return std::make_unique<PreloadingModelKeyedService>(
- OptimizationGuideKeyedServiceFactory::GetForProfile(profile));
+ return nullptr;
}
diff --git a/chrome/browser/new_tab_page/modules/history_clusters/ranking/history_clusters_module_ranker.cc b/chrome/browser/new_tab_page/modules/history_clusters/ranking/history_clusters_module_ranker.cc
--- a/chrome/browser/new_tab_page/modules/history_clusters/ranking/history_clusters_module_ranker.cc
+++ b/chrome/browser/new_tab_page/modules/history_clusters/ranking/history_clusters_module_ranker.cc
@@ -62,9 +62,10 @@ void HistoryClustersModuleRanker::OnAllSignalsReady(
for (const auto& cluster : clusters) {
ranking_signals->emplace_back(active_carts, category_boostlist_, cluster);
}
- auto* ranking_signals_ptr = ranking_signals.get();
#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
+ auto* ranking_signals_ptr = ranking_signals.get();
+
if (model_handler_ && model_handler_->CanExecuteAvailableModel()) {
model_handler_->ExecuteBatch(
ranking_signals_ptr,
diff --git a/chrome/browser/optimization_guide/chrome_hints_manager.cc b/chrome/browser/optimization_guide/chrome_hints_manager.cc
--- a/chrome/browser/optimization_guide/chrome_hints_manager.cc
+++ b/chrome/browser/optimization_guide/chrome_hints_manager.cc
@@ -27,6 +27,7 @@ bool IsAllowedToFetchForNavigationPrediction(
const absl::optional<NavigationPredictorKeyedService::Prediction>
prediction) {
DCHECK(prediction);
+ if ((true)) return false;
if (prediction->prediction_source() !=
NavigationPredictorKeyedService::PredictionSource::
diff --git a/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc b/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc
--- a/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc
+++ b/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc
@@ -343,7 +343,6 @@ void OptimizationGuideKeyedService::RemoveObserverForOptimizationTargetModel(
void OptimizationGuideKeyedService::RegisterOptimizationTypes(
const std::vector<optimization_guide::proto::OptimizationType>&
optimization_types) {
- hints_manager_->RegisterOptimizationTypes(optimization_types);
}
optimization_guide::OptimizationGuideDecision
diff --git a/chrome/browser/predictors/loading_predictor.cc b/chrome/browser/predictors/loading_predictor.cc
--- a/chrome/browser/predictors/loading_predictor.cc
+++ b/chrome/browser/predictors/loading_predictor.cc
@@ -184,7 +184,7 @@ ResourcePrefetchPredictor* LoadingPredictor::resource_prefetch_predictor() {
}
PreconnectManager* LoadingPredictor::preconnect_manager() {
- if (shutdown_) {
+ if ((true)) {
return nullptr;
}
@@ -200,7 +200,7 @@ PrefetchManager* LoadingPredictor::prefetch_manager() {
if (!base::FeatureList::IsEnabled(features::kLoadingPredictorPrefetch))
return nullptr;
- if (shutdown_) {
+ if ((true)) {
return nullptr;
}
diff --git a/chrome/browser/predictors/loading_predictor_config.cc b/chrome/browser/predictors/loading_predictor_config.cc
--- a/chrome/browser/predictors/loading_predictor_config.cc
+++ b/chrome/browser/predictors/loading_predictor_config.cc
@@ -13,8 +13,8 @@
namespace predictors {
bool IsLoadingPredictorEnabled(Profile* profile) {
- // Disabled for off-the-record. Policy choice, not a technical limitation.
- return profile && !profile->IsOffTheRecord();
+ // Disabled for all profiles
+ return false;
}
bool IsPreconnectAllowed(Profile* profile) {
diff --git a/chrome/browser/predictors/predictors_features.cc b/chrome/browser/predictors/predictors_features.cc
--- a/chrome/browser/predictors/predictors_features.cc
+++ b/chrome/browser/predictors/predictors_features.cc
@@ -11,8 +11,8 @@ namespace features {
// Whether local predictions should be used to make preconnect predictions.
BASE_FEATURE(kLoadingPredictorUseLocalPredictions,
- "LoadingPredictorUseLocalPredictions",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ "LoadingPredictorUseLocalPredictions", // disabled by
+ base::FEATURE_DISABLED_BY_DEFAULT); // default
// Modifies loading predictor so that it only learns about subresources and
// origins that are high priority.
@@ -39,11 +39,7 @@ BASE_FEATURE(kLoadingPredictorDisregardAlwaysAccessesNetwork,
const base::FeatureState
kLoadingPredictorUseOptimizationGuideDefaultFeatureState =
-#if BUILDFLAG(IS_ANDROID)
- base::FEATURE_ENABLED_BY_DEFAULT;
-#else
- base::FEATURE_DISABLED_BY_DEFAULT;
-#endif
+ base::FEATURE_DISABLED_BY_DEFAULT;
// Modifies loading predictor so that it can also use predictions coming from
// the optimization guide.
@@ -52,11 +48,7 @@ BASE_FEATURE(kLoadingPredictorUseOptimizationGuide,
kLoadingPredictorUseOptimizationGuideDefaultFeatureState);
const base::FeatureState kLoadingPredictorPrefetchDefaultFeatureState =
-#if BUILDFLAG(IS_ANDROID)
- base::FEATURE_ENABLED_BY_DEFAULT;
-#else
base::FEATURE_DISABLED_BY_DEFAULT;
-#endif
// Modifies loading predictor so that it does prefetches of subresources instead
// of preconnects.
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
--- a/chrome/common/chrome_features.cc
+++ b/chrome/common/chrome_features.cc
@@ -1044,7 +1044,7 @@ BASE_FEATURE(kPluginVm, "PluginVm", base::FEATURE_DISABLED_BY_DEFAULT);
// Allows Chrome to do preconnect when prerender fails.
BASE_FEATURE(kPrerenderFallbackToPreconnect,
"PrerenderFallbackToPreconnect",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ base::FEATURE_DISABLED_BY_DEFAULT);
#if BUILDFLAG(IS_CHROMEOS)
// Enable improved printer state and error state messaging for Print Preview.
@@ -1105,8 +1105,8 @@ BASE_FEATURE(kSafetyCheckExtensions,
// Enables notification permission module in Safety Check.
BASE_FEATURE(kSafetyCheckNotificationPermissions,
- "SafetyCheckNotificationPermissions",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ "SafetyCheckNotificationPermissions", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
const base::FeatureParam<int>
kSafetyCheckNotificationPermissionsMinEnagementLimit{
diff --git a/components/autofill/core/browser/autofill_optimization_guide.cc b/components/autofill/core/browser/autofill_optimization_guide.cc
--- a/components/autofill/core/browser/autofill_optimization_guide.cc
+++ b/components/autofill/core/browser/autofill_optimization_guide.cc
@@ -94,6 +94,7 @@ void AutofillOptimizationGuide::OnDidParseForm(
// If we do not have any optimization types to register, do not do anything.
if (!optimization_types.empty()) {
// Register all optimization types that we need based on `form_structure`.
+ if (decider_)
decider_->RegisterOptimizationTypes(
std::vector<optimization_guide::proto::OptimizationType>(
std::move(optimization_types).extract()));
@@ -105,7 +106,7 @@ bool AutofillOptimizationGuide::ShouldBlockSingleFieldSuggestions(
AutofillField* field) const {
// If the field's storable type is `IBAN_VALUE`, check whether IBAN
// suggestions should be blocked based on `url`.
- if (field->Type().GetStorableType() == IBAN_VALUE) {
+ if (decider_ && field->Type().GetStorableType() == IBAN_VALUE) {
optimization_guide::OptimizationGuideDecision decision =
decider_->CanApplyOptimization(
url, optimization_guide::proto::IBAN_AUTOFILL_BLOCKED,
@@ -136,7 +137,7 @@ bool AutofillOptimizationGuide::ShouldBlockFormFieldSuggestion(
if (auto optimization_type =
GetVcnMerchantOptOutOptimizationTypeForCard(card);
- optimization_type != optimization_guide::proto::TYPE_UNSPECIFIED) {
+ decider_ && optimization_type != optimization_guide::proto::TYPE_UNSPECIFIED) {
optimization_guide::OptimizationGuideDecision decision =
decider_->CanApplyOptimization(url, optimization_type,
/*optimization_metadata=*/nullptr);
diff --git a/components/optimization_guide/core/hints_fetcher.cc b/components/optimization_guide/core/hints_fetcher.cc
--- a/components/optimization_guide/core/hints_fetcher.cc
+++ b/components/optimization_guide/core/hints_fetcher.cc
@@ -178,6 +178,7 @@ bool HintsFetcher::FetchOptimizationGuideServiceHints(
const std::string& access_token,
bool skip_cache,
HintsFetchedCallback hints_fetched_callback) {
+ if ((true)) return false;
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK_GT(optimization_types.size(), 0u);
request_context_ = request_context;
diff --git a/components/optimization_guide/core/hints_manager.cc b/components/optimization_guide/core/hints_manager.cc
--- a/components/optimization_guide/core/hints_manager.cc
+++ b/components/optimization_guide/core/hints_manager.cc
@@ -389,6 +389,7 @@ void HintsManager::Shutdown() {
OptimizationGuideDecision
HintsManager::GetOptimizationGuideDecisionFromOptimizationTypeDecision(
OptimizationTypeDecision optimization_type_decision) {
+ if ((true)) return OptimizationGuideDecision::kFalse;
switch (optimization_type_decision) {
case OptimizationTypeDecision::kAllowedByOptimizationFilter:
case OptimizationTypeDecision::kAllowedByHint:
@@ -1097,6 +1098,7 @@ void HintsManager::CanApplyOptimizationOnDemand(
proto::RequestContext request_context,
OnDemandOptimizationGuideDecisionRepeatingCallback callback) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ if ((true)) return; // no consent on bromite
InsertionOrderedSet<GURL> urls_to_fetch;
InsertionOrderedSet<std::string> hosts_to_fetch;
@@ -1387,6 +1389,9 @@ OptimizationTypeDecision HintsManager::CanApplyOptimization(
bool skip_cache,
OptimizationMetadata* optimization_metadata) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ if ((true)) {
+ return OptimizationTypeDecision::kNoHintAvailable;
+ }
ScopedCanApplyOptimizationLogger scoped_logger(
optimization_type, navigation_url, optimization_guide_logger_);
diff --git a/components/optimization_guide/core/optimization_guide_features.cc b/components/optimization_guide/core/optimization_guide_features.cc
--- a/components/optimization_guide/core/optimization_guide_features.cc
+++ b/components/optimization_guide/core/optimization_guide_features.cc
@@ -34,13 +34,6 @@ namespace features {
namespace {
-constexpr auto enabled_by_default_desktop_only =
-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
- base::FEATURE_DISABLED_BY_DEFAULT;
-#else
- base::FEATURE_ENABLED_BY_DEFAULT;
-#endif
-
constexpr auto enabled_by_default_mobile_only =
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
true;
@@ -48,13 +41,6 @@ constexpr auto enabled_by_default_mobile_only =
false;
#endif
-constexpr auto enabled_by_default_ios_only =
-#if BUILDFLAG(IS_IOS)
- base::FEATURE_ENABLED_BY_DEFAULT;
-#else
- base::FEATURE_DISABLED_BY_DEFAULT;
-#endif
-
// Returns whether |locale| is a supported locale for |feature|.
//
// This matches |locale| with the "supported_locales" feature param value in
@@ -149,17 +135,17 @@ std::set<std::string> GetOauthScopesForFeature(const base::Feature& feature) {
// Enables the syncing of the Optimization Hints component, which provides
// hints for what optimizations can be applied on a page load.
BASE_FEATURE(kOptimizationHints,
- "OptimizationHints",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ "OptimizationHints", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
// Enables fetching from a remote Optimization Guide Service.
BASE_FEATURE(kRemoteOptimizationGuideFetching,
- "OptimizationHintsFetching",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ "OptimizationHintsFetching", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
BASE_FEATURE(kRemoteOptimizationGuideFetchingAnonymousDataConsent,
- "OptimizationHintsFetchingAnonymousDataConsent",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ "OptimizationHintsFetchingAnonymousDataConsent", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
// Enables performance info in the context menu and fetching from a remote
// Optimization Guide Service.
@@ -169,33 +155,29 @@ BASE_FEATURE(kContextMenuPerformanceInfoAndRemoteHintFetching,
// Enables the prediction of optimization targets.
BASE_FEATURE(kOptimizationTargetPrediction,
- "OptimizationTargetPrediction",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ "OptimizationTargetPrediction", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
// Enables the downloading of models.
BASE_FEATURE(kOptimizationGuideModelDownloading,
- "OptimizationGuideModelDownloading",
-#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
- base::FEATURE_ENABLED_BY_DEFAULT
-#else // BUILD_WITH_TFLITE_LIB
- base::FEATURE_DISABLED_BY_DEFAULT
-#endif // !BUILD_WITH_TFLITE_LIB
+ "OptimizationGuideModelDownloading", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT // in Bromite
);
// Enables page content to be annotated.
BASE_FEATURE(kPageContentAnnotations,
- "PageContentAnnotations",
- enabled_by_default_desktop_only);
+ "PageContentAnnotations", // disabled
+ base::FEATURE_DISABLED_BY_DEFAULT); // by default
// Enables fetching page metadata from the remote Optimization Guide service.
BASE_FEATURE(kRemotePageMetadata,
- "RemotePageMetadata",
- enabled_by_default_desktop_only);
+ "RemotePageMetadata", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
// Enables the page entities model to be annotated on every page load.
BASE_FEATURE(kPageEntitiesPageContentAnnotations,
- "PageEntitiesPageContentAnnotations",
- enabled_by_default_desktop_only);
+ "PageEntitiesPageContentAnnotations", // disabled
+ base::FEATURE_DISABLED_BY_DEFAULT); // by default
// Enables the page visibility model to be annotated on every page load.
BASE_FEATURE(kPageVisibilityPageContentAnnotations,
"PageVisibilityPageContentAnnotations",
@@ -218,8 +200,8 @@ BASE_FEATURE(kPageEntitiesModelResetOnShutdown,
// Enables push notification of hints.
BASE_FEATURE(kPushNotifications,
- "OptimizationGuidePushNotifications",
- enabled_by_default_ios_only);
+ "OptimizationGuidePushNotifications", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
// This feature flag does not turn off any behavior, it is only used for
// experiment parameters.
@@ -232,21 +214,21 @@ BASE_FEATURE(kOptimizationGuideMetadataValidation,
"OptimizationGuideMetadataValidation",
base::FEATURE_DISABLED_BY_DEFAULT);
-BASE_FEATURE(kPageVisibilityBatchAnnotations,
- "PageVisibilityBatchAnnotations",
- base::FEATURE_ENABLED_BY_DEFAULT);
+BASE_FEATURE(kPageVisibilityBatchAnnotations, // disabled
+ "PageVisibilityBatchAnnotations", // by default
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
BASE_FEATURE(kTextEmbeddingBatchAnnotations,
"TextEmbeddingBatchAnnotations",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kPageContentAnnotationsValidation,
- "PageContentAnnotationsValidation",
- base::FEATURE_DISABLED_BY_DEFAULT);
+ "PageContentAnnotationsValidation", // disabled
+ base::FEATURE_DISABLED_BY_DEFAULT); // by default
BASE_FEATURE(kPreventLongRunningPredictionModels,
"PreventLongRunningPredictionModels",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kOptimizationGuideUseContinueOnShutdownForPageContentAnnotations,
"OptimizationGuideUseContinueOnShutdownForPageContentAnnotations",
@@ -276,13 +258,13 @@ BASE_FEATURE(kExtractRelatedSearchesFromPrefetchedZPSResponse,
BASE_FEATURE(kPageContentAnnotationsPersistSalientImageMetadata,
"PageContentAnnotationsPersistSalientImageMetadata",
- enabled_by_default_desktop_only);
+ base::FEATURE_DISABLED_BY_DEFAULT);
// Killswitch for fetching on search results from a remote Optimization Guide
// Service.
BASE_FEATURE(kOptimizationGuideFetchingForSRP,
- "OptimizationHintsFetchingSRP",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ "OptimizationHintsFetchingSRP", // disabled
+ base::FEATURE_DISABLED_BY_DEFAULT); // by default
// Enables the model store to save relative paths computed from the base model
// store dir. Storing as relative path in the model store is needed for IOS,
@@ -566,7 +548,7 @@ size_t MaxURLKeyedHintCacheSize() {
bool ShouldPersistHintsToDisk() {
return GetFieldTrialParamByFeatureAsBool(kOptimizationHints,
- "persist_hints_to_disk", true);
+ "persist_hints_to_disk", false);
}
bool ShouldEnablePersonalizedMetadata(proto::RequestContext request_context) {
diff --git a/components/optimization_guide/core/prediction_model_download_manager.cc b/components/optimization_guide/core/prediction_model_download_manager.cc
--- a/components/optimization_guide/core/prediction_model_download_manager.cc
+++ b/components/optimization_guide/core/prediction_model_download_manager.cc
@@ -47,7 +47,7 @@ constexpr char kGoogApiKey[] = "X-Goog-Api-Key";
// we require models to come from.
constexpr uint8_t kPublisherKeyHash[] = {
0x66, 0xa1, 0xd9, 0x3e, 0x4e, 0x5a, 0x66, 0x8a, 0x0f, 0xd3, 0xfa,
- 0xa3, 0x70, 0x71, 0x42, 0x16, 0x0d, 0x2d, 0x68, 0xb0, 0x53, 0x02,
+ 0x01, 0x02, 0x03, 0x04, 0x16, 0x0d, 0x2d, 0x68, 0xb0, 0x53, 0x02,
0x5c, 0x7f, 0xd0, 0x0c, 0xa1, 0x6e, 0xef, 0xdd, 0x63, 0x7a};
const net::NetworkTrafficAnnotationTag
kOptimizationGuidePredictionModelsTrafficAnnotation =
@@ -104,7 +104,7 @@ PredictionModelDownloadManager::PredictionModelDownloadManager(
GetBaseModelDirForDownloadCallback get_base_model_dir_for_download_callback,
scoped_refptr<base::SequencedTaskRunner> background_task_runner)
: download_service_(download_service),
- is_available_for_downloads_(true),
+ is_available_for_downloads_(false),
api_key_(features::GetOptimizationGuideServiceAPIKey()),
get_base_model_dir_for_download_callback_(
get_base_model_dir_for_download_callback),
@@ -115,6 +115,7 @@ PredictionModelDownloadManager::~PredictionModelDownloadManager() = default;
void PredictionModelDownloadManager::StartDownload(
const GURL& download_url,
proto::OptimizationTarget optimization_target) {
+ if ((true)) return;
download::DownloadParams download_params;
download_params.client =
download::DownloadClient::OPTIMIZATION_GUIDE_PREDICTION_MODELS;
@@ -260,6 +261,7 @@ bool PredictionModelDownloadManager::VerifyDownload(
const base::FilePath& download_file_path,
const base::FilePath& base_model_dir,
bool delete_file_on_error) {
+ if ((true)) return false;
if (!switches::ShouldSkipModelDownloadVerificationForTesting()) {
// Verify that the |download_file_path| contains a valid CRX file.
std::string public_key;
diff --git a/components/optimization_guide/core/prediction_model_fetcher_impl.cc b/components/optimization_guide/core/prediction_model_fetcher_impl.cc
--- a/components/optimization_guide/core/prediction_model_fetcher_impl.cc
+++ b/components/optimization_guide/core/prediction_model_fetcher_impl.cc
@@ -50,6 +50,7 @@ bool PredictionModelFetcherImpl::FetchOptimizationGuideServiceModels(
proto::RequestContext request_context,
const std::string& locale,
ModelsFetchedCallback models_fetched_callback) {
+ if ((true)) return false;
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (url_loader_)
diff --git a/components/optimization_guide/features.gni b/components/optimization_guide/features.gni
--- a/components/optimization_guide/features.gni
+++ b/components/optimization_guide/features.gni
@@ -11,8 +11,7 @@ declare_args() {
# This enables build with TFLite library.
# TODO(b/269198471): Make sure the internal archive files for opt guide get
# updated when win arm64 gets added as a supported platform for TFLite.
- build_with_tflite_lib = is_android || is_win || is_linux || is_mac ||
- is_chromeos || is_fuchsia || is_ios
+ build_with_tflite_lib = false
}
declare_args() {
diff --git a/components/permissions/features.cc b/components/permissions/features.cc
--- a/components/permissions/features.cc
+++ b/components/permissions/features.cc
@@ -93,24 +93,24 @@ BASE_FEATURE(kFailFastQuietChip,
// When enabled, use the value of the `service_url` FeatureParam as the url
// for the Web Permission Predictions Service.
BASE_FEATURE(kPermissionPredictionServiceUseUrlOverride,
- "kPermissionPredictionServiceUseUrlOverride",
- base::FEATURE_DISABLED_BY_DEFAULT);
+ "kPermissionPredictionServiceUseUrlOverride", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
BASE_FEATURE(kPermissionOnDeviceNotificationPredictions,
- "PermissionOnDeviceNotificationPredictions",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ "PermissionOnDeviceNotificationPredictions", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
BASE_FEATURE(kPermissionOnDeviceGeolocationPredictions,
- "PermissionOnDeviceGeolocationPredictions",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ "PermissionOnDeviceGeolocationPredictions", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
BASE_FEATURE(kPermissionDedicatedCpssSetting,
"PermissionDedicatedCpssSettings",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kPermissionPredictionsV2,
- "PermissionPredictionsV2",
- base::FEATURE_DISABLED_BY_DEFAULT);
+ "PermissionPredictionsV2", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
#if BUILDFLAG(IS_ANDROID)
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -1217,12 +1217,8 @@ BASE_FEATURE(kMemoryCacheStrongReferenceSingleUnload,
// in the first viewport after the page load and the metrics of the clicked
// anchor element will be extracted and recorded.
BASE_FEATURE(kNavigationPredictor,
- "NavigationPredictor",
-#if BUILDFLAG(IS_ANDROID)
- base::FEATURE_ENABLED_BY_DEFAULT
-#else
- base::FEATURE_DISABLED_BY_DEFAULT
-#endif
+ "NavigationPredictor", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT // in Bromite
);
BASE_FEATURE(kNewBaseUrlInheritanceBehavior,
@@ -1359,8 +1355,8 @@ BASE_FEATURE(kPrefetchPrivacyChanges,
base::FEATURE_ENABLED_BY_DEFAULT); // in Bromite
BASE_FEATURE(kPreloadingHeuristicsMLModel,
- "PreloadingHeuristicsMLModel",
- base::FEATURE_DISABLED_BY_DEFAULT);
+ "PreloadingHeuristicsMLModel", // must be disabled
+ base::FEATURE_DISABLED_BY_DEFAULT); // in cromite
BASE_FEATURE(kPrerender2InNewTab,
"Prerender2InNewTab",
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -3014,7 +3014,7 @@
{
// https://crbug.com/1126305
name: "Prerender2",
- status: "stable",
+ status: "test",
},
{
name: "Presentation",
--
2.25.1