565 lines
28 KiB
Diff
565 lines
28 KiB
Diff
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 | 2 --
|
|
.../preloading_model_keyed_service.cc | 1 +
|
|
.../preloading_model_keyed_service_factory.cc | 4 +--
|
|
.../chrome_hints_manager.cc | 1 +
|
|
.../model_validator_keyed_service.cc | 7 +++++-
|
|
.../optimization_guide_keyed_service.cc | 1 -
|
|
.../predictors/loading_predictor_config.cc | 4 +--
|
|
.../browser/predictors/predictors_features.cc | 11 ++------
|
|
chrome/browser/ui/tab_helpers.cc | 1 -
|
|
.../ui/webui/omnibox/omnibox_page_handler.cc | 14 +++++++++++
|
|
.../browser/autofill_optimization_guide.cc | 5 ++--
|
|
.../metrics/shadow_prediction_metrics.cc | 2 +-
|
|
.../browser/autocomplete_controller.cc | 2 ++
|
|
.../optimization_guide/core/hints_fetcher.cc | 1 +
|
|
.../optimization_guide/core/hints_manager.cc | 5 ++++
|
|
.../core/optimization_guide_features.cc | 25 +++++++++++--------
|
|
.../core/prediction_model_download_manager.cc | 6 +++--
|
|
.../core/prediction_model_fetcher_impl.cc | 1 +
|
|
components/optimization_guide/features.gni | 3 +--
|
|
.../phishing_classifier.cc | 2 +-
|
|
components/search/ntp_features.cc | 3 +++
|
|
.../Disable-all-predictors-code.inc | 4 +++
|
|
.../Disable-all-predictors-code.inc | 7 ++++++
|
|
.../Disable-all-predictors-code.inc | 4 +++
|
|
.../Disable-all-predictors-code.inc | 2 ++
|
|
.../document_speculation_rules.cc | 1 +
|
|
.../platform/runtime_enabled_features.json5 | 2 +-
|
|
27 files changed, 83 insertions(+), 38 deletions(-)
|
|
create mode 100644 cromite_flags/chrome/browser/browser_features_cc/Disable-all-predictors-code.inc
|
|
create mode 100644 cromite_flags/chrome/common/chrome_features_cc/Disable-all-predictors-code.inc
|
|
create mode 100644 cromite_flags/components/permissions/features_cc/Disable-all-predictors-code.inc
|
|
create mode 100644 cromite_flags/third_party/blink/common/features_cc/Disable-all-predictors-code.inc
|
|
|
|
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
|
--- a/chrome/browser/BUILD.gn
|
|
+++ b/chrome/browser/BUILD.gn
|
|
@@ -851,8 +851,6 @@ static_library("browser") {
|
|
"navigation_predictor/navigation_predictor_keyed_service_factory.h",
|
|
"navigation_predictor/navigation_predictor_metrics_document_data.cc",
|
|
"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_keyed_service.cc",
|
|
"navigation_predictor/preloading_model_keyed_service.h",
|
|
"navigation_predictor/preloading_model_keyed_service_factory.cc",
|
|
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
|
|
@@ -16,6 +16,7 @@ PreloadingModelKeyedService::Inputs::Inputs() = default;
|
|
PreloadingModelKeyedService::PreloadingModelKeyedService(
|
|
OptimizationGuideKeyedService* optimization_guide_keyed_service) {
|
|
#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
|
|
+#error BUILD_WITH_TFLITE_LIB must be disabled
|
|
auto* model_provider =
|
|
static_cast<optimization_guide::OptimizationGuideModelProvider*>(
|
|
optimization_guide_keyed_service);
|
|
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/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 std::optional<NavigationPredictorKeyedService::Prediction>
|
|
prediction) {
|
|
DCHECK(prediction);
|
|
+ if ((true)) return false;
|
|
|
|
if (prediction->prediction_source() !=
|
|
NavigationPredictorKeyedService::PredictionSource::
|
|
diff --git a/chrome/browser/optimization_guide/model_validator_keyed_service.cc b/chrome/browser/optimization_guide/model_validator_keyed_service.cc
|
|
--- a/chrome/browser/optimization_guide/model_validator_keyed_service.cc
|
|
+++ b/chrome/browser/optimization_guide/model_validator_keyed_service.cc
|
|
@@ -8,6 +8,7 @@
|
|
#include "base/files/file_util.h"
|
|
#include "base/task/sequenced_task_runner.h"
|
|
#include "base/task/task_traits.h"
|
|
+#include "base/task/thread_pool.h"
|
|
#include "build/build_config.h"
|
|
#include "chrome/browser/profiles/profile.h"
|
|
#include "chrome/browser/signin/identity_manager_factory.h"
|
|
@@ -55,13 +56,13 @@ namespace optimization_guide {
|
|
ModelValidatorKeyedService::ModelValidatorKeyedService(Profile* profile)
|
|
: profile_(profile) {
|
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
|
+#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
|
|
DCHECK(ShouldStartModelValidator());
|
|
auto* opt_guide_service =
|
|
OptimizationGuideKeyedServiceFactory::GetForProfile(profile);
|
|
if (!opt_guide_service) {
|
|
return;
|
|
}
|
|
-#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
|
|
if (switches::ShouldValidateModel()) {
|
|
// Create the validator object which will get destroyed when the model
|
|
// load is complete.
|
|
@@ -122,6 +123,7 @@ void ModelValidatorKeyedService::OnPrimaryAccountChanged(
|
|
|
|
void ModelValidatorKeyedService::StartModelExecutionValidation() {
|
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
|
+#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
|
|
auto* opt_guide_service =
|
|
OptimizationGuideKeyedServiceFactory::GetForProfile(profile_);
|
|
if (!opt_guide_service) {
|
|
@@ -139,6 +141,7 @@ void ModelValidatorKeyedService::StartModelExecutionValidation() {
|
|
proto::ModelExecutionFeature::MODEL_EXECUTION_FEATURE_TEST, request,
|
|
base::BindOnce(&ModelValidatorKeyedService::OnModelExecuteResponse,
|
|
weak_ptr_factory_.GetWeakPtr()));
|
|
+#endif
|
|
}
|
|
|
|
void ModelValidatorKeyedService::StartOnDeviceModelExecutionValidation(
|
|
@@ -156,6 +159,7 @@ void ModelValidatorKeyedService::StartOnDeviceModelExecutionValidation(
|
|
|
|
void ModelValidatorKeyedService::PerformOnDeviceModelExecutionValidation(
|
|
std::unique_ptr<optimization_guide::proto::ComposeRequest> request) {
|
|
+#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
|
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
|
auto* opt_guide_service =
|
|
OptimizationGuideKeyedServiceFactory::GetForProfile(profile_);
|
|
@@ -168,6 +172,7 @@ void ModelValidatorKeyedService::PerformOnDeviceModelExecutionValidation(
|
|
*request, base::RepeatingCallback(base::BindRepeating(
|
|
&ModelValidatorKeyedService::OnDeviceModelExecuteResponse,
|
|
weak_ptr_factory_.GetWeakPtr())));
|
|
+#endif
|
|
}
|
|
|
|
void ModelValidatorKeyedService::OnDeviceModelExecuteResponse(
|
|
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
|
|
@@ -528,7 +528,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_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
|
|
@@ -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.
|
|
@@ -103,4 +95,5 @@ size_t GetMaxInflightPrefetches() {
|
|
3));
|
|
}
|
|
|
|
+SET_CROMITE_FEATURE_DISABLED(kLoadingPredictorUseLocalPredictions);
|
|
} // namespace features
|
|
diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc
|
|
--- a/chrome/browser/ui/tab_helpers.cc
|
|
+++ b/chrome/browser/ui/tab_helpers.cc
|
|
@@ -414,7 +414,6 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
|
|
}
|
|
MixedContentSettingsTabHelper::CreateForWebContents(web_contents);
|
|
NavigationMetricsRecorder::CreateForWebContents(web_contents);
|
|
- NavigationPredictorPreconnectClient::CreateForWebContents(web_contents);
|
|
OpenerHeuristicTabHelper::CreateForWebContents(web_contents);
|
|
if (optimization_guide::features::IsOptimizationHintsEnabled()) {
|
|
OptimizationGuideWebContentsObserver::CreateForWebContents(web_contents);
|
|
diff --git a/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc b/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc
|
|
--- a/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc
|
|
+++ b/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc
|
|
@@ -39,7 +39,9 @@
|
|
#include "components/omnibox/browser/autocomplete_match.h"
|
|
#include "components/omnibox/browser/autocomplete_provider.h"
|
|
#include "components/omnibox/browser/autocomplete_result.h"
|
|
+#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
|
|
#include "components/omnibox/browser/autocomplete_scoring_model_service.h"
|
|
+#endif
|
|
#include "components/omnibox/browser/omnibox_field_trial.h"
|
|
#include "components/search_engines/template_url.h"
|
|
#include "content/public/browser/web_ui.h"
|
|
@@ -498,6 +500,7 @@ void OmniboxPageHandler::StartOmniboxQuery(const std::string& input_string,
|
|
}
|
|
|
|
void OmniboxPageHandler::GetMlModelVersion(GetMlModelVersionCallback callback) {
|
|
+#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
|
|
if (auto* service = GetMlService()) {
|
|
auto version = service->GetModelVersion();
|
|
if (version == -1) {
|
|
@@ -510,10 +513,14 @@ void OmniboxPageHandler::GetMlModelVersion(GetMlModelVersionCallback callback) {
|
|
} else {
|
|
std::move(callback).Run(-1);
|
|
}
|
|
+#else
|
|
+ std::move(callback).Run(-1);
|
|
+#endif
|
|
}
|
|
|
|
void OmniboxPageHandler::StartMl(mojom::SignalsPtr mojom_signals,
|
|
StartMlCallback callback) {
|
|
+#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
|
|
if (auto* service = GetMlService()) {
|
|
AutocompleteMatch::ScoringSignals signals =
|
|
mojo::ConvertTo<AutocompleteMatch::ScoringSignals>(mojom_signals);
|
|
@@ -523,6 +530,9 @@ void OmniboxPageHandler::StartMl(mojom::SignalsPtr mojom_signals,
|
|
} else {
|
|
std::move(callback).Run(-1);
|
|
}
|
|
+#else
|
|
+ std::move(callback).Run(-1);
|
|
+#endif
|
|
}
|
|
|
|
std::unique_ptr<AutocompleteController> OmniboxPageHandler::CreateController(
|
|
@@ -547,8 +557,12 @@ OmniboxPageHandler::GetAutocompleteControllerType(
|
|
}
|
|
|
|
AutocompleteScoringModelService* OmniboxPageHandler::GetMlService() {
|
|
+#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
|
|
return OmniboxFieldTrial::IsMlUrlScoringEnabled()
|
|
? AutocompleteScoringModelServiceFactory::GetInstance()
|
|
->GetForProfile(profile_)
|
|
: nullptr;
|
|
+#else
|
|
+ return nullptr;
|
|
+#endif
|
|
}
|
|
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
|
|
@@ -163,6 +163,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()));
|
|
@@ -214,7 +215,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,
|
|
@@ -240,7 +241,7 @@ bool AutofillOptimizationGuide::ShouldBlockFormFieldSuggestion(
|
|
const CreditCard* card) const {
|
|
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/autofill/core/browser/metrics/shadow_prediction_metrics.cc b/components/autofill/core/browser/metrics/shadow_prediction_metrics.cc
|
|
--- a/components/autofill/core/browser/metrics/shadow_prediction_metrics.cc
|
|
+++ b/components/autofill/core/browser/metrics/shadow_prediction_metrics.cc
|
|
@@ -74,7 +74,7 @@ void LogRegexShadowPredictions(const AutofillField& field) {
|
|
|
|
void LogMlShadowPredictions(const AutofillField& field) {
|
|
#if !BUILDFLAG(BUILD_WITH_TFLITE_LIB)
|
|
- return;
|
|
+ if ((true)) return;
|
|
#endif
|
|
if (!base::FeatureList::IsEnabled(features::kAutofillModelPredictions)) {
|
|
return;
|
|
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc
|
|
--- a/components/omnibox/browser/autocomplete_controller.cc
|
|
+++ b/components/omnibox/browser/autocomplete_controller.cc
|
|
@@ -47,7 +47,9 @@
|
|
#include "components/omnibox/browser/autocomplete_match_type.h"
|
|
#include "components/omnibox/browser/autocomplete_provider.h"
|
|
#include "components/omnibox/browser/autocomplete_provider_client.h"
|
|
+#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
|
|
#include "components/omnibox/browser/autocomplete_scoring_model_service.h"
|
|
+#endif
|
|
#include "components/omnibox/browser/autocomplete_scoring_signals_annotator.h"
|
|
#include "components/omnibox/browser/bookmark_provider.h"
|
|
#include "components/omnibox/browser/bookmark_scoring_signals_annotator.h"
|
|
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
|
|
@@ -183,6 +183,7 @@ bool HintsFetcher::FetchOptimizationGuideServiceHints(
|
|
bool skip_cache,
|
|
HintsFetchedCallback hints_fetched_callback,
|
|
proto::RequestContextMetadata* request_context_metadata) {
|
|
+ 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
|
|
@@ -390,6 +390,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:
|
|
@@ -1110,6 +1111,7 @@ void HintsManager::CanApplyOptimizationOnDemand(
|
|
OnDemandOptimizationGuideDecisionRepeatingCallback callback,
|
|
proto::RequestContextMetadata* request_context_metadata) {
|
|
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;
|
|
@@ -1416,6 +1418,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, 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
|
|
@@ -37,18 +37,10 @@ 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)
|
|
- base::FEATURE_ENABLED_BY_DEFAULT;
|
|
-#else
|
|
base::FEATURE_DISABLED_BY_DEFAULT;
|
|
-#endif
|
|
|
|
// Returns whether |locale| is a supported locale for |feature|.
|
|
//
|
|
@@ -575,8 +567,7 @@ size_t MaxURLKeyedHintCacheSize() {
|
|
}
|
|
|
|
bool ShouldPersistHintsToDisk() {
|
|
- return GetFieldTrialParamByFeatureAsBool(kOptimizationHints,
|
|
- "persist_hints_to_disk", true);
|
|
+ return false;
|
|
}
|
|
|
|
RequestContextSet GetAllowedContextsForPersonalizedMetadata() {
|
|
@@ -1080,5 +1071,19 @@ bool GetOnDeviceModelRetractRepeats() {
|
|
return kOnDeviceModelRetractRepeats.Get();
|
|
}
|
|
|
|
+SET_CROMITE_FEATURE_DISABLED(kOptimizationHints);
|
|
+SET_CROMITE_FEATURE_DISABLED(kRemoteOptimizationGuideFetching);
|
|
+SET_CROMITE_FEATURE_DISABLED(kRemoteOptimizationGuideFetchingAnonymousDataConsent);
|
|
+SET_CROMITE_FEATURE_DISABLED(kOptimizationTargetPrediction);
|
|
+SET_CROMITE_FEATURE_DISABLED(kOptimizationGuideModelDownloading);
|
|
+SET_CROMITE_FEATURE_DISABLED(kPageContentAnnotations);
|
|
+SET_CROMITE_FEATURE_DISABLED(kRemotePageMetadata);
|
|
+SET_CROMITE_FEATURE_DISABLED(kPageEntitiesPageContentAnnotations);
|
|
+SET_CROMITE_FEATURE_DISABLED(kPushNotifications);
|
|
+SET_CROMITE_FEATURE_DISABLED(kPageVisibilityBatchAnnotations);
|
|
+SET_CROMITE_FEATURE_DISABLED(kPageContentAnnotationsValidation);
|
|
+SET_CROMITE_FEATURE_DISABLED(kPreventLongRunningPredictionModels);
|
|
+SET_CROMITE_FEATURE_DISABLED(kPageContentAnnotationsPersistSalientImageMetadata);
|
|
+SET_CROMITE_FEATURE_DISABLED(kOptimizationGuideFetchingForSRP);
|
|
} // namespace features
|
|
} // namespace optimization_guide
|
|
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/safe_browsing/content/renderer/phishing_classifier/phishing_classifier.cc b/components/safe_browsing/content/renderer/phishing_classifier/phishing_classifier.cc
|
|
--- a/components/safe_browsing/content/renderer/phishing_classifier/phishing_classifier.cc
|
|
+++ b/components/safe_browsing/content/renderer/phishing_classifier/phishing_classifier.cc
|
|
@@ -234,7 +234,7 @@ void PhishingClassifier::VisualExtractionFinished(bool success) {
|
|
*bitmap_, base::BindOnce(&PhishingClassifier::OnVisualTfLiteModelDone,
|
|
weak_factory_.GetWeakPtr(), std::move(verdict)));
|
|
#else
|
|
- RunCallback(*verdict);
|
|
+ //RunCallback(*verdict);
|
|
#endif
|
|
}
|
|
|
|
diff --git a/components/search/ntp_features.cc b/components/search/ntp_features.cc
|
|
--- a/components/search/ntp_features.cc
|
|
+++ b/components/search/ntp_features.cc
|
|
@@ -544,4 +544,7 @@ std::vector<std::string> GetModulesOrder() {
|
|
base::SplitResult::SPLIT_WANT_NONEMPTY);
|
|
}
|
|
|
|
+SET_CROMITE_FEATURE_DISABLED(kNtpHistoryClustersModule);
|
|
+SET_CROMITE_FEATURE_DISABLED(kNtpHistoryClustersModuleLoad);
|
|
+SET_CROMITE_FEATURE_DISABLED(kNtpHistoryClustersModuleUseModelRanking);
|
|
} // namespace ntp_features
|
|
diff --git a/cromite_flags/chrome/browser/browser_features_cc/Disable-all-predictors-code.inc b/cromite_flags/chrome/browser/browser_features_cc/Disable-all-predictors-code.inc
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/cromite_flags/chrome/browser/browser_features_cc/Disable-all-predictors-code.inc
|
|
@@ -0,0 +1,4 @@
|
|
+SET_CROMITE_FEATURE_DISABLED(kOmniboxTriggerForPrerender2);
|
|
+SET_CROMITE_FEATURE_DISABLED(kBookmarkTriggerForPrerender2);
|
|
+SET_CROMITE_FEATURE_DISABLED(kNewTabPageTriggerForPrerender2);
|
|
+SET_CROMITE_FEATURE_DISABLED(kSupportSearchSuggestionForPrerender2);
|
|
diff --git a/cromite_flags/chrome/common/chrome_features_cc/Disable-all-predictors-code.inc b/cromite_flags/chrome/common/chrome_features_cc/Disable-all-predictors-code.inc
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/cromite_flags/chrome/common/chrome_features_cc/Disable-all-predictors-code.inc
|
|
@@ -0,0 +1,7 @@
|
|
+SET_CROMITE_FEATURE_DISABLED(kPrerenderFallbackToPreconnect);
|
|
+
|
|
+#if !BUILDFLAG(IS_ANDROID)
|
|
+
|
|
+SET_CROMITE_FEATURE_DISABLED(kSafetyCheckNotificationPermissions);
|
|
+
|
|
+#endif
|
|
diff --git a/cromite_flags/components/permissions/features_cc/Disable-all-predictors-code.inc b/cromite_flags/components/permissions/features_cc/Disable-all-predictors-code.inc
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/cromite_flags/components/permissions/features_cc/Disable-all-predictors-code.inc
|
|
@@ -0,0 +1,4 @@
|
|
+SET_CROMITE_FEATURE_DISABLED(kPermissionPredictionServiceUseUrlOverride);
|
|
+SET_CROMITE_FEATURE_DISABLED(kPermissionOnDeviceNotificationPredictions);
|
|
+SET_CROMITE_FEATURE_DISABLED(kPermissionOnDeviceGeolocationPredictions);
|
|
+SET_CROMITE_FEATURE_DISABLED(kPermissionPredictionsV2);
|
|
diff --git a/cromite_flags/third_party/blink/common/features_cc/Disable-all-predictors-code.inc b/cromite_flags/third_party/blink/common/features_cc/Disable-all-predictors-code.inc
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/cromite_flags/third_party/blink/common/features_cc/Disable-all-predictors-code.inc
|
|
@@ -0,0 +1,2 @@
|
|
+SET_CROMITE_FEATURE_DISABLED(kNavigationPredictor);
|
|
+SET_CROMITE_FEATURE_DISABLED(kPreloadingHeuristicsMLModel);
|
|
diff --git a/third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc b/third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc
|
|
--- a/third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc
|
|
+++ b/third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc
|
|
@@ -599,6 +599,7 @@ void DocumentSpeculationRules::UpdateSpeculationCandidates() {
|
|
return;
|
|
}
|
|
|
|
+ if ((true)) return;
|
|
HeapVector<Member<SpeculationCandidate>> candidates;
|
|
auto push_candidates = [&candidates, &execution_context](
|
|
mojom::blink::SpeculationAction action,
|
|
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
|
|
@@ -2961,7 +2961,7 @@
|
|
//
|
|
// It also has some feature params defined throughout the codebase.
|
|
name: "Prerender2",
|
|
- status: "stable",
|
|
+ status: "test",
|
|
},
|
|
{
|
|
name: "Presentation",
|
|
--
|