Skip to content

Rebase to 148#2888

Merged
uazo merged 13 commits into
masterfrom
next-148
May 19, 2026
Merged

Rebase to 148#2888
uazo merged 13 commits into
masterfrom
next-148

Conversation

@uazo

@uazo uazo commented May 8, 2026

Copy link
Copy Markdown
Owner

Description

Rebase to v148

All submissions

  • there are no other open Pull Requests for the same update/change
  • Cromite can be built with these changes
  • I have tested that the new change works as intended (AVD or physical device will do)

Format

  • patch subject and filename match (e.g. Subject: Alternative cache (NIK-based) -> Alternative-cache-NIK-based.patch)
  • patch description contains explanation of changes
  • no unnecessary whitespace or unrelated changes

@alk3pInjection

alk3pInjection commented May 17, 2026

Copy link
Copy Markdown

as usual I'm rebuilding cromite for desktop and found some minor issues to be patched
(yes, I know v148 rebase is still a work in progress, just leave some random findings here in case someone else also tries to work on this branch)

+if (false /*build_with_tflite_lib*/) {

^^

and (probably) a left-behind

--- i/services/on_device_model/ml/BUILD.gn
+++ w/services/on_device_model/ml/BUILD.gn
@@ -84,7 +84,7 @@ if (use_blink || (is_ios && build_with_internal_optimization_guide)) {
     if (use_blink) {
       deps += [ "//gpu/config" ]
     }
-    if (!is_fuchsia) {
+    if (false) {
       deps += [ "//services/on_device_model/safety:bert_safety_model" ]
     }
     public_deps = [

diff --git a/chrome/browser/profile_resetter/BUILD.gn b/chrome/browser/profile_resetter/BUILD.gn
--- a/chrome/browser/profile_resetter/BUILD.gn
+++ b/chrome/browser/profile_resetter/BUILD.gn
@@ -122,7 +122,6 @@ if (!is_android) {
deps = [
":impl",
"//chrome/browser/browsing_data:constants",
- "//chrome/browser/google",
"//chrome/browser/search/background",
"//chrome/browser/search_engines",
"//chrome/test:test_support",

might need to sed '\|//chrome/browser/google|d' on this gn file

../../net/socket/client_socket_pool_manager.cc:177:40: error: no member named 'NORMAL_SOCKET_POOL' in 'net::HttpNetworkSession'
  177 |   if (pool_type == HttpNetworkSession::NORMAL_SOCKET_POOL) {
      |                                        ^~~~~~~~~~~~~~~~~~
1 error generated.

https://chromium-review.googlesource.com/c/7663453

../../net/socket/ssl_client_socket_impl.cc:315:34: error: no matching function for call to 'HexEncode'
  315 |             << " sessionid: " << base::HexEncode(session_id, len)
      |                                  ^~~~~~~~~~~~~~~
../../base/strings/string_number_conversions.h:117:25: note: candidate function not viable: requires single argument 'bytes', but 2 arguments were provided
  117 | BASE_EXPORT std::string HexEncode(base::span<const uint8_t> bytes);
      |                         ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/strings/string_number_conversions.h:118:25: note: candidate function not viable: requires single argument 'chars', but 2 arguments were provided
  118 | BASE_EXPORT std::string HexEncode(std::string_view chars);
      |                         ^         ~~~~~~~~~~~~~~~~~~~~~~
../../net/socket/ssl_client_socket_impl.cc:316:44: error: no matching function for call to 'HexEncode'
  316 |             << (ticklen > 0 ? " ticket:" + base::HexEncode(ticket, ticklen) : "");
      |                                            ^~~~~~~~~~~~~~~
../../base/strings/string_number_conversions.h:117:25: note: candidate function not viable: requires single argument 'bytes', but 2 arguments were provided
  117 | BASE_EXPORT std::string HexEncode(base::span<const uint8_t> bytes);
      |                         ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/strings/string_number_conversions.h:118:25: note: candidate function not viable: requires single argument 'chars', but 2 arguments were provided
  118 | BASE_EXPORT std::string HexEncode(std::string_view chars);
      |                         ^         ~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

https://chromium-review.googlesource.com/c/7707499

../../net/http/transport_security_state.cc:110:12: error: no member named 'IsFullyPopulated' in 'net::NetworkAnonymizationKey'
  110 |   if (!nak.IsFullyPopulated() || nak.IsTransient())
      |        ~~~ ^
1 error generated.

https://chromium-review.googlesource.com/c/7663799

In file included from ../../components/content_settings/core/common/features.cc:71:
In file included from gen/cromite_flags/components_content_settings_core_common_features_cc.inc:2:
../../third_party/abseil-cpp/../../cromite_flags/components/content_settings/core/common/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc:3:30: error: use of undeclared identifier 'kTpcdHeuristicsGrants'
    3 | SET_CROMITE_FEATURE_DISABLED(kTpcdHeuristicsGrants);
      |                              ^~~~~~~~~~~~~~~~~~~~~
../../third_party/abseil-cpp/../../cromite_flags/components/content_settings/core/common/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc:4:30: error: use of undeclared identifier 'kNativeUnpartitionedStoragePermittedWhen3PCOff'
    4 | SET_CROMITE_FEATURE_DISABLED(kNativeUnpartitionedStoragePermittedWhen3PCOff);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

may revisit the cookie partitioning patch later

+SET_CROMITE_FEATURE_DISABLED(kWebAuthnImmediateGetAutoselect);

do we still need this?

diff --git a/cromite_flags/chrome/common/chrome_features_cc/Enable-Certificate-Transparency.inc b/cromite_flags/chrome/common/chrome_features_cc/Enable-Certificate-Transparency.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/chrome/common/chrome_features_cc/Enable-Certificate-Transparency.inc
@@ -0,0 +1,2 @@
+SET_CROMITE_FEATURE_DISABLED(kSCTAuditing);
+SET_CROMITE_FEATURE_DISABLED(kSCTAuditingHashdance);

ditto

+ return String::FromUTF8(version_str);

String::FromUtf8

diff --git a/components/autofill/core/browser/foundations/autofill_manager.cc b/components/autofill/core/browser/foundations/autofill_manager.cc
--- a/components/autofill/core/browser/foundations/autofill_manager.cc
+++ b/components/autofill/core/browser/foundations/autofill_manager.cc
@@ -35,8 +35,8 @@
#include "components/autofill/core/browser/logging/log_manager.h"
#include "components/autofill/core/browser/metrics/form_interactions_ukm_logger.h"
#include "components/autofill/core/browser/metrics/quality_metrics.h"
-#include "components/autofill/core/browser/ml_model/field_classification_model_handler.h"
-#include "components/autofill/core/browser/ml_model/model_predictions.h"
+// #include "components/autofill/core/browser/ml_model/field_classification_model_handler.h"
+// #include "components/autofill/core/browser/ml_model/model_predictions.h"
#include "components/autofill/core/browser/suggestions/suggestion_hiding_reason.h"
#include "components/autofill/core/browser/suggestions/suggestion_util.h"
#include "components/autofill/core/common/autofill_constants.h"
@@ -137,8 +137,10 @@ struct AutofillManager::AsyncContext {
std::vector<FormData> forms;
std::vector<RegexPredictions> regex_predictions;
+#if false /*BUILDFLAG(BUILD_WITH_TFLITE_LIB)*/
std::vector<ModelPredictions> autofill_predictions;
std::vector<ModelPredictions> password_manager_predictions;
+#endif

may no-op AutofillManager::RunMlModels() as well

../../content/browser/webauth/authenticator_common_impl.cc:2050:42: error: no member named 'AllowWebBluetooth' in 'content::ContentBrowserClient'
 2050 |   switch (GetContentClient()->browser()->AllowWebBluetooth(
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
../../content/browser/webauth/authenticator_common_impl.cc:2053:32: error: no member named 'AllowWebBluetoothResult' in 'content::ContentBrowserClient'
 2053 |     case ContentBrowserClient::AllowWebBluetoothResult::BLOCK_POLICY:
      |          ~~~~~~~~~~~~~~~~~~~~~~^
../../content/browser/webauth/authenticator_common_impl.cc:2054:32: error: no member named 'AllowWebBluetoothResult' in 'content::ContentBrowserClient'
 2054 |     case ContentBrowserClient::AllowWebBluetoothResult::BLOCK_GLOBALLY_DISABLED:
      |          ~~~~~~~~~~~~~~~~~~~~~~^
../../content/browser/webauth/authenticator_common_impl.cc:2057:32: error: no member named 'AllowWebBluetoothResult' in 'content::ContentBrowserClient'
 2057 |     case ContentBrowserClient::AllowWebBluetoothResult::ALLOW:
      |          ~~~~~~~~~~~~~~~~~~~~~~^
4 errors generated.

https://chromium-review.googlesource.com/c/chromium/src/+/7683694/5/content/browser/bluetooth/web_bluetooth_service_impl.cc

../../components/page_content_annotations/core/page_content_annotations_service.h:243:72: error: only virtual member functions can be marked 'override'
  243 |                               const std::vector<Category>& categories) override;
      |                                                                        ^~~~~~~~
../../components/page_content_annotations/core/page_content_annotations_service.cc:213:49: error: cannot initialize a parameter of type 'Observer *' with an rvalue of type 'page_content_annotations::PageContentAnnotationsService *'
  213 |     on_device_category_classifier_->AddObserver(this);
      |                                                 ^~~~
../../components/page_content_annotations/core/on_device_category_classifier.h:55:30: note: passing argument to parameter 'observer' here
   55 |   void AddObserver(Observer* observer);
      |                              ^
../../components/page_content_annotations/core/page_content_annotations_service.cc:231:52: error: cannot initialize a parameter of type 'Observer *' with an rvalue of type 'page_content_annotations::PageContentAnnotationsService *'
  231 |     on_device_category_classifier_->RemoveObserver(this);
      |                                                    ^~~~
../../components/page_content_annotations/core/on_device_category_classifier.h:56:33: note: passing argument to parameter 'observer' here
   56 |   void RemoveObserver(Observer* observer);
      |                                 ^
3 errors generated.

diff --git a/components/page_content_annotations/core/page_content_annotations_service.h b/components/page_content_annotations/core/page_content_annotations_service.h
--- a/components/page_content_annotations/core/page_content_annotations_service.h
+++ b/components/page_content_annotations/core/page_content_annotations_service.h
@@ -126,8 +126,11 @@ enum class PageContentAnnotationsType {
class PageContentAnnotationsService
: public KeyedService,
public history::HistoryServiceObserver,
- public ZeroSuggestCacheServiceInterface::Observer,
- public OnDeviceCategoryClassifier::Observer {
+ public ZeroSuggestCacheServiceInterface::Observer
+#if false /*BUILDFLAG(BUILD_WITH_TFLITE_LIB)*/
+ , public OnDeviceCategoryClassifier::Observer
+#endif
+ {

may keep this inheritance declaration?

../../components/omnibox/browser/autocomplete_controller.cc:2673:5: error: use of undeclared identifier 'RecordScoringSignalCoverageForProvider'
 2673 |     RecordScoringSignalCoverageForProvider(match.scoring_signals.value(),
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../components/omnibox/browser/autocomplete_controller.cc:2697:3: error: use of undeclared identifier 'RecordTotalMatchesScored'
 2697 |   RecordTotalMatchesScored(ml_scores.size());
      |   ^~~~~~~~~~~~~~~~~~~~~~~~
../../components/omnibox/browser/autocomplete_controller.cc:2700:3: error: use of undeclared identifier 'RecordMlScoringElapsedTime'
 2700 |   RecordMlScoringElapsedTime(elapsed_timer.Elapsed());
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../components/omnibox/browser/autocomplete_controller.cc:2754:3: error: use of undeclared identifier 'RecordMlScoreCoverage'
 2754 |   RecordMlScoreCoverage(score_coverage_count, ml_scores.size());
      |   ^~~~~~~~~~~~~~~~~~~~~
12 errors generated.

+#if false /*BUILDFLAG(BUILD_WITH_TFLITE_LIB)*/
void RecordMlScoreCoverage(size_t matches_with_non_null_scores,
size_t total_scored_matches) {
int percent_score_coverage =
@@ -238,6 +241,7 @@ void RecordTotalMatchesScored(size_t num_scored) {
base::UmaHistogramCounts1000("Omnibox.URLScoringModelExecuted.Matches",
num_scored);
}
+#endif

ditto
or no-op these helper functions?

../../components/skills/internal/skills_downloader.h:14:10: fatal error: 'components/skills/proto/skill.pb.h' file not found
   14 | #include "components/skills/proto/skill.pb.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

- "//components/skills/public",
+ #"//components/skills/public",

- "//components/skills/public",
+ #"//components/skills/public",

ditto

../../chrome/browser/autofill/autofill_field_classification_model_service_factory.cc:66:15: note: in instantiation of function template specialization 'std::make_unique<autofill::FieldClassificationModelHandler, OptimizationGuideKeyedService *&, optimization_guide::proto::OptimizationTarget, autofill::MlLogRouter *&, 0>' requested here
   66 |   return std::make_unique<FieldClassificationModelHandler>(
      |               ^
../../components/autofill/core/browser/ml_model/field_classification_model_handler.h:54:3: note: candidate constructor not viable: requires 2 arguments, but 3 were provided
   54 |   FieldClassificationModelHandler(
      |   ^
   55 |       optimization_guide::OptimizationGuideModelProvider* model_provider,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   56 |       optimization_guide::proto::OptimizationTarget optimization_target);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../components/autofill/core/browser/ml_model/field_classification_model_handler.h:40:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 3 were provided
   40 | class FieldClassificationModelHandler
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
--- i/chrome/browser/autofill/autofill_field_classification_model_service_factory.cc
+++ w/chrome/browser/autofill/autofill_field_classification_model_service_factory.cc
@@ -61,13 +61,10 @@ std::unique_ptr<KeyedService> AutofillFieldClassificationModelServiceFactory::
   OptimizationGuideKeyedService* optimization_guide =
       OptimizationGuideKeyedServiceFactory::GetForProfile(
           Profile::FromBrowserContext(context));
-  MlLogRouter* log_router = MlLogRouterFactory::GetForProfile(
-          Profile::FromBrowserContext(context));
   return std::make_unique<FieldClassificationModelHandler>(
       optimization_guide,
       optimization_guide::proto::OptimizationTarget::
-          OPTIMIZATION_TARGET_AUTOFILL_FIELD_CLASSIFICATION,
-      log_router);
+          OPTIMIZATION_TARGET_AUTOFILL_FIELD_CLASSIFICATION);
 }

 }  // namespace autofill
--- i/chrome/browser/password_manager/password_field_classification_model_handler_factory.cc
+++ w/chrome/browser/password_manager/password_field_classification_model_handler_factory.cc
@@ -102,11 +102,8 @@ std::unique_ptr<KeyedService> PasswordFieldClassificationModelHandlerFactory::
   Profile* profile = Profile::FromBrowserContext(context);
   OptimizationGuideKeyedService* optimization_guide =
       OptimizationGuideKeyedServiceFactory::GetForProfile(profile);
-  autofill::MlLogRouter* log_router =
-      autofill::MlLogRouterFactory::GetForProfile(profile);
   return std::make_unique<autofill::FieldClassificationModelHandler>(
       optimization_guide,
       optimization_guide::proto::OptimizationTarget::
-          OPTIMIZATION_TARGET_PASSWORD_MANAGER_FORM_CLASSIFICATION,
-      log_router);
+          OPTIMIZATION_TARGET_PASSWORD_MANAGER_FORM_CLASSIFICATION);
 }

- } else {
- // We encode the type of doodle (regular or gray) in the URL so that the
- // logo cache gets cleared when that value changes.
- GURL prefilled_url = AppendPreliminaryParamsToDoodleURL(
want_gray_logo_getter_.Run(), for_webui_ntp, enable_animated_logo,
doodle_url);
- SetServerAPI(
- prefilled_url,
- base::BindRepeating(&search_provider_logos::ParseDoodleLogoResponse,
- base_url),
- base::BindRepeating(
- &search_provider_logos::AppendFingerprintParamToDoodleURL));
}

L1790-L1791 might be removed as well

+ LOG(INFO) << "Extension " << extension.id() << " is not auto updateable: "
+ << "location=" << extension.location();

should use arrow operator here

diff --git a/chrome/browser/permissions/prediction_service/prediction_model_handler_provider.cc b/chrome/browser/permissions/prediction_service/prediction_model_handler_provider.cc
--- a/chrome/browser/permissions/prediction_service/prediction_model_handler_provider.cc
+++ b/chrome/browser/permissions/prediction_service/prediction_model_handler_provider.cc
@@ -12,9 +12,12 @@
#include "build/build_config.h"
#include "components/optimization_guide/core/delivery/optimization_guide_model_provider.h"
#include "components/permissions/features.h"
-#include "components/permissions/prediction_service/permissions_aiv4_handler.h"
+
+#if false /*BUILDFLAG(BUILD_WITH_TFLITE_LIB)*/
+#include "components/permissions/prediction_service/permissions_aiv3_handler.h"
#include "components/permissions/prediction_service/prediction_model_handler.h"
-#include "components/permissions/request_type.h"
+#include "components/permissions/prediction_service/permissions_aiv4_handler.h"
+#endif
#if BUILDFLAG(IS_ANDROID)
#include "components/download/public/background_service/download_params.h"
@@ -26,6 +29,7 @@ using optimization_guide::proto::OptimizationTarget;
namespace {
+#if false /*BUILDFLAG(BUILD_WITH_TFLITE_LIB)*/
inline OptimizationTarget getGeolocationAiv4OptTarget() {
#if BUILDFLAG(IS_ANDROID)
return OptimizationTarget::
@@ -44,6 +48,7 @@ inline OptimizationTarget getNotificationsAiv4OptTarget() {
OPTIMIZATION_TARGET_PERMISSIONS_AIV4_NOTIFICATIONS_DESKTOP;
#endif
}
+#endif
} // namespace
@@ -51,7 +56,10 @@ PredictionModelHandlerProvider::PredictionModelHandlerProvider(
optimization_guide::OptimizationGuideModelProvider* optimization_guide,
passage_embeddings::EmbedderMetadataProvider* embedder_metadata_provider,
passage_embeddings::Embedder* passage_embedder)
- : passage_embedder_(passage_embedder) {
+#if false /*BUILDFLAG(BUILD_WITH_TFLITE_LIB)*/
+ : passage_embedder_(passage_embedder)
+#endif
+ {
VLOG(1) << "[PermissionsAI] PredictionModelHandlerProvider ctor "
"passage_embedder available: "
<< (passage_embedder ? "true" : "false");
diff --git a/chrome/browser/permissions/prediction_service/prediction_model_handler_provider.h b/chrome/browser/permissions/prediction_service/prediction_model_handler_provider.h
--- a/chrome/browser/permissions/prediction_service/prediction_model_handler_provider.h
+++ b/chrome/browser/permissions/prediction_service/prediction_model_handler_provider.h
@@ -54,9 +54,11 @@ class PredictionModelHandlerProvider
passage_embeddings::Embedder* passage_embedder_);
private:
+#if false /*BUILDFLAG(BUILD_WITH_TFLITE_LIB)*/
// EmbedderMetadataObserver:
void EmbedderMetadataUpdated(
passage_embeddings::EmbedderMetadata metadata) override;
+#endif
// LINT.IfChange(ModelHandlers)
std::unique_ptr<PredictionModelHandler>

broken; might just hardcode IsAIv4FeatureEnabled() to false and disable other feature flags as well

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
@@ -7,6 +7,7 @@
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service.h"
#include "chrome/browser/navigation_predictor/preloading_model_handler.h"
+#if false /*BUILDFLAG(BUILD_WITH_TFLITE_LIB)*/
namespace {
// The model takes all of its inputs as floats, so this is a convenience
@@ -24,6 +25,7 @@ constexpr float ToInput(base::TimeDelta val) {
static_assert(1.0f == ToInput(true));
} // namespace
+#endif

the templated helper function looks harmless; I think we eventually need a better way to gracefully stub out the slop with minimal and forward-portable changes

void PrivacySandboxServiceImpl::LogPrivacySandboxState() {
+ if ((true)) return true;

:p

+ # "ml_model/logging/ml_log_router.cc",
+ # "ml_model/logging/ml_log_router.h",

might disable ml_log_router_factory.* as well and

--- i/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
+++ w/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
@@ -752,7 +758,9 @@ void ChromeBrowserMainExtraPartsProfiles::
   autofill::AutofillOfferManagerFactory::GetInstance();
   autofill::AutofillOptimizationGuideDeciderFactory::GetInstance();
   autofill::MerchantPromoCodeManagerFactory::GetInstance();
+#if false /* BUILDFLAG(BUILD_WITH_TFLITE_LIB) */
   autofill::MlLogRouterFactory::GetInstance();
+#endif
   autofill::PersonalDataManagerFactory::GetInstance();
   autofill::ValuablesDataManagerFactory::GetInstance();
   autofill::WalletPassAccessManagerFactory::GetInstance();

@uazo
uazo marked this pull request as ready for review May 19, 2026 09:32
@uazo

uazo commented May 19, 2026

Copy link
Copy Markdown
Owner Author

@alk3pInjection My first commit in rebase is never the final one; I only need it to create Docker images for development.

To answer the questions:

  • kWebAuthnImmediateGetAutoselect and kSCTAuditing code have been completely removed.

  • As for what was previously BUILD_WITH_TFLITE_LIB, Google has decided to remove it.
    I’m still unsure whether to simplify that patch by removing the #if statements, as I did for the safe_browsing patch (which is completely inactive even though it’s present in the code). I’ve learnt by now that Google rarely leaves features that use proprietary backends enabled by default in Chromium, but it’s worth checking, a risk assessment should be carried out regarding whether to keep them, and the APK size (which is perhaps the most important thing) should also be checked.

@uazo
uazo merged commit 73bd3f7 into master May 19, 2026
1 check passed
@uazo
uazo deleted the next-148 branch May 19, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants