diff --git a/DEPS b/DEPS
index 49d408e..801b3bd 100644
--- a/DEPS
+++ b/DEPS
@@ -304,19 +304,19 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling V8
   # and whatever else without interference from each other.
-  'src_internal_revision': '90370b8a42e7db38af7306d1d21af53b2e28041a',
+  'src_internal_revision': 'a4ccbeaa41c7afd89c02c70fddd5dabaed66e29c',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling Skia
   # and whatever else without interference from each other.
-  'skia_revision': '7f582d05438519650eabfd08a925b94bfb274c6b',
+  'skia_revision': '3bc48d128d4b081bb75a917c51c38f93d5a0e719',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling V8
   # and whatever else without interference from each other.
-  'v8_revision': 'e6d52a000f69b64a37d1d025c90a1dfa5d57330f',
+  'v8_revision': 'c61acc78d87d6796b8555c28ee5026281f543073',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling ANGLE
   # and whatever else without interference from each other.
-  'angle_revision': 'ff0a33cde29d9eea6d835f3fc4b774b5cce4ead3',
+  'angle_revision': 'b0875f124a2459318e974653517f87d8fcbb50c2',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling SwiftShader
   # and whatever else without interference from each other.
@@ -383,7 +383,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling chromium_variations
   # and whatever else without interference from each other.
-  'chromium_variations_revision': 'bc8a8fb5eced2ed99c21b6c2ce00a35e15a73951',
+  'chromium_variations_revision': '56250b5231b96ee47132babec86ee879031020ca',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling CrossBench
   # and whatever else without interference from each other.
@@ -399,7 +399,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling devtools-frontend
   # and whatever else without interference from each other.
-  'devtools_frontend_revision': 'e645aee43e264f05a65f0c6c1ef1d54a0d2e5c3d',
+  'devtools_frontend_revision': '9cc73b5e0315d6e6bc9b7d47458b076c94ed1cc0',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling libprotobuf-mutator
   # and whatever else without interference from each other.
@@ -423,7 +423,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling feed
   # and whatever else without interference from each other.
-  'dawn_revision': '944a68db9491cf72c2adac6a7d7282b5788fff67',
+  'dawn_revision': 'd3bebe6cf996439ed197d1c83e323baf8a9a7135',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling feed
   # and whatever else without interference from each other.
@@ -479,7 +479,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling feed
   # and whatever else without interference from each other.
-  'libcxxabi_revision':    '09737b8e11281840ff019de74a9e576611167ed5',
+  'libcxxabi_revision':    'd17298ab09b44bbc95e5e59c0f285145d0e5f8a7',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling feed
   # and whatever else without interference from each other.
@@ -929,7 +929,7 @@
 
   'src/clank': {
     'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' +
-    '5077b2364a2885c3aea01d603ca1bb1647cc25f4',
+    '86a403cb8a162ba2670eafa8f962ae894531a42b',
     'condition': 'checkout_android and checkout_src_internal',
   },
 
@@ -1298,13 +1298,13 @@
   },
 
   'src/third_party/depot_tools':
-    Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'a60f90e38e53738d3cf115cf0a6c75a0dfef0438',
+    Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '94f42f8fe3fe26b4f321b5b401ac14c065b665ad',
 
   'src/third_party/devtools-frontend/src':
     Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'),
 
   'src/third_party/devtools-frontend-internal': {
-      'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + 'a8efd4e7a62d4e625a5c1e898fa603ac97865d5e',
+      'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + 'b905e0bc023bf72eaccbb36735adc6873ceff486',
     'condition': 'checkout_src_internal',
   },
 
@@ -1837,7 +1837,7 @@
       'packages': [
           {
               'package': 'chromium/third_party/r8',
-              'version': 'NvYmFgaDR5pSbEH88fOJRqBbLZT5maGLr_7_iZD3vg4C',
+              'version': 'a2gKt0z-OOG5sntIiNXVd6LFDWUuvR-rstsrF59EEnIC',
           },
       ],
       'condition': 'checkout_android',
@@ -4150,7 +4150,7 @@
 
   'src/components/autofill/core/browser/form_parsing/internal_resources': {
       'url': Var('chrome_git') + '/chrome/components/autofill_regex_patterns.git' + '@' +
-        '9660b91477518bb99509fe8db257dba2e2d1eec6',
+        'feb267b80dd9df83ce4949470d5b1cc6214cd775',
       'condition': 'checkout_src_internal',
   },
 
@@ -4209,7 +4209,7 @@
 
   'src/components/test/data/autofill/heuristics-json/internal': {
       'url': Var('chrome_git') + '/chrome/test/autofill/structured_forms.git' + '@' +
-        'c239a0f3f47d7c2b4fa57d27344575be171d3099',
+        '9237eb78073f68624f87a51db70a1b5ae04b9537',
       'condition': 'checkout_chromium_autofill_test_dependencies',
   },
 
@@ -4233,7 +4233,7 @@
 
   'src/ios_internal':  {
       'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' +
-        '488e0f6f77db504dcf37d1b56bfecdcf69ca61f2',
+        '07534635e3525a099c739887f43df47df6464f17',
       'condition': 'checkout_ios and checkout_src_internal',
   },
 
diff --git a/ash/public/cpp/input_device_settings_controller.h b/ash/public/cpp/input_device_settings_controller.h
index a7fb1a9..c59da4e5 100644
--- a/ash/public/cpp/input_device_settings_controller.h
+++ b/ash/public/cpp/input_device_settings_controller.h
@@ -69,6 +69,14 @@
     virtual void OnCustomizableMouseObservingStarted(
         const mojom::Mouse& mouse) {}
     virtual void OnCustomizableMouseObservingStopped() {}
+
+    virtual void OnKeyboardBatteryInfoChanged(const mojom::Keyboard& keyboard) {
+    }
+    virtual void OnGraphicsTabletBatteryInfoChanged(
+        const mojom::GraphicsTablet& graphics_tablet) {}
+    virtual void OnMouseBatteryInfoChanged(const mojom::Mouse& mouse) {}
+    virtual void OnTouchpadBatteryInfoChanged(const mojom::Touchpad& touchpad) {
+    }
   };
 
   static InputDeviceSettingsController* Get();
diff --git a/ash/system/input_device_settings/input_device_settings_controller_impl.cc b/ash/system/input_device_settings/input_device_settings_controller_impl.cc
index d97af4a9..a2f6266 100644
--- a/ash/system/input_device_settings/input_device_settings_controller_impl.cc
+++ b/ash/system/input_device_settings/input_device_settings_controller_impl.cc
@@ -2304,6 +2304,46 @@
   }
 }
 
+void InputDeviceSettingsControllerImpl::DispatchKeyboardBatteryInfoChanged(
+    DeviceId id) {
+  CHECK(base::Contains(keyboards_, id));
+  CHECK(features::IsWelcomeExperienceEnabled());
+  const auto& keyboard = *keyboards_.at(id);
+  for (auto& observer : observers_) {
+    observer.OnKeyboardBatteryInfoChanged(keyboard);
+  }
+}
+
+void InputDeviceSettingsControllerImpl::
+    DispatchGraphicsTabletBatteryInfoChanged(DeviceId id) {
+  CHECK(base::Contains(graphics_tablets_, id));
+  CHECK(features::IsWelcomeExperienceEnabled());
+  const auto& graphics_tablet = *graphics_tablets_.at(id);
+  for (auto& observer : observers_) {
+    observer.OnGraphicsTabletBatteryInfoChanged(graphics_tablet);
+  }
+}
+
+void InputDeviceSettingsControllerImpl::DispatchMouseBatteryInfoChanged(
+    DeviceId id) {
+  CHECK(base::Contains(mice_, id));
+  CHECK(features::IsWelcomeExperienceEnabled());
+  const auto& mouse = *mice_.at(id);
+  for (auto& observer : observers_) {
+    observer.OnMouseBatteryInfoChanged(mouse);
+  }
+}
+
+void InputDeviceSettingsControllerImpl::DispatchTouchpadBatteryInfoChanged(
+    DeviceId id) {
+  CHECK(base::Contains(touchpads_, id));
+  CHECK(features::IsWelcomeExperienceEnabled());
+  const auto& touchpad = *touchpads_.at(id);
+  for (auto& observer : observers_) {
+    observer.OnTouchpadBatteryInfoChanged(touchpad);
+  }
+}
+
 void InputDeviceSettingsControllerImpl::RefreshInternalPointingStickSettings() {
   for (auto& [id, pointing_stick] : pointing_sticks_) {
     if (pointing_stick->is_external) {
@@ -2464,24 +2504,28 @@
       updated_battery_info->percentage.value(),
       GetChargeStateFromBluetoothDevice(updated_battery_info->charge_state));
 
-  if (auto* keyboard = FindKeyboard(device_id); keyboard != nullptr) {
-    keyboard->battery_info = std::move(mojom_battery_info);
+  if (auto* kb = FindKeyboard(device_id); kb != nullptr) {
+    kb->battery_info = std::move(mojom_battery_info);
+    DispatchKeyboardBatteryInfoChanged(device_id);
     return;
   }
 
   if (auto* mouse = FindMouse(device_id); mouse != nullptr) {
     mouse->battery_info = std::move(mojom_battery_info);
+    DispatchMouseBatteryInfoChanged(device_id);
     return;
   }
 
   if (auto* touchpad = FindTouchpad(device_id); touchpad != nullptr) {
     touchpad->battery_info = std::move(mojom_battery_info);
+    DispatchTouchpadBatteryInfoChanged(device_id);
     return;
   }
 
   if (auto* graphics_tablet = FindGraphicsTablet(device_id);
       graphics_tablet != nullptr) {
     graphics_tablet->battery_info = std::move(mojom_battery_info);
+    DispatchGraphicsTabletBatteryInfoChanged(device_id);
     return;
   }
 }
diff --git a/ash/system/input_device_settings/input_device_settings_controller_impl.h b/ash/system/input_device_settings/input_device_settings_controller_impl.h
index d5cd288b..9b4b4ee 100644
--- a/ash/system/input_device_settings/input_device_settings_controller_impl.h
+++ b/ash/system/input_device_settings/input_device_settings_controller_impl.h
@@ -178,6 +178,11 @@
       const mojom::GraphicsTablet& graphics_tablet,
       const mojom::Button& button);
 
+  void DispatchKeyboardBatteryInfoChanged(DeviceId id);
+  void DispatchGraphicsTabletBatteryInfoChanged(DeviceId id);
+  void DispatchMouseBatteryInfoChanged(DeviceId id);
+  void DispatchTouchpadBatteryInfoChanged(DeviceId id);
+
   void InitializePolicyHandler();
   void OnKeyboardPoliciesChanged();
   void OnMousePoliciesChanged();
diff --git a/ash/system/input_device_settings/input_device_settings_controller_unittest.cc b/ash/system/input_device_settings/input_device_settings_controller_unittest.cc
index 22a6ead..ca38652 100644
--- a/ash/system/input_device_settings/input_device_settings_controller_unittest.cc
+++ b/ash/system/input_device_settings/input_device_settings_controller_unittest.cc
@@ -443,6 +443,20 @@
     num_mouse_observing_stopped_++;
   }
 
+  void OnKeyboardBatteryInfoChanged(const mojom::Keyboard& keyboard) override {
+    num_keyboard_battery_info_updated_++;
+  }
+  void OnGraphicsTabletBatteryInfoChanged(
+      const mojom::GraphicsTablet& graphics_tablet) override {
+    num_graphics_tablets_battery_info_updated_++;
+  }
+  void OnMouseBatteryInfoChanged(const mojom::Mouse& mouse) override {
+    num_mouse_battery_info_updated_++;
+  }
+  void OnTouchpadBatteryInfoChanged(const mojom::Touchpad& touchpad) override {
+    num_touchpad_battery_info_updated_++;
+  }
+
   uint32_t num_keyboards_connected() { return num_keyboards_connected_; }
   uint32_t num_graphics_tablets_connected() {
     return num_graphics_tablets_connected_;
@@ -469,6 +483,18 @@
   uint32_t num_mouse_observing_stopped() {
     return num_mouse_observing_stopped_;
   }
+  uint32_t num_keyboard_battery_info_updated() {
+    return num_keyboard_battery_info_updated_;
+  }
+  uint32_t num_graphics_tablets_battery_info_updated() {
+    return num_graphics_tablets_battery_info_updated_;
+  }
+  uint32_t num_mouse_battery_info_updated() {
+    return num_mouse_battery_info_updated_;
+  }
+  uint32_t num_touchpad_battery_info_updated() {
+    return num_touchpad_battery_info_updated_;
+  }
 
  private:
   uint32_t num_keyboards_connected_ = 0;
@@ -483,6 +509,10 @@
   uint32_t num_pen_buttons_pressed_ = 0;
   uint32_t num_mouse_observing_started_ = 0;
   uint32_t num_mouse_observing_stopped_ = 0;
+  uint32_t num_keyboard_battery_info_updated_ = 0;
+  uint32_t num_graphics_tablets_battery_info_updated_ = 0;
+  uint32_t num_mouse_battery_info_updated_ = 0;
+  uint32_t num_touchpad_battery_info_updated_ = 0;
 };
 
 class InputDeviceSettingsControllerTest : public NoSessionAshTestBase {
@@ -1828,6 +1858,7 @@
       device::BluetoothDevice::BatteryType::kDefault, 65));
   keyboard = controller_->GetKeyboard(bluetooth_keyboard.id);
   ASSERT_EQ(65, keyboard->battery_info->battery_percentage);
+  ASSERT_EQ(1u, observer_->num_keyboard_battery_info_updated());
 
   // Disconnecting the bluetooth device should remove the corresponding
   // entry from the bluetooth address map.
diff --git a/ash/webui/common/resources/cellular_setup/activation_code_page.html b/ash/webui/common/resources/cellular_setup/activation_code_page.html
index 8b6199f..a3dd0dc 100644
--- a/ash/webui/common/resources/cellular_setup/activation_code_page.html
+++ b/ash/webui/common/resources/cellular_setup/activation_code_page.html
@@ -209,7 +209,7 @@
         <cr-button id="switchCameraButton"
             on-click="onSwitchCameraButtonPressed_"
             hidden$="[[isUiElementHidden_(UiElement.SWITCH_CAMERA, state_, cameraCount_)]]"
-            disabled="[[isUiElementDisabled_(UiElement.SWITCH_CAMERA, state_, showBusy)]]">
+            disabled="[[isUiElementDisabled_(UiElement.SWITCH_CAMERA, state_)]]">
           <iron-icon class="button-image" icon="cellular-setup:switch-camera"></iron-icon>
           [[i18n('switchCamera')]]
         </cr-button>
@@ -226,7 +226,7 @@
           <cr-button class="label"
               id="startScanningButton"
               on-click="startScanning_"
-              disabled="[[isUiElementDisabled_(UiElement.START_SCANNING, state_, showBusy)]]">
+              disabled="[[isUiElementDisabled_(UiElement.START_SCANNING, state_)]]">
             <iron-icon class="button-image" icon="cellular-setup:camera"></iron-icon>
             [[i18n('useCamera')]]
           </cr-button>
@@ -270,7 +270,7 @@
               </div>
               <cr-button id="tryAgainButton" class="blue-icon"
                   on-click="startScanning_"
-                  disabled="[[isUiElementDisabled_(UiElement.SCAN_FAILURE, state_, showBusy)]]">
+                  disabled="[[isUiElementDisabled_(UiElement.SCAN_FAILURE, state_)]]">
                 <iron-icon class="button-image" icon="cellular-setup:try-again"></iron-icon>
                 [[i18n('qrCodeRetry')]]
               </cr-button>
@@ -284,23 +284,16 @@
       <cr-input id="activationCode"
           label="[[i18n('activationCode')]]"
           value="{{activationCode}}"
-          disabled="[[showBusy]]"
           on-keydown="onKeyDown_"
           invalid="[[shouldActivationCodeInputBeInvalid_(state_,
               isActivationCodeInvalidFormat_)]]"
           error-message="[[getInputErrorMessage_()]]"
-          aria-description="[[getInputSubtitle_(showBusy)]]">
-        <template is="dom-if" if="[[showBusy]]">
-          <div slot="suffix">
-            <paper-spinner-lite active>
-            </paper-spinner-lite>
-          </div>
-        </template>
+          aria-description="[[getInputSubtitle_()]]">
       </cr-input>
       <div id="inputSubtitle"
           hidden$="[[shouldActivationCodeInputBeInvalid_(state_,
               isActivationCodeInvalidFormat_)]]">
-        [[getInputSubtitle_(showBusy)]]
+        [[getInputSubtitle_()]]
       </div>
     </div>
   </div>
diff --git a/ash/webui/common/resources/cellular_setup/activation_code_page.ts b/ash/webui/common/resources/cellular_setup/activation_code_page.ts
index 6eaa564..84d72c2 100644
--- a/ash/webui/common/resources/cellular_setup/activation_code_page.ts
+++ b/ash/webui/common/resources/cellular_setup/activation_code_page.ts
@@ -103,15 +103,6 @@
       },
 
       /**
-       * Indicates the UI is busy with an operation and cannot be interacted
-       * with.
-       */
-      showBusy: {
-        type: Boolean,
-        value: false,
-      },
-
-      /**
        * Indicates no profiles were found while scanning.
        */
       showNoProfilesFound: {
@@ -200,7 +191,6 @@
   activationCode: string;
   showError: boolean;
   isFromQrCode: boolean;
-  showBusy: boolean;
   showNoProfilesFound: boolean;
   private state_: PageState;
   private cameraCount_: number;
@@ -648,11 +638,8 @@
     }
   }
 
-  private isUiElementDisabled_(uiElement: UiElement, state: PageState,
-      showBusy: boolean): boolean {
-    if (showBusy) {
-      return true;
-    }
+  private isUiElementDisabled_(uiElement: UiElement, state: PageState):
+      boolean {
     switch (uiElement) {
       case UiElement.SWITCH_CAMERA:
         return state === PageState.SWITCHING_CAM_USER_TO_ENVIRONMENT ||
@@ -682,11 +669,7 @@
     return state === PageState.MANUAL_ENTRY_INSTALL_FAILURE;
   }
 
-  private getInputSubtitle_(showBusy: boolean): string {
-    if (showBusy) {
-      return this.i18n('scanQrCodeLoading');
-    }
-
+  private getInputSubtitle_(): string {
     // Because this string contains '<' and '>' characters, we cannot use i18n
     // methods.
     return loadTimeData.getString('scanQrCodeInputSubtitle');
diff --git a/ash/webui/common/resources/cellular_setup/esim_flow_ui.html b/ash/webui/common/resources/cellular_setup/esim_flow_ui.html
index 524de80..58aa196 100644
--- a/ash/webui/common/resources/cellular_setup/esim_flow_ui.html
+++ b/ash/webui/common/resources/cellular_setup/esim_flow_ui.html
@@ -20,8 +20,7 @@
   <activation-code-page id="activationCodePage" is-from-qr-code="{{isActivationCodeFromQrCode_}}"
       activation-code="{{activationCode_}}"
       show-no-profiles-found="[[noProfilesFound_(pendingProfiles_, pendingProfileProperties_)]]"
-      show-error="{{showError_}}"
-      show-busy="[[shouldShowSubpageBusy_(state_)]]">
+      show-error="{{showError_}}">
   </activation-code-page>
   <setup-loading-page id="profileInstallingPage"
       loading-message="[[i18n('profileInstallingMessage')]]">
diff --git a/ash/webui/common/resources/cellular_setup/esim_flow_ui.ts b/ash/webui/common/resources/cellular_setup/esim_flow_ui.ts
index 4b975f7e..f8be9ef 100644
--- a/ash/webui/common/resources/cellular_setup/esim_flow_ui.ts
+++ b/ash/webui/common/resources/cellular_setup/esim_flow_ui.ts
@@ -718,12 +718,6 @@
     }
   }
 
-  private shouldShowSubpageBusy_(): boolean {
-    return this.state_ === EsimUiState.ACTIVATION_CODE_ENTRY_INSTALLING ||
-        this.state_ === EsimUiState.CONFIRMATION_CODE_ENTRY_INSTALLING ||
-        this.state_ === EsimUiState.PROFILE_SELECTION_INSTALLING;
-  }
-
   private computeHeader_(): string {
     if (this.selectedEsimPageName_ === EsimPageName.FINAL && !this.showError_) {
       return this.i18n('eSimFinalPageSuccessHeader');
diff --git a/ash/webui/print_preview_cros/resources/js/data/destination_constants.ts b/ash/webui/print_preview_cros/resources/js/data/destination_constants.ts
index cecaa36..a26e049 100644
--- a/ash/webui/print_preview_cros/resources/js/data/destination_constants.ts
+++ b/ash/webui/print_preview_cros/resources/js/data/destination_constants.ts
@@ -16,4 +16,5 @@
   displayName: 'Save as PDF',
   printerType: PrinterType.PDF_PRINTER,
   printerManuallySelected: false,
+  printerStatusReason: null,
 };
diff --git a/ash/webui/print_preview_cros/resources/js/data/print_ticket_manager.ts b/ash/webui/print_preview_cros/resources/js/data/print_ticket_manager.ts
index dad9cbc7..b2c9356 100644
--- a/ash/webui/print_preview_cros/resources/js/data/print_ticket_manager.ts
+++ b/ash/webui/print_preview_cros/resources/js/data/print_ticket_manager.ts
@@ -7,7 +7,7 @@
 
 import {createCustomEvent} from '../utils/event_utils.js';
 import {getPrintPreviewPageHandler} from '../utils/mojo_data_providers.js';
-import {type PrintPreviewPageHandler, PrintTicket, SessionContext} from '../utils/print_preview_cros_app_types.js';
+import {PrinterStatusReason, type PrintPreviewPageHandler, PrintTicket, SessionContext} from '../utils/print_preview_cros_app_types.js';
 
 import {DESTINATION_MANAGER_ACTIVE_DESTINATION_CHANGED, DestinationManager} from './destination_manager.js';
 import {DEFAULT_PARTIAL_PRINT_TICKET} from './ticket_constants.js';
@@ -85,6 +85,8 @@
       this.printTicket.printerType = activeDest.printerType;
       this.printTicket.printerManuallySelected =
           activeDest.printerManuallySelected;
+      this.printTicket.printerStatusReason =
+          activeDest.printerStatusReason || PrinterStatusReason.UNKNOWN_REASON;
     }
 
     // TODO(b/323421684): Apply default settings from destination capabilities
@@ -161,6 +163,8 @@
       this.printTicket!.printerType = activeDest.printerType;
       this.printTicket!.printerManuallySelected =
           activeDest.printerManuallySelected;
+      this.printTicket!.printerStatusReason =
+          activeDest.printerStatusReason || PrinterStatusReason.UNKNOWN_REASON;
     }
 
     this.eventTracker.remove(
diff --git a/ash/webui/print_preview_cros/resources/js/data/ticket_constants.ts b/ash/webui/print_preview_cros/resources/js/data/ticket_constants.ts
index 4baa4b7..c39b4f2 100644
--- a/ash/webui/print_preview_cros/resources/js/data/ticket_constants.ts
+++ b/ash/webui/print_preview_cros/resources/js/data/ticket_constants.ts
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import {ColorModel, DuplexMode, MarginType, MediaSize, type PrintTicket, ScalingType} from '../utils/print_preview_cros_app_types.js';
+import {ColorModel, DuplexMode, MarginType, MediaSize, PrinterStatusReason, type PrintTicket, ScalingType} from '../utils/print_preview_cros_app_types.js';
 
 /**
  * @fileoverview
@@ -42,6 +42,7 @@
   pagesPerSheet: 1,
   pageHeight: 0,
   pageWidth: 0,
+  printerStatusReason: PrinterStatusReason.UNKNOWN_REASON,
   rasterizePDF: false,
   scaleFactor: 100,
   scalingType: ScalingType.DEFAULT,
diff --git a/ash/webui/print_preview_cros/resources/js/utils/print_preview_cros_app_types.ts b/ash/webui/print_preview_cros/resources/js/utils/print_preview_cros_app_types.ts
index a520dcf..8d34c15 100644
--- a/ash/webui/print_preview_cros/resources/js/utils/print_preview_cros_app_types.ts
+++ b/ash/webui/print_preview_cros/resources/js/utils/print_preview_cros_app_types.ts
@@ -25,6 +25,9 @@
   // Used for metrics, true when destination manually selected during CrOS
   // preview session.
   printerManuallySelected: boolean;
+
+  // The printer status reason for a local Chrome OS printer.
+  printerStatusReason: PrinterStatusReason|null;
 }
 
 export interface PrintRequestOutcome {
@@ -106,6 +109,29 @@
   CUSTOM = 3,
 }
 
+/**
+ *  These values must be kept in sync with the Reason enum in
+ *  /chromeos/printing/cups_printer_status.h
+ */
+export enum PrinterStatusReason {
+  UNKNOWN_REASON = 0,
+  DEVICE_ERROR = 1,
+  DOOR_OPEN = 2,
+  LOW_ON_INK = 3,
+  LOW_ON_PAPER = 4,
+  NO_ERROR = 5,
+  OUT_OF_INK = 6,
+  OUT_OF_PAPER = 7,
+  OUTPUT_ALMOST_FULL = 8,
+  OUTPUT_FULL = 9,
+  PAPER_JAM = 10,
+  PAUSED = 11,
+  PRINTER_QUEUE_FULL = 12,
+  PRINTER_UNREACHABLE = 13,
+  STOPPED = 14,
+  TRAY_MISSING = 15,
+}
+
 // PrintTicket represents the data required to start print job. Ticket will be
 // used to create a settings dictionary with fields matching the existing Chrome
 // preview print settings for reusability.
@@ -195,6 +221,9 @@
   // otherwise false.
   printerManuallySelected: boolean;
 
+  // Used for metrics. Destination's PrinterStatus when launching print job.
+  printerStatusReason: PrinterStatusReason;
+
   // Printer type used determine correct logic and handler for print job
   // destination.
   printerType: PrinterType;
diff --git a/base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h b/base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h
index 663fd89..4d01be71 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h
@@ -35,7 +35,7 @@
 constexpr bool IsMteEnabled(uint64_t ifunc_hwcap,
                             struct __ifunc_arg_t* ifunc_hw) {
 #if defined(ARCH_CPU_ARM64) && defined(HAS_HW_CAPS) && \
-    BUILDFLAG(HAS_MEMORY_TAGGING)
+    PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   return (ifunc_hwcap & _IFUNC_ARG_HWCAP) && (ifunc_hw->_hwcap2 & HWCAP2_MTE);
 #else
   return false;
diff --git a/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager.cc b/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager.cc
index d3900304..a2d6939 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager.cc
@@ -21,7 +21,7 @@
 #include "partition_alloc/reservation_offset_table.h"
 #include "partition_alloc/thread_isolation/alignment.h"
 
-#if BUILDFLAG(IS_APPLE) || BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if BUILDFLAG(IS_APPLE) || PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 #include <sys/mman.h>
 #endif
 
@@ -40,7 +40,7 @@
 
 }  // namespace
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 namespace {
 
@@ -125,7 +125,7 @@
   PA_CHECK(!(ptr & kSuperPageOffsetMask));
   PA_CHECK(!(length & kSuperPageOffsetMask));
   address_begin_ = ptr;
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   address_end_ = ptr + length;
   PA_DCHECK(address_begin_ < address_end_);
 #endif
@@ -204,7 +204,7 @@
         bit_hint_ = end_bit;
       }
       uintptr_t address = address_begin_ + beg_bit * kSuperPageSize;
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
       PA_DCHECK(address + requested_size <= address_end_);
 #endif
       return address;
@@ -246,7 +246,7 @@
   PA_DCHECK(!(free_size & kSuperPageOffsetMask));
 
   PA_DCHECK(address_begin_ <= address);
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   PA_DCHECK(address + free_size <= address_end_);
 #endif
 
@@ -301,19 +301,19 @@
 bool AddressPoolManager::GetStats(AddressSpaceStats* stats) {
   // Get 64-bit pool stats.
   GetPoolStats(kRegularPoolHandle, &stats->regular_pool_stats);
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   GetPoolStats(kBRPPoolHandle, &stats->brp_pool_stats);
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   if (IsConfigurablePoolAvailable()) {
     GetPoolStats(kConfigurablePoolHandle, &stats->configurable_pool_stats);
   }
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   GetPoolStats(kThreadIsolatedPoolHandle, &stats->thread_isolated_pool_stats);
 #endif
   return true;
 }
 
-#else  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#else  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 static_assert(
     kSuperPageSize % AddressPoolManagerBitmap::kBytesPer1BitOfBRPPoolBitmap ==
@@ -380,7 +380,7 @@
                                   size_t length) {
   ScopedGuard scoped_lock(AddressPoolManagerBitmap::GetLock());
   // When ENABLE_BACKUP_REF_PTR_SUPPORT is off, BRP pool isn't used.
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   if (handle == kBRPPoolHandle) {
     PA_DCHECK(
         (length % AddressPoolManagerBitmap::kBytesPer1BitOfBRPPoolBitmap) == 0);
@@ -412,7 +412,7 @@
               (length >> AddressPoolManagerBitmap::kBitShiftOfBRPPoolBitmap) -
                   AddressPoolManagerBitmap::kGuardBitsOfBRPPoolBitmap);
   } else
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   {
     PA_DCHECK(handle == kRegularPoolHandle);
     PA_DCHECK(
@@ -434,7 +434,7 @@
 
   ScopedGuard scoped_lock(AddressPoolManagerBitmap::GetLock());
   // When ENABLE_BACKUP_REF_PTR_SUPPORT is off, BRP pool isn't used.
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   if (handle == kBRPPoolHandle) {
     PA_DCHECK(
         (length % AddressPoolManagerBitmap::kBytesPer1BitOfBRPPoolBitmap) == 0);
@@ -449,7 +449,7 @@
         (length >> AddressPoolManagerBitmap::kBitShiftOfBRPPoolBitmap) -
             AddressPoolManagerBitmap::kGuardBitsOfBRPPoolBitmap);
   } else
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   {
     PA_DCHECK(handle == kRegularPoolHandle);
     PA_DCHECK(
@@ -520,7 +520,7 @@
   // Get 32-bit pool usage.
   stats->regular_pool_stats.usage =
       CountUsedSuperPages(regular_pool_bits, kRegularPoolBitsPerSuperPage);
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   static_assert(
       kSuperPageSize % AddressPoolManagerBitmap::kBytesPer1BitOfBRPPoolBitmap ==
           0,
@@ -542,11 +542,11 @@
   stats->blocklist_hit_count =
       AddressPoolManagerBitmap::blocklist_hit_count_.load(
           std::memory_order_relaxed);
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   return true;
 }
 
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 void AddressPoolManager::DumpStats(AddressSpaceStatsDumper* dumper) {
   AddressSpaceStats stats{};
@@ -555,7 +555,7 @@
   }
 }
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 // This function just exists to static_assert the layout of the private fields
 // in Pool.
 void AddressPoolManager::AssertThreadIsolatedLayout() {
@@ -566,6 +566,6 @@
   static_assert(alloc_bitset_offset % PA_THREAD_ISOLATED_ALIGN_SZ == 0);
   static_assert(sizeof(AddressPoolManager) % PA_THREAD_ISOLATED_ALIGN_SZ == 0);
 }
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 
 }  // namespace partition_alloc::internal
diff --git a/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager.h b/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager.h
index e1bfe28f..c241616f 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager.h
@@ -59,7 +59,7 @@
   AddressPoolManager(const AddressPoolManager&) = delete;
   AddressPoolManager& operator=(const AddressPoolManager&) = delete;
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   void Add(pool_handle handle, uintptr_t address, size_t length);
   void Remove(pool_handle handle);
 
@@ -69,7 +69,7 @@
 
   // Return the base address of a pool.
   uintptr_t GetPoolBaseAddress(pool_handle handle);
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
   // Reserves address space from the pool.
   uintptr_t Reserve(pool_handle handle,
@@ -99,7 +99,7 @@
 
  private:
   friend class AddressPoolManagerForTesting;
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   // If we use a thread isolated pool, we need to write-protect its metadata.
   // Allow the function to get access to the pool pointer.
   friend void WriteProtectThreadIsolatedGlobals(ThreadIsolationOption);
@@ -113,11 +113,11 @@
   // if PartitionAlloc is wholly unused in this process.)
   bool GetStats(AddressSpaceStats* stats);
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   static void AssertThreadIsolatedLayout();
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
   class Pool {
    public:
@@ -162,14 +162,14 @@
 
     size_t total_bits_ = 0;
     uintptr_t address_begin_ = 0;
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     uintptr_t address_end_ = 0;
 #endif
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
     friend class AddressPoolManager;
     friend void WriteProtectThreadIsolatedGlobals(ThreadIsolationOption);
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   };
 
   PA_ALWAYS_INLINE Pool* GetPool(pool_handle handle) {
@@ -199,7 +199,7 @@
 #endif
   Pool pools_[kNumPools];
 
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
   static PA_CONSTINIT AddressPoolManager singleton_;
 };
diff --git a/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_bitmap.cc b/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_bitmap.cc
index ace3db9..a8f9bc6 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_bitmap.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_bitmap.cc
@@ -25,12 +25,12 @@
     AddressPoolManagerBitmap::regular_pool_bits_;  // GUARDED_BY(GetLock())
 std::bitset<AddressPoolManagerBitmap::kBRPPoolBits>
     AddressPoolManagerBitmap::brp_pool_bits_;  // GUARDED_BY(GetLock())
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 std::array<std::atomic_bool,
            AddressPoolManagerBitmap::kAddressSpaceSize / kSuperPageSize>
     AddressPoolManagerBitmap::brp_forbidden_super_page_map_;
 std::atomic_size_t AddressPoolManagerBitmap::blocklist_hit_count_;
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 }  // namespace partition_alloc::internal
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_bitmap.h b/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_bitmap.h
index 3036330..654a64b5 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_bitmap.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_bitmap.h
@@ -102,7 +102,7 @@
         brp_pool_bits_)[address >> kBitShiftOfBRPPoolBitmap];
   }
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   static void BanSuperPageFromBRPPool(uintptr_t address) {
     brp_forbidden_super_page_map_[address >> kSuperPageShift].store(
         true, std::memory_order_relaxed);
@@ -126,7 +126,7 @@
   }
 
   static void IncrementBlocklistHitCount() { ++blocklist_hit_count_; }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
  private:
   friend class AddressPoolManager;
@@ -136,11 +136,11 @@
   static std::bitset<kRegularPoolBits> regular_pool_bits_
       PA_GUARDED_BY(GetLock());
   static std::bitset<kBRPPoolBits> brp_pool_bits_ PA_GUARDED_BY(GetLock());
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   static std::array<std::atomic_bool, kAddressSpaceSize / kSuperPageSize>
       brp_forbidden_super_page_map_;
   static std::atomic_size_t blocklist_hit_count_;
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 };
 
 }  // namespace internal
@@ -154,7 +154,7 @@
   PA_DCHECK(!internal::AddressPoolManagerBitmap::IsManagedByBRPPool(address));
 #endif
   return internal::AddressPoolManagerBitmap::IsManagedByRegularPool(address)
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
          || internal::AddressPoolManagerBitmap::IsManagedByBRPPool(address)
 #endif
       ;
diff --git a/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_unittest.cc
index 50ccac9..cec16b8 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_unittest.cc
@@ -24,11 +24,12 @@
   void DumpStats(
       const partition_alloc::AddressSpaceStats* address_space_stats) override {
     regular_pool_usage_ = address_space_stats->regular_pool_stats.usage;
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
     regular_pool_largest_reservation_ =
         address_space_stats->regular_pool_stats.largest_available_reservation;
 #endif
-#if !BUILDFLAG(HAS_64_BIT_POINTERS) && BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if !BUILDFLAG(HAS_64_BIT_POINTERS) && \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     blocklist_size_ = address_space_stats->blocklist_size;
 #endif
   }
@@ -38,7 +39,7 @@
   size_t blocklist_size_ = 0;
 };
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 class AddressPoolManagerForTesting : public AddressPoolManager {
  public:
@@ -277,7 +278,7 @@
   ASSERT_EQ(dumper.regular_pool_largest_reservation_, kPageCnt);
 }
 
-#else  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#else  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 TEST(PartitionAllocAddressPoolManagerTest, IsManagedByRegularPool) {
   constexpr size_t kAllocCount = 8;
@@ -327,7 +328,7 @@
   }
 }
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 TEST(PartitionAllocAddressPoolManagerTest, IsManagedByBRPPool) {
   constexpr size_t kAllocCount = 4;
   // Totally (1+3+7+11) * 2MB = 44MB allocation
@@ -375,7 +376,7 @@
     EXPECT_FALSE(AddressPoolManager::IsManagedByBRPPool(addrs[i]));
   }
 }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 TEST(PartitionAllocAddressPoolManagerTest, RegularPoolUsageChanges) {
   AddressSpaceStatsDumperForTesting dumper{};
@@ -400,6 +401,6 @@
   EXPECT_EQ(dumper.regular_pool_usage_, usage_before);
 }
 
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 }  // namespace partition_alloc::internal
diff --git a/base/allocator/partition_allocator/src/partition_alloc/address_space_randomization.cc b/base/allocator/partition_allocator/src/partition_alloc/address_space_randomization.cc
index bc73fc0..64bf3ef 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/address_space_randomization.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/address_space_randomization.cc
@@ -18,7 +18,7 @@
 uintptr_t GetRandomPageBase() {
   uintptr_t random = static_cast<uintptr_t>(internal::RandomValue());
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   random <<= 32ULL;
   random |= static_cast<uintptr_t>(internal::RandomValue());
 
@@ -26,7 +26,7 @@
   // OS and build configuration.
   random &= internal::ASLRMask();
   random += internal::ASLROffset();
-#else  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#else  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 #if BUILDFLAG(IS_WIN)
   // On win32 host systems the randomization plus huge alignment causes
   // excessive fragmentation. Plus most of these systems lack ASLR, so the
@@ -42,7 +42,7 @@
 #endif  // BUILDFLAG(IS_WIN)
   random &= internal::ASLRMask();
   random += internal::ASLROffset();
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
   PA_DCHECK(!(random & internal::PageAllocationGranularityOffsetMask()));
   return random;
diff --git a/base/allocator/partition_allocator/src/partition_alloc/address_space_randomization_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/address_space_randomization_unittest.cc
index 3879f28..e635769 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/address_space_randomization_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/address_space_randomization_unittest.cc
@@ -135,8 +135,8 @@
     return;  // bit is always 0.
   }
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
-  // Do fewer checks when BUILDFLAG(PA_DCHECK_IS_ON). Exercized code only
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
+  // Do fewer checks when PA_BUILDFLAG(PA_DCHECK_IS_ON). Exercized code only
   // changes when the random number generator does, which should be almost
   // never. However it's expensive to run all the tests. So keep iterations
   // faster for local development builds, while having the stricter version run
diff --git a/base/allocator/partition_allocator/src/partition_alloc/address_space_stats.h b/base/allocator/partition_allocator/src/partition_alloc/address_space_stats.h
index 6f69553..f87549e 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/address_space_stats.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/address_space_stats.h
@@ -19,25 +19,25 @@
   // On 32-bit, pools are mainly logical entities, intermingled with
   // allocations not managed by PartitionAlloc. The "largest available
   // reservation" is not possible to measure in that case.
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   size_t largest_available_reservation = 0;
 #endif
 };
 
 struct AddressSpaceStats {
   PoolStats regular_pool_stats;
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   PoolStats brp_pool_stats;
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   PoolStats configurable_pool_stats;
 #else
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   size_t blocklist_size;  // measured in super pages
   size_t blocklist_hit_count;
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   PoolStats thread_isolated_pool_stats;
 #endif
 };
diff --git a/base/allocator/partition_allocator/src/partition_alloc/compressed_pointer.cc b/base/allocator/partition_allocator/src/partition_alloc/compressed_pointer.cc
index b4d9e66..04b3646 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/compressed_pointer.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/compressed_pointer.cc
@@ -5,7 +5,7 @@
 #include "partition_alloc/compressed_pointer.h"
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#if PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 
 namespace partition_alloc::internal {
 
@@ -26,4 +26,4 @@
 
 }  // namespace partition_alloc::internal
 
-#endif  // BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#endif  // PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/compressed_pointer.h b/base/allocator/partition_allocator/src/partition_alloc/compressed_pointer.h
index d6ec1e8c..3b2410c 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/compressed_pointer.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/compressed_pointer.h
@@ -14,7 +14,7 @@
 #include "partition_alloc/partition_alloc_base/component_export.h"
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#if PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 
 #if !BUILDFLAG(GLUE_CORE_POOLS)
 #error "Pointer compression only works with glued pools"
@@ -23,7 +23,7 @@
 #error "Pointer compression currently supports constant pool size"
 #endif
 
-#endif  // BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#endif  // PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 
 namespace partition_alloc {
 
@@ -33,7 +33,7 @@
 constexpr bool IsDecayedSame =
     std::is_same_v<std::decay_t<T1>, std::decay_t<T2>>;
 
-#if BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#if PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 
 // Pointer compression works by storing only the 'useful' 32-bit part of the
 // pointer. The other half (the base) is stored in a global variable
@@ -118,11 +118,11 @@
   friend class PartitionAddressSpace;
 };
 
-#endif  // BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#endif  // PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 
 }  // namespace internal
 
-#if BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#if PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 
 template <typename T>
 class PA_TRIVIAL_ABI CompressedPointer final {
@@ -232,7 +232,7 @@
     static constexpr size_t kMinimalRequiredAlignment = 8;
     static_assert((1 << kOverallBitsToShift) == kMinimalRequiredAlignment);
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     PA_DCHECK(reinterpret_cast<uintptr_t>(ptr) % kMinimalRequiredAlignment ==
               0);
     PA_DCHECK(internal::CompressedPointerBaseGlobal::IsSet());
@@ -243,7 +243,7 @@
     PA_DCHECK(!ptr ||
               (base & kCorePoolsBaseMask) ==
                   (reinterpret_cast<uintptr_t>(ptr) & kCorePoolsBaseMask));
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
     const auto uptr = reinterpret_cast<uintptr_t>(ptr);
     // Shift the pointer and truncate.
@@ -444,7 +444,7 @@
   return static_cast<CompressedPointer<T>>(a) >= b;
 }
 
-#endif  // BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#endif  // PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 
 // Simple wrapper over the raw pointer.
 template <typename T>
diff --git a/base/allocator/partition_allocator/src/partition_alloc/compressed_pointer_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/compressed_pointer_unittest.cc
index 52de3bf..d47b43d 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/compressed_pointer_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/compressed_pointer_unittest.cc
@@ -47,14 +47,14 @@
 }
 
 // Test that pointer types are trivial.
-#if BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#if PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 static_assert(
     std::is_trivially_default_constructible_v<CompressedPointer<Base>>);
 static_assert(std::is_trivially_copy_constructible_v<CompressedPointer<Base>>);
 static_assert(std::is_trivially_move_constructible_v<CompressedPointer<Base>>);
 static_assert(std::is_trivially_copy_assignable_v<CompressedPointer<Base>>);
 static_assert(std::is_trivially_move_assignable_v<CompressedPointer<Base>>);
-#endif  // BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#endif  // PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 static_assert(
     std::is_trivially_default_constructible_v<UncompressedPointer<Base>>);
 static_assert(
@@ -72,16 +72,16 @@
 template <typename TagType>
 class CompressedPointerTest : public ::testing::Test {
  public:
-#if BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#if PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
   template <typename T>
   using PointerType =
       std::conditional_t<std::is_same_v<TagType, CompressedTypeTag>,
                          CompressedPointer<T>,
                          UncompressedPointer<T>>;
-#else   // BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#else   // PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
   template <typename T>
   using PointerType = UncompressedPointer<T>;
-#endif  // BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#endif  // PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 
   CompressedPointerTest() : allocator_(PartitionOptions{}) {}
 
@@ -89,7 +89,7 @@
   PartitionAllocator allocator_;
 };
 
-#if BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#if PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 using ObjectTypes = ::testing::Types<UncompressedTypeTag, CompressedTypeTag>;
 #else
 using ObjectTypes = ::testing::Types<UncompressedTypeTag>;
diff --git a/base/allocator/partition_allocator/src/partition_alloc/encoded_next_freelist.h b/base/allocator/partition_allocator/src/partition_alloc/encoded_next_freelist.h
index 14f133b..24562dd 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/encoded_next_freelist.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/encoded_next_freelist.h
@@ -177,7 +177,7 @@
     // SetNext() is either called on the freelist head, when provisioning new
     // slots, or when GetNext() has been called before, no need to pass the
     // size.
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     // Regular freelists always point to an entry within the same super page.
     //
     // This is most likely a PartitionAlloc bug if this triggers.
@@ -186,7 +186,7 @@
                         (SlotStartPtr2Addr(entry) & kSuperPageBaseMask))) {
       FreelistCorruptionDetected(0);
     }
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
     encoded_next_ = EncodedFreelistPtr(entry);
 #if PA_CONFIG(HAS_FREELIST_SHADOW_ENTRY)
@@ -281,7 +281,7 @@
     const bool same_super_page = (here_address & kSuperPageBaseMask) ==
                                  (next_address & kSuperPageBaseMask);
 
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
     bool marked_as_free_in_bitmap = !FreeSlotBitmapSlotIsUsed(next_address);
 #else
     constexpr bool marked_as_free_in_bitmap = true;
diff --git a/base/allocator/partition_allocator/src/partition_alloc/extended_api.cc b/base/allocator/partition_allocator/src/partition_alloc/extended_api.cc
index 8d3132b..b8d4156a7 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/extended_api.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/extended_api.cc
@@ -36,7 +36,7 @@
   root->settings.with_thread_cache = true;
 }
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 void DisablePartitionAllocThreadCacheForProcess() {
   PA_CHECK(allocator_shim::internal::PartitionAllocMalloc::
                AllocatorConfigurationFinalized());
@@ -45,7 +45,7 @@
   DisableThreadCacheForRootIfEnabled(
       allocator_shim::internal::PartitionAllocMalloc::OriginalAllocator());
 }
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 }  // namespace
 
@@ -63,7 +63,7 @@
 ThreadCacheProcessScopeForTesting::ThreadCacheProcessScopeForTesting(
     PartitionRoot* root)
     : root_(root) {
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
   auto* regular_allocator =
       allocator_shim::internal::PartitionAllocMalloc::Allocator();
   regular_was_enabled_ =
@@ -86,13 +86,13 @@
   PA_CHECK(!ThreadCache::IsValid(ThreadCache::Get()));
   EnablePartitionAllocThreadCacheForRootIfDisabled(root_);
   ThreadCache::SwapForTesting(root_);
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
   PA_CHECK(ThreadCache::Get());
 }
 
 ThreadCacheProcessScopeForTesting::~ThreadCacheProcessScopeForTesting() {
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
   auto* regular_allocator =
       allocator_shim::internal::PartitionAllocMalloc::Allocator();
   bool regular_enabled =
@@ -122,7 +122,7 @@
   DisableThreadCacheForRootIfEnabled(root_);
 
   ThreadCache::SwapForTesting(nullptr);
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 }
 #endif  // PA_CONFIG(THREAD_CACHE_SUPPORTED)
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/extended_api.h b/base/allocator/partition_allocator/src/partition_alloc/extended_api.h
index 1040c99c..b3577c8 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/extended_api.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/extended_api.h
@@ -32,7 +32,7 @@
 
  private:
   PartitionRoot* root_ = nullptr;
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
   bool regular_was_enabled_ = false;
 #endif
 };
diff --git a/base/allocator/partition_allocator/src/partition_alloc/freeslot_bitmap.h b/base/allocator/partition_allocator/src/partition_alloc/freeslot_bitmap.h
index a7f38df..e9708013f 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/freeslot_bitmap.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/freeslot_bitmap.h
@@ -15,7 +15,7 @@
 #include "partition_alloc/partition_alloc_buildflags.h"
 #include "partition_alloc/partition_alloc_constants.h"
 
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
 
 namespace partition_alloc::internal {
 
@@ -92,7 +92,7 @@
     *cell &= ~CellWithAOne(bit_index);
   }
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   // Checks if the cells that are meant to contain only unset bits are really 0.
   auto [begin_cell, begin_bit_index] =
       GetFreeSlotBitmapCellPtrAndBitIndex(begin_addr);
@@ -131,11 +131,11 @@
   for (FreeSlotBitmapCellType* cell = begin_cell; cell < end_cell; ++cell) {
     PA_DCHECK(*cell == 0u);
   }
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 }
 
 }  // namespace partition_alloc::internal
 
-#endif  // BUILDFLAG(USE_FREESLOT_BITMAP)
+#endif  // PA_BUILDFLAG(USE_FREESLOT_BITMAP)
 
 #endif  // PARTITION_ALLOC_FREESLOT_BITMAP_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/freeslot_bitmap_constants.h b/base/allocator/partition_allocator/src/partition_alloc/freeslot_bitmap_constants.h
index b22946e..8faf77a 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/freeslot_bitmap_constants.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/freeslot_bitmap_constants.h
@@ -28,7 +28,7 @@
 
 PA_ALWAYS_INLINE PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR size_t
 ReservedFreeSlotBitmapSize() {
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
   return base::bits::AlignUp(kFreeSlotBitmapSize, PartitionPageSize());
 #else
   return 0;
@@ -37,7 +37,7 @@
 
 PA_ALWAYS_INLINE PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR size_t
 CommittedFreeSlotBitmapSize() {
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
   return base::bits::AlignUp(kFreeSlotBitmapSize, SystemPageSize());
 #else
   return 0;
@@ -49,7 +49,7 @@
   return ReservedFreeSlotBitmapSize() / PartitionPageSize();
 }
 
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
 PA_ALWAYS_INLINE uintptr_t SuperPageFreeSlotBitmapAddr(uintptr_t super_page) {
   PA_DCHECK(!(super_page % kSuperPageAlignment));
   return super_page + PartitionPageSize();
diff --git a/base/allocator/partition_allocator/src/partition_alloc/freeslot_bitmap_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/freeslot_bitmap_unittest.cc
index ad4f7c7..69329d66 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/freeslot_bitmap_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/freeslot_bitmap_unittest.cc
@@ -18,7 +18,8 @@
 
 // This test is disabled when MEMORY_TOOL_REPLACES_ALLOCATOR is defined because
 // we cannot locate the freeslot bitmap address in that case.
-#if BUILDFLAG(USE_FREESLOT_BITMAP) && !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP) && \
+    !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
 
 namespace partition_alloc::internal {
 
@@ -202,5 +203,5 @@
 
 }  // namespace partition_alloc::internal
 
-#endif  // BUILDFLAG(USE_FREESLOT_BITMAP) &&
+#endif  // PA_BUILDFLAG(USE_FREESLOT_BITMAP) &&
         // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/gwp_asan_support.cc b/base/allocator/partition_allocator/src/partition_alloc/gwp_asan_support.cc
index 2295f27..ef7cf31 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/gwp_asan_support.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/gwp_asan_support.cc
@@ -4,7 +4,7 @@
 
 #include "partition_alloc/gwp_asan_support.h"
 
-#if BUILDFLAG(ENABLE_GWP_ASAN_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_GWP_ASAN_SUPPORT)
 
 #include "partition_alloc/build_config.h"
 #include "partition_alloc/freeslot_bitmap_constants.h"
@@ -129,4 +129,4 @@
 
 }  // namespace partition_alloc
 
-#endif  // BUILDFLAG(ENABLE_GWP_ASAN_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_GWP_ASAN_SUPPORT)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/gwp_asan_support.h b/base/allocator/partition_allocator/src/partition_alloc/gwp_asan_support.h
index 7af944fa..6e8b28f 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/gwp_asan_support.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/gwp_asan_support.h
@@ -8,7 +8,7 @@
 #include "partition_alloc/partition_alloc_base/component_export.h"
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(ENABLE_GWP_ASAN_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_GWP_ASAN_SUPPORT)
 
 #include <cstddef>
 #include <cstdint>
@@ -115,6 +115,6 @@
 
 }  // namespace partition_alloc
 
-#endif  // BUILDFLAG(ENABLE_GWP_ASAN_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_GWP_ASAN_SUPPORT)
 
 #endif  // PARTITION_ALLOC_GWP_ASAN_SUPPORT_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/hardening_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/hardening_unittest.cc
index f6c11653..0c22686 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/hardening_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/hardening_unittest.cc
@@ -117,7 +117,7 @@
   root.get_freelist_dispatcher()->EmplaceAndInitForTest(
       root.ObjectToSlotStart(data), to_corrupt, true);
 
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
   // This part crashes with freeslot bitmap because it detects freelist
   // corruptions, which is rather desirable behavior.
   EXPECT_DEATH_IF_SUPPORTED(root.Alloc(kAllocSize), "");
@@ -132,11 +132,11 @@
   void* new_data2 = root.Alloc(kAllocSize);
   // Now we have a pointer to the middle of an existing allocation.
   EXPECT_EQ(new_data2, to_corrupt);
-#endif  // BUILDFLAG(USE_FREESLOT_BITMAP)
+#endif  // PA_BUILDFLAG(USE_FREESLOT_BITMAP)
 }
 #endif  // !BUILDFLAG(IS_ANDROID)
 
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
 #if PA_USE_DEATH_TESTS() && PA_CONFIG(HAS_FREELIST_SHADOW_ENTRY)
 TEST(HardeningTest, ConstructPoolOffsetFromStackPointerCrashing) {
   int num_to_corrupt = 12345;
@@ -201,7 +201,7 @@
   root.get_freelist_dispatcher()->EmplaceAndInitForTest(
       root.ObjectToSlotStart(data), to_corrupt, true);
 
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
   // This part crashes with freeslot bitmap because it detects freelist
   // corruptions, which is rather desirable behavior.
   EXPECT_DEATH_IF_SUPPORTED(root.Alloc(kAllocSize), "");
@@ -216,10 +216,10 @@
   void* new_data2 = root.Alloc(kAllocSize);
   // Now we have a pointer to the middle of an existing allocation.
   EXPECT_EQ(new_data2, to_corrupt);
-#endif  // BUILDFLAG(USE_FREESLOT_BITMAP)
+#endif  // PA_BUILDFLAG(USE_FREESLOT_BITMAP)
 }
 #endif  // !BUILDFLAG(IS_ANDROID)
-#endif  // BUILDFLAG(USE_FREELIST_DISPATCHER)
+#endif  // PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
 }  // namespace
 }  // namespace partition_alloc::internal
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/in_slot_metadata.h b/base/allocator/partition_allocator/src/partition_alloc/in_slot_metadata.h
index 219cdad..b39607f 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/in_slot_metadata.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/in_slot_metadata.h
@@ -49,7 +49,7 @@
 #endif  // BUILDFLAG(IS_APPLE)
 }
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 namespace {
 // Utility functions to define a bit field.
@@ -189,7 +189,7 @@
   // Similar to |Acquire()|, but for raw_ptr<T, DisableDanglingPtrDetection>
   // instead of raw_ptr<T>.
   PA_ALWAYS_INLINE void AcquireFromUnprotectedPtr() {
-#if BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
+#if PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
     CheckCookieIfSupported();
     CountType old_count =
         count_.fetch_add(kUnprotectedPtrInc, std::memory_order_relaxed);
@@ -209,7 +209,7 @@
     // Check underflow.
     PA_DCHECK(old_count & kPtrCountMask);
 
-#if BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
+#if PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
     // If a dangling raw_ptr<> was detected, report it.
     if (PA_UNLIKELY((old_count & kDanglingRawPtrDetectedBit) ==
                     kDanglingRawPtrDetectedBit)) {
@@ -224,7 +224,7 @@
   // Similar to |Release()|, but for raw_ptr<T, DisableDanglingPtrDetection>
   // instead of raw_ptr<T>.
   PA_ALWAYS_INLINE bool ReleaseFromUnprotectedPtr() {
-#if BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
+#if PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
     CheckCookieIfSupported();
 
     CountType old_count =
@@ -359,7 +359,7 @@
   // If there are some dangling raw_ptr<>. Turn on the error flag, and
   // emit the `DanglingPtrDetected` once to embedders.
   PA_ALWAYS_INLINE void CheckDanglingPointersOnFree(CountType count) {
-#if BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
+#if PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
     // The `kPtrCountMask` counts the number of raw_ptr<T>. It is expected to be
     // zero when there are no unexpected dangling pointers.
     if (PA_LIKELY((count & kPtrCountMask) == 0)) {
@@ -384,7 +384,7 @@
 
     partition_alloc::internal::DanglingRawPtrDetected(
         reinterpret_cast<uintptr_t>(this));
-#endif  // BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
+#endif  // PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
   }
 
   // The common parts shared by Release() and ReleaseFromUnprotectedPtr().
@@ -477,7 +477,7 @@
 
 static constexpr size_t kInSlotMetadataBufferSize = sizeof(InSlotMetadata);
 
-#if BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
+#if PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
 
 #if PA_CONFIG(IN_SLOT_METADATA_CHECK_COOKIE) || \
     PA_CONFIG(IN_SLOT_METADATA_STORE_REQUESTED_SIZE)
@@ -486,7 +486,7 @@
 static constexpr size_t kInSlotMetadataSizeShift = 3;
 #endif
 
-#else  // BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
+#else  // PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
 
 #if PA_CONFIG(IN_SLOT_METADATA_CHECK_COOKIE) && \
     PA_CONFIG(IN_SLOT_METADATA_STORE_REQUESTED_SIZE)
@@ -540,7 +540,8 @@
   if (PA_LIKELY(slot_start & SystemPageOffsetMask())) {
     uintptr_t refcount_address =
         slot_start + slot_size - sizeof(InSlotMetadata);
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
     PA_CHECK(refcount_address % alignof(InSlotMetadata) == 0);
 #endif
     // TODO(bartekn): Plumb the tag from the callers, so that MTE tag can be
@@ -552,7 +553,8 @@
         (slot_start & kSuperPageBaseMask) + SystemPageSize() * 2);
     size_t index = ((slot_start & kSuperPageOffsetMask) >> SystemPageShift())
                    << GetInSlotMetadataIndexMultiplierShift();
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
     PA_CHECK(sizeof(InSlotMetadata) * index <= SystemPageSize());
 #endif
     return table_base + index;
@@ -562,11 +564,11 @@
 static_assert(sizeof(InSlotMetadata) <= kInSlotMetadataBufferSize,
               "InSlotMetadata should fit into the in-slot buffer.");
 
-#else  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#else  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 static constexpr size_t kInSlotMetadataBufferSize = 0;
 
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 constexpr size_t kInSlotMetadataSizeAdjustment = kInSlotMetadataBufferSize;
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/memory_reclaimer.cc b/base/allocator/partition_allocator/src/partition_alloc/memory_reclaimer.cc
index f6f1acb9..f138fed 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/memory_reclaimer.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/memory_reclaimer.cc
@@ -10,7 +10,7 @@
 #include "partition_alloc/partition_alloc_check.h"
 #include "partition_alloc/partition_alloc_config.h"
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 #include "partition_alloc/starscan/pcscan.h"
 #endif
 
@@ -65,7 +65,7 @@
   //
   // Lastly decommit empty slot spans and lastly try to discard unused pages at
   // the end of the remaining active slots.
-#if PA_CONFIG(STARSCAN_ENABLE_STARSCAN_ON_RECLAIM) && BUILDFLAG(USE_STARSCAN)
+#if PA_CONFIG(STARSCAN_ENABLE_STARSCAN_ON_RECLAIM) && PA_BUILDFLAG(USE_STARSCAN)
   {
     using PCScan = internal::PCScan;
     const auto invocation_mode = flags & PurgeFlags::kAggressiveReclaim
@@ -74,7 +74,7 @@
     PCScan::PerformScanIfNeeded(invocation_mode);
   }
 #endif  // PA_CONFIG(STARSCAN_ENABLE_STARSCAN_ON_RECLAIM) &&
-        // BUILDFLAG(USE_STARSCAN)
+        // PA_BUILDFLAG(USE_STARSCAN)
 
 #if PA_CONFIG(THREAD_CACHE_SUPPORTED)
   // Don't completely empty the thread cache outside of low memory situations,
diff --git a/base/allocator/partition_allocator/src/partition_alloc/memory_reclaimer_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/memory_reclaimer_unittest.cc
index 81b2161..66a103b 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/memory_reclaimer_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/memory_reclaimer_unittest.cc
@@ -16,7 +16,7 @@
 #include "partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \
     PA_CONFIG(THREAD_CACHE_SUPPORTED)
 #include "partition_alloc/extended_api.h"
 #include "partition_alloc/thread_cache.h"
@@ -101,7 +101,7 @@
   }
 }
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \
     PA_CONFIG(THREAD_CACHE_SUPPORTED)
 
 namespace {
@@ -142,7 +142,7 @@
   EXPECT_LT(tcache->CachedMemory(), cached_size / 2);
 }
 
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \
         // PA_CONFIG(THREAD_CACHE_SUPPORTED)
 
 }  // namespace partition_alloc
diff --git a/base/allocator/partition_allocator/src/partition_alloc/page_allocator.h b/base/allocator/partition_allocator/src/partition_alloc/page_allocator.h
index 6e73c6a..51004ee 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/page_allocator.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/page_allocator.h
@@ -41,7 +41,7 @@
     kReadWriteExecute,
   };
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   constexpr explicit PageAccessibilityConfiguration(Permissions permissions)
       : permissions(permissions) {}
   constexpr PageAccessibilityConfiguration(
@@ -51,13 +51,13 @@
 #else
   constexpr explicit PageAccessibilityConfiguration(Permissions permissions)
       : permissions(permissions) {}
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 
   Permissions permissions;
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   // Tag the page with a Memory Protection Key. Use 0 for none.
   ThreadIsolationOption thread_isolation;
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 };
 
 // Use for De/RecommitSystemPages API.
diff --git a/base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_posix.h b/base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_posix.h
index 809c5ff..82d755b 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_posix.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_posix.h
@@ -215,14 +215,14 @@
     uintptr_t address,
     size_t length,
     PageAccessibilityConfiguration accessibility) {
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   if (accessibility.thread_isolation.enabled) {
     return 0 == MprotectWithThreadIsolation(reinterpret_cast<void*>(address),
                                             length,
                                             GetAccessFlags(accessibility),
                                             accessibility.thread_isolation);
   }
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   return 0 == WrapEINTR(mprotect)(reinterpret_cast<void*>(address), length,
                                   GetAccessFlags(accessibility));
 }
@@ -233,13 +233,13 @@
     PageAccessibilityConfiguration accessibility) {
   int access_flags = GetAccessFlags(accessibility);
   int ret;
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   if (accessibility.thread_isolation.enabled) {
     ret = MprotectWithThreadIsolation(reinterpret_cast<void*>(address), length,
                                       GetAccessFlags(accessibility),
                                       accessibility.thread_isolation);
   } else
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   {
     ret = WrapEINTR(mprotect)(reinterpret_cast<void*>(address), length,
                               GetAccessFlags(accessibility));
@@ -299,14 +299,14 @@
 
   bool change_permissions =
       accessibility_disposition == PageAccessibilityDisposition::kRequireUpdate;
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   // This is not guaranteed, show that we're serious.
   //
   // More specifically, several callers have had issues with assuming that
   // memory is zeroed, this would hopefully make these bugs more visible.  We
   // don't memset() everything, because ranges can be very large, and doing it
   // over the entire range could make Chrome unusable with
-  // BUILDFLAG(PA_DCHECK_IS_ON).
+  // PA_BUILDFLAG(PA_DCHECK_IS_ON).
   //
   // Only do it when we are about to change the permissions, since we don't know
   // the previous permissions, and cannot restore them.
diff --git a/base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_win.h b/base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_win.h
index 90811615..76d76fc 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_win.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_win.h
@@ -28,7 +28,7 @@
     case ERROR_COMMITMENT_MINIMUM:
     // Page file is too small.
     case ERROR_COMMITMENT_LIMIT:
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
     // Not enough memory resources are available to process this command.
     //
     // It is not entirely clear whether this error pertains to out of address
diff --git a/base/allocator/partition_allocator/src/partition_alloc/page_allocator_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/page_allocator_unittest.cc
index d7b714a..4b204b8 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/page_allocator_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/page_allocator_unittest.cc
@@ -37,12 +37,12 @@
 
 #include "partition_alloc/arm_bti_test_functions.h"
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 #include <arm_acle.h>
 #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
 #define MTE_KILLED_BY_SIGNAL_AVAILABLE
 #endif
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
 #if !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.cc
index df407d3..5504b3f 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.cc
@@ -31,13 +31,13 @@
 #include <windows.h>
 #endif  // BUILDFLAG(IS_WIN)
 
-#if PA_CONFIG(ENABLE_SHADOW_METADATA) || BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_CONFIG(ENABLE_SHADOW_METADATA) || PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 #include <sys/mman.h>
 #endif
 
 namespace partition_alloc::internal {
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 namespace {
 
@@ -143,7 +143,7 @@
   size_t regular_pool_size = RegularPoolSize();
   size_t brp_pool_size = BRPPoolSize();
 
-#if BUILDFLAG(GLUE_CORE_POOLS)
+#if PA_BUILDFLAG(GLUE_CORE_POOLS)
   // Gluing core pools (regular & BRP) makes sense only when both pools are of
   // the same size. This the only way we can check belonging to either of the
   // two with a single bitmask operation.
@@ -165,7 +165,7 @@
   }
   setup_.brp_pool_base_address_ =
       setup_.regular_pool_base_address_ + regular_pool_size;
-#else  // BUILDFLAG(GLUE_CORE_POOLS)
+#else  // PA_BUILDFLAG(GLUE_CORE_POOLS)
 #if PA_CONFIG(ENABLE_SHADOW_METADATA)
   int regular_pool_fd = memfd_create("/regular_pool", MFD_CLOEXEC);
 #else
@@ -200,12 +200,12 @@
     HandlePoolAllocFailure();
   }
   setup_.brp_pool_base_address_ = base_address + kForbiddenZoneSize;
-#endif  // BUILDFLAG(GLUE_CORE_POOLS)
+#endif  // PA_BUILDFLAG(GLUE_CORE_POOLS)
 
 #if PA_CONFIG(DYNAMICALLY_SELECT_POOL_SIZE)
   setup_.regular_pool_base_mask_ = ~(regular_pool_size - 1);
   setup_.brp_pool_base_mask_ = ~(brp_pool_size - 1);
-#if BUILDFLAG(GLUE_CORE_POOLS)
+#if PA_BUILDFLAG(GLUE_CORE_POOLS)
   // When PA_GLUE_CORE_POOLS is on, the BRP pool is placed at the end of the
   // regular pool, effectively forming one virtual pool of a twice bigger
   // size. Adjust the mask appropriately.
@@ -222,7 +222,7 @@
   // Sanity check pool alignment.
   PA_DCHECK(!(setup_.regular_pool_base_address_ & (regular_pool_size - 1)));
   PA_DCHECK(!(setup_.brp_pool_base_address_ & (brp_pool_size - 1)));
-#if BUILDFLAG(GLUE_CORE_POOLS)
+#if PA_BUILDFLAG(GLUE_CORE_POOLS)
   PA_DCHECK(!(setup_.regular_pool_base_address_ & (glued_pool_sizes - 1)));
 #endif
 
@@ -237,7 +237,7 @@
   PA_DCHECK(IsInBRPPool(setup_.brp_pool_base_address_));
   PA_DCHECK(IsInBRPPool(setup_.brp_pool_base_address_ + brp_pool_size - 1));
   PA_DCHECK(!IsInBRPPool(setup_.brp_pool_base_address_ + brp_pool_size));
-#if BUILDFLAG(GLUE_CORE_POOLS)
+#if PA_BUILDFLAG(GLUE_CORE_POOLS)
   PA_DCHECK(!IsInCorePools(setup_.regular_pool_base_address_ - 1));
   PA_DCHECK(IsInCorePools(setup_.regular_pool_base_address_));
   PA_DCHECK(
@@ -248,7 +248,7 @@
   PA_DCHECK(IsInCorePools(setup_.brp_pool_base_address_));
   PA_DCHECK(IsInCorePools(setup_.brp_pool_base_address_ + brp_pool_size - 1));
   PA_DCHECK(!IsInCorePools(setup_.brp_pool_base_address_ + brp_pool_size));
-#endif  // BUILDFLAG(GLUE_CORE_POOLS)
+#endif  // PA_BUILDFLAG(GLUE_CORE_POOLS)
 
 #if PA_CONFIG(STARSCAN_USE_CARD_TABLE)
   // Reserve memory for PCScan quarantine card table.
@@ -280,9 +280,9 @@
       brp_pool_shadow_address - setup_.brp_pool_base_address_;
 #endif
 
-#if BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#if PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
   CompressedPointerBaseGlobal::SetBase(setup_.regular_pool_base_address_);
-#endif  // BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#endif  // PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 }
 
 void PartitionAddressSpace::InitConfigurablePool(uintptr_t pool_base,
@@ -290,7 +290,7 @@
   // The ConfigurablePool must only be initialized once.
   PA_CHECK(!IsConfigurablePoolInitialized());
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   // It's possible that the thread isolated pool has been initialized first, in
   // which case the setup_ memory has been made read-only. Remove the protection
   // temporarily.
@@ -311,7 +311,7 @@
   AddressPoolManager::GetInstance().Add(
       kConfigurablePoolHandle, setup_.configurable_pool_base_address_, size);
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   // Put the metadata protection back in place.
   if (IsThreadIsolatedPoolInitialized()) {
     WriteProtectThreadIsolatedGlobals(setup_.thread_isolation_);
@@ -319,7 +319,7 @@
 #endif
 }
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 void PartitionAddressSpace::InitThreadIsolatedPool(
     ThreadIsolationOption thread_isolation) {
   // The ThreadIsolated pool can't be initialized with conflicting settings.
@@ -354,24 +354,24 @@
 
   // TODO(crbug.com/40238514): support PA_ENABLE_SHADOW_METADATA
 }
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 
 void PartitionAddressSpace::UninitForTesting() {
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   UninitThreadIsolatedPoolForTesting();  // IN-TEST
 #endif
-#if BUILDFLAG(GLUE_CORE_POOLS)
+#if PA_BUILDFLAG(GLUE_CORE_POOLS)
   // The core pools (regular & BRP) were allocated using a single allocation of
   // double size.
   FreePages(setup_.regular_pool_base_address_, 2 * RegularPoolSize());
-#else   // BUILDFLAG(GLUE_CORE_POOLS)
+#else   // PA_BUILDFLAG(GLUE_CORE_POOLS)
   FreePages(setup_.regular_pool_base_address_, RegularPoolSize());
   // For BRP pool, the allocation region includes a "forbidden zone" before the
   // pool.
   const size_t kForbiddenZoneSize = PageAllocationGranularity();
   FreePages(setup_.brp_pool_base_address_ - kForbiddenZoneSize,
             BRPPoolSize() + kForbiddenZoneSize);
-#endif  // BUILDFLAG(GLUE_CORE_POOLS)
+#endif  // PA_BUILDFLAG(GLUE_CORE_POOLS)
   // Do not free pages for the configurable pool, because its memory is owned
   // by someone else, but deinitialize it nonetheless.
   setup_.regular_pool_base_address_ = kUninitializedPoolBaseAddress;
@@ -379,13 +379,13 @@
   setup_.configurable_pool_base_address_ = kUninitializedPoolBaseAddress;
   setup_.configurable_pool_base_mask_ = 0;
   AddressPoolManager::GetInstance().ResetForTesting();
-#if BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#if PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
   CompressedPointerBaseGlobal::ResetBaseForTesting();
-#endif  // BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#endif  // PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 }
 
 void PartitionAddressSpace::UninitConfigurablePoolForTesting() {
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   // It's possible that the thread isolated pool has been initialized first, in
   // which case the setup_ memory has been made read-only. Remove the protection
   // temporarily.
@@ -396,7 +396,7 @@
   AddressPoolManager::GetInstance().Remove(kConfigurablePoolHandle);
   setup_.configurable_pool_base_address_ = kUninitializedPoolBaseAddress;
   setup_.configurable_pool_base_mask_ = 0;
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   // Put the metadata protection back in place.
   if (IsThreadIsolatedPoolInitialized()) {
     WriteProtectThreadIsolatedGlobals(setup_.thread_isolation_);
@@ -404,11 +404,11 @@
 #endif
 }
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 void PartitionAddressSpace::UninitThreadIsolatedPoolForTesting() {
   if (IsThreadIsolatedPoolInitialized()) {
     UnprotectThreadIsolatedGlobals();
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     ThreadIsolationSettings::settings.enabled = false;
 #endif
 
@@ -427,6 +427,6 @@
 
 #endif
 
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 }  // namespace partition_alloc::internal
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h b/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h
index 54edf02..f48a896 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h
@@ -22,12 +22,12 @@
 #include "partition_alloc/partition_alloc_forward.h"
 #include "partition_alloc/thread_isolation/alignment.h"
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 #include "partition_alloc/thread_isolation/thread_isolation.h"
 #endif
 
 // The feature is not applicable to 32-bit address space.
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 namespace partition_alloc {
 
@@ -69,13 +69,13 @@
     pool_handle pool = kNullPoolHandle;
     uintptr_t base = 0;
     uintptr_t base_mask = 0;
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     if (IsInBRPPool(address)) {
       pool = kBRPPoolHandle;
       base = setup_.brp_pool_base_address_;
       base_mask = BRPPoolBaseMask();
     } else
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
       if (IsInRegularPool(address)) {
         pool = kRegularPoolHandle;
         base = setup_.regular_pool_base_address_;
@@ -85,7 +85,7 @@
         pool = kConfigurablePoolHandle;
         base = setup_.configurable_pool_base_address_;
         base_mask = setup_.configurable_pool_base_mask_;
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
       } else if (IsInThreadIsolatedPool(address)) {
         pool = kThreadIsolatedPoolHandle;
         base = setup_.thread_isolated_pool_base_address_;
@@ -116,7 +116,7 @@
   //
   // This function must only be called from the main thread.
   static void InitConfigurablePool(uintptr_t pool_base, size_t size);
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   static void InitThreadIsolatedPool(ThreadIsolationOption thread_isolation);
   static void UninitThreadIsolatedPoolForTesting();
 #endif
@@ -140,7 +140,7 @@
            kUninitializedPoolBaseAddress;
   }
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   PA_ALWAYS_INLINE static bool IsThreadIsolatedPoolInitialized() {
     return setup_.thread_isolated_pool_base_address_ !=
            kUninitializedPoolBaseAddress;
@@ -172,7 +172,7 @@
     return (address & brp_pool_base_mask) == setup_.brp_pool_base_address_;
   }
 
-#if BUILDFLAG(GLUE_CORE_POOLS)
+#if PA_BUILDFLAG(GLUE_CORE_POOLS)
   // Checks whether the address belongs to either regular or BRP pool.
   // Returns false for nullptr.
   PA_ALWAYS_INLINE static bool IsInCorePools(uintptr_t address) {
@@ -198,7 +198,7 @@
     return RegularPoolSize() * 2;
   }
 #endif  // PA_CONFIG(DYNAMICALLY_SELECT_POOL_SIZE)
-#endif  // BUILDFLAG(GLUE_CORE_POOLS)
+#endif  // PA_BUILDFLAG(GLUE_CORE_POOLS)
 
   PA_ALWAYS_INLINE static uintptr_t OffsetInBRPPool(uintptr_t address) {
     PA_DCHECK(IsInBRPPool(address));
@@ -215,7 +215,7 @@
     return setup_.configurable_pool_base_address_;
   }
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   // Returns false for nullptr.
   PA_ALWAYS_INLINE static bool IsInThreadIsolatedPool(uintptr_t address) {
     return (address & kThreadIsolatedPoolBaseMask) ==
@@ -258,7 +258,7 @@
   }
 #endif  // PA_CONFIG(DYNAMICALLY_SELECT_POOL_SIZE)
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   PA_ALWAYS_INLINE static constexpr size_t ThreadIsolatedPoolSize() {
     return kThreadIsolatedPoolSize;
   }
@@ -287,7 +287,7 @@
   static constexpr size_t kBRPPoolSize = kPoolMaxSize;
   static_assert(std::has_single_bit(kRegularPoolSize));
   static_assert(std::has_single_bit(kBRPPoolSize));
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   static constexpr size_t kThreadIsolatedPoolSize = kGiB / 4;
   static_assert(std::has_single_bit(kThreadIsolatedPoolSize));
 #endif
@@ -324,7 +324,7 @@
   static constexpr uintptr_t kBRPPoolBaseMask = ~kBRPPoolOffsetMask;
 #endif  // !PA_CONFIG(DYNAMICALLY_SELECT_POOL_SIZE)
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   static constexpr uintptr_t kThreadIsolatedPoolOffsetMask =
       static_cast<uintptr_t>(kThreadIsolatedPoolSize) - 1;
   static constexpr uintptr_t kThreadIsolatedPoolBaseMask =
@@ -346,23 +346,23 @@
     uintptr_t regular_pool_base_address_ = kUninitializedPoolBaseAddress;
     uintptr_t brp_pool_base_address_ = kUninitializedPoolBaseAddress;
     uintptr_t configurable_pool_base_address_ = kUninitializedPoolBaseAddress;
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
     uintptr_t thread_isolated_pool_base_address_ =
         kUninitializedPoolBaseAddress;
 #endif
 #if PA_CONFIG(DYNAMICALLY_SELECT_POOL_SIZE)
     uintptr_t regular_pool_base_mask_ = 0;
     uintptr_t brp_pool_base_mask_ = 0;
-#if BUILDFLAG(GLUE_CORE_POOLS)
+#if PA_BUILDFLAG(GLUE_CORE_POOLS)
     uintptr_t core_pools_base_mask_ = 0;
 #endif
 #endif  // PA_CONFIG(DYNAMICALLY_SELECT_POOL_SIZE)
     uintptr_t configurable_pool_base_mask_ = 0;
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
     ThreadIsolationOption thread_isolation_;
 #endif
   };
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   static_assert(sizeof(PoolSetup) % SystemPageSize() == 0,
                 "PoolSetup has to fill a page(s)");
 #else
@@ -382,7 +382,7 @@
   static std::ptrdiff_t brp_pool_shadow_offset_;
 #endif
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   // If we use thread isolation, we need to write-protect its metadata.
   // Allow the function to get access to the PoolSetup.
   friend void WriteProtectThreadIsolatedGlobals(ThreadIsolationOption);
@@ -417,10 +417,10 @@
   PA_DCHECK(!internal::PartitionAddressSpace::IsInBRPPool(address));
 #endif
   return internal::PartitionAddressSpace::IsInRegularPool(address)
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
          || internal::PartitionAddressSpace::IsInBRPPool(address)
 #endif
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
          || internal::PartitionAddressSpace::IsInThreadIsolatedPool(address)
 #endif
          || internal::PartitionAddressSpace::IsInConfigurablePool(address);
@@ -436,13 +436,13 @@
   return internal::PartitionAddressSpace::IsInBRPPool(address);
 }
 
-#if BUILDFLAG(GLUE_CORE_POOLS)
+#if PA_BUILDFLAG(GLUE_CORE_POOLS)
 // Checks whether the address belongs to either regular or BRP pool.
 // Returns false for nullptr.
 PA_ALWAYS_INLINE bool IsManagedByPartitionAllocCorePools(uintptr_t address) {
   return internal::PartitionAddressSpace::IsInCorePools(address);
 }
-#endif  // BUILDFLAG(GLUE_CORE_POOLS)
+#endif  // PA_BUILDFLAG(GLUE_CORE_POOLS)
 
 // Returns false for nullptr.
 PA_ALWAYS_INLINE bool IsManagedByPartitionAllocConfigurablePool(
@@ -450,7 +450,7 @@
   return internal::PartitionAddressSpace::IsInConfigurablePool(address);
 }
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 // Returns false for nullptr.
 PA_ALWAYS_INLINE bool IsManagedByPartitionAllocThreadIsolatedPool(
     uintptr_t address) {
@@ -464,6 +464,6 @@
 
 }  // namespace partition_alloc
 
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 #endif  // PARTITION_ALLOC_PARTITION_ADDRESS_SPACE_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc-inl.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc-inl.h
index a5a47358..c9aba6d 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc-inl.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc-inl.h
@@ -51,7 +51,7 @@
 #pragma optimize("", on)
 #endif
 
-#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
+#if PA_BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
 // Used to memset() memory for debugging purposes only.
 PA_ALWAYS_INLINE void DebugMemset(void* ptr, int value, size_t size) {
   // Only set the first 512kiB of the allocation. This is enough to detect uses
@@ -59,13 +59,13 @@
   // faster. Note that for direct-mapped allocations, memory is decomitted at
   // free() time, so freed memory usage cannot happen.
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   LiftThreadIsolationScope lift_thread_isolation_restrictions;
 #endif
   size_t size_to_memset = std::min(size, size_t{1} << 19);
   memset(ptr, value, size_to_memset);
 }
-#endif  // BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
+#endif  // PA_BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
 
 // Returns true if we've hit the end of a random-length period. We don't want to
 // invoke `RandomValue` too often, because we call this function in a hot spot
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc.cc
index 358e913..18d9997c 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc.cc
@@ -20,7 +20,7 @@
 #include "partition_alloc/partition_root.h"
 #include "partition_alloc/partition_stats.h"
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 #include "partition_alloc/starscan/pcscan.h"
 #endif
 
@@ -72,7 +72,7 @@
       internal::MaxSystemPagesPerRegularSlotSpan() <= 16,
       "System pages per slot span must be no greater than 16.");
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   STATIC_ASSERT_OR_PA_CHECK(
       internal::GetInSlotMetadataIndexMultiplierShift() <
           std::numeric_limits<size_t>::max() / 2,
@@ -93,14 +93,14 @@
           internal::SystemPageSize(),
       "InSlotMetadata table size must be smaller than or equal to "
       "<= SystemPageSize().");
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
   PA_DCHECK(on_out_of_memory);
   internal::g_oom_handling_function = on_out_of_memory;
 }
 
 void PartitionAllocGlobalUninitForTesting() {
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   internal::PartitionAddressSpace::UninitThreadIsolatedPoolForTesting();
 #endif
   internal::g_oom_handling_function = nullptr;
@@ -113,12 +113,12 @@
 }
 
 void PartitionAllocator::init(PartitionOptions opts) {
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
   PA_CHECK(opts.thread_cache == PartitionOptions::kDisabled)
       << "Cannot use a thread cache when PartitionAlloc is malloc().";
 #endif
   partition_root_.Init(opts);
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   // The MemoryReclaimer won't have write access to the partition, so skip
   // registration.
   const bool use_memory_reclaimer = !opts.thread_isolation.enabled;
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_allocation_data.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_allocation_data.h
index 27cf44e..afe38ae 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_allocation_data.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_allocation_data.h
@@ -31,7 +31,7 @@
 
   // In the allocation observer path, it's interesting which reporting mode is
   // enabled.
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   AllocationNotificationData& SetMteReportingMode(
       TagViolationReportingMode mode) {
     mte_reporting_mode_ = mode;
@@ -45,13 +45,13 @@
   constexpr TagViolationReportingMode mte_reporting_mode() const {
     return TagViolationReportingMode::kUndefined;
   }
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
  private:
   void* address_ = nullptr;
   size_t size_ = 0;
   const char* type_name_ = nullptr;
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   TagViolationReportingMode mte_reporting_mode_ =
       TagViolationReportingMode::kUndefined;
 #endif
@@ -66,7 +66,7 @@
 
   // In the free observer path, it's interesting which reporting mode is
   // enabled.
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   FreeNotificationData& SetMteReportingMode(TagViolationReportingMode mode) {
     mte_reporting_mode_ = mode;
     return *this;
@@ -79,14 +79,14 @@
   constexpr TagViolationReportingMode mte_reporting_mode() const {
     return TagViolationReportingMode::kUndefined;
   }
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
  private:
   void* address_ = nullptr;
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   TagViolationReportingMode mte_reporting_mode_ =
       TagViolationReportingMode::kUndefined;
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 };
 
 }  // namespace partition_alloc
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/apple/mach_logging.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/apple/mach_logging.h
index 70995fc..b3ff53a 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/apple/mach_logging.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/apple/mach_logging.h
@@ -47,7 +47,7 @@
 
 }  // namespace partition_alloc::internal::logging
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 #define PA_MACH_DVLOG_IS_ON(verbose_level) PA_VLOG_IS_ON(verbose_level)
 #else
 #define PA_MACH_DVLOG_IS_ON(verbose_level) 0
@@ -91,9 +91,9 @@
   PA_LAZY_STREAM(PA_MACH_VLOG_STREAM(verbose_level, mach_err), \
                  PA_MACH_DVLOG_IS_ON(verbose_level) && (condition))
 
-#define PA_MACH_DCHECK(condition, mach_err)                  \
-  PA_LAZY_STREAM(PA_MACH_LOG_STREAM(FATAL, mach_err),        \
-                 BUILDFLAG(PA_DCHECK_IS_ON) && !(condition)) \
+#define PA_MACH_DCHECK(condition, mach_err)                     \
+  PA_LAZY_STREAM(PA_MACH_LOG_STREAM(FATAL, mach_err),           \
+                 PA_BUILDFLAG(PA_DCHECK_IS_ON) && !(condition)) \
       << "Check failed: " #condition << ". "
 
 #endif  // PARTITION_ALLOC_PARTITION_ALLOC_BASE_APPLE_MACH_LOGGING_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/check.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/check.h
index cc28f21f..2709d9a 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/check.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/check.h
@@ -185,7 +185,7 @@
 
 #endif
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 #define PA_BASE_DCHECK(condition)                                \
   PA_LAZY_CHECK_STREAM(                                          \
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace.cc
index 993885ce..5436ffd 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace.cc
@@ -19,7 +19,7 @@
 namespace partition_alloc::internal::base::debug {
 namespace {
 
-#if BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
+#if PA_BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
 
 #if defined(__arm__) && defined(__GNUC__) && !defined(__clang__)
 // GCC and LLVM generate slightly different frames on ARM, see
@@ -141,11 +141,11 @@
   return 0;
 }
 
-#endif  // BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
+#endif  // PA_BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
 
 }  // namespace
 
-#if BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
+#if PA_BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
 
 // We force this function to be inlined into its callers (e.g.
 // TraceStackFramePointers()) in all build modes so we don't have to worry about
@@ -199,7 +199,7 @@
 
 #endif  // BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS)
 
-#if BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
+#if PA_BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
 uintptr_t GetStackEnd() {
 #if BUILDFLAG(IS_ANDROID)
   // Bionic reads proc/maps on every call to pthread_getattr_np() when called
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace.h
index 7627e7e..ce35d49 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace.h
@@ -15,7 +15,7 @@
 namespace partition_alloc::internal::base::debug {
 
 // Returns end of the stack, or 0 if we couldn't get it.
-#if BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
+#if PA_BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
 PA_COMPONENT_EXPORT(PARTITION_ALLOC_BASE)
 uintptr_t GetStackEnd();
 #endif
@@ -37,7 +37,7 @@
                       uintptr_t offset);
 #endif
 
-#if BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
+#if PA_BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
 
 // For stack scanning to be efficient it's very important for the thread to
 // be started by Chrome. In that case we naturally terminate unwinding once
@@ -67,7 +67,7 @@
                                size_t skip_initial,
                                bool enable_scanning = kEnableScanningByDefault);
 
-#endif  // BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
+#endif  // PA_BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
 
 }  // namespace partition_alloc::internal::base::debug
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace_linux.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace_linux.cc
index 851543e..dbe5f68 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace_linux.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace_linux.cc
@@ -13,7 +13,7 @@
   // NOTE: This code MUST be async-signal safe (it's used by in-process
   // stack dumping signal handler). NO malloc or stdio is allowed here.
 
-#if BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
+#if PA_BUILDFLAG(PA_CAN_UNWIND_WITH_FRAME_POINTERS)
   // Regarding Linux and Android, backtrace API internally invokes malloc().
   // So the API is not available inside memory allocation. Instead try tracing
   // using frame pointers.
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/fuchsia/fuchsia_logging.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/fuchsia/fuchsia_logging.h
index 0901fe9..2108e69 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/fuchsia/fuchsia_logging.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/fuchsia/fuchsia_logging.h
@@ -54,17 +54,17 @@
 #define PA_ZX_DLOG(severity, zx_err) \
   PA_LAZY_STREAM(PA_ZX_LOG_STREAM(severity, zx_err), PA_DLOG_IS_ON(severity))
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 #define PA_ZX_DLOG_IF(severity, condition, zx_err)   \
   PA_LAZY_STREAM(PA_ZX_LOG_STREAM(severity, zx_err), \
                  PA_DLOG_IS_ON(severity) && (condition))
-#else  // BUILDFLAG(PA_DCHECK_IS_ON)
+#else  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 #define PA_ZX_DLOG_IF(severity, condition, zx_err) PA_EAT_STREAM_PARAMETERS
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
-#define PA_ZX_DCHECK(condition, zx_err)                      \
-  PA_LAZY_STREAM(PA_ZX_LOG_STREAM(DCHECK, zx_err),           \
-                 BUILDFLAG(PA_DCHECK_IS_ON) && !(condition)) \
+#define PA_ZX_DCHECK(condition, zx_err)                         \
+  PA_LAZY_STREAM(PA_ZX_LOG_STREAM(DCHECK, zx_err),              \
+                 PA_BUILDFLAG(PA_DCHECK_IS_ON) && !(condition)) \
       << "Check failed: " #condition << ". "
 
 #endif  // PARTITION_ALLOC_PARTITION_ALLOC_BASE_FUCHSIA_FUCHSIA_LOGGING_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/fuchsia/fuchsia_logging_pa_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/fuchsia/fuchsia_logging_pa_unittest.cc
index 271d4483..c333b80 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/fuchsia/fuchsia_logging_pa_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/fuchsia/fuchsia_logging_pa_unittest.cc
@@ -28,7 +28,7 @@
 TEST(FuchsiaLoggingTestPA, FuchsiaLogging) {
   MockLogSource mock_log_source;
   constexpr int kTimes =
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
       2;
 #else
       1;
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/log_message.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/log_message.cc
index cfe371e..db61a86 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/log_message.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/log_message.cc
@@ -63,13 +63,13 @@
 
 }  // namespace
 
-#if BUILDFLAG(PA_DCHECK_IS_CONFIGURABLE)
+#if PA_BUILDFLAG(PA_DCHECK_IS_CONFIGURABLE)
 // In DCHECK-enabled Chrome builds, allow the meaning of LOGGING_DCHECK to be
 // determined at run-time. We default it to ERROR, to avoid it triggering
 // crashes before the run-time has explicitly chosen the behaviour.
 PA_COMPONENT_EXPORT(PARTITION_ALLOC_BASE)
 logging::LogSeverity LOGGING_DCHECK = LOGGING_ERROR;
-#endif  // BUILDFLAG(PA_DCHECK_IS_CONFIGURABLE)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_CONFIGURABLE)
 
 // This is never instantiated, it's just used for EAT_STREAM_PARAMETERS to have
 // an object of the correct type on the LHS of the unused part of the ternary
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/log_message.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/log_message.h
index b50d353..24ebcdf 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/log_message.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/log_message.h
@@ -41,7 +41,7 @@
 
 // LOGGING_DFATAL is LOGGING_FATAL in DCHECK-enabled builds, ERROR in normal
 // mode.
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 constexpr LogSeverity LOGGING_DFATAL = LOGGING_FATAL;
 #else
 constexpr LogSeverity LOGGING_DFATAL = LOGGING_ERROR;
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/logging.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/logging.h
index b612f96..1a243b3 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/logging.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/logging.h
@@ -337,7 +337,7 @@
 
 // Definitions for DLOG et al.
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 #define PA_DLOG_IS_ON(severity) PA_LOG_IS_ON(severity)
 #define PA_DLOG_IF(severity, condition) PA_LOG_IF(severity, condition)
@@ -347,11 +347,11 @@
 #define PA_DVPLOG_IF(verboselevel, condition) \
   PA_VPLOG_IF(verboselevel, condition)
 
-#else  // BUILDFLAG(PA_DCHECK_IS_ON)
+#else  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 // If !BUILDFLAG(PA_DCHECK_IS_ON), we want to avoid emitting any references to
 // |condition| (which may reference a variable defined only if
-// BUILDFLAG(PA_DCHECK_IS_ON)). Contrast this with DCHECK et al., which has
+// PA_BUILDFLAG(PA_DCHECK_IS_ON)). Contrast this with DCHECK et al., which has
 // different behavior.
 
 #define PA_DLOG_IS_ON(severity) false
@@ -361,7 +361,7 @@
 #define PA_DVLOG_IF(verboselevel, condition) PA_EAT_STREAM_PARAMETERS
 #define PA_DVPLOG_IF(verboselevel, condition) PA_EAT_STREAM_PARAMETERS
 
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 #define PA_DLOG(severity) \
   PA_LAZY_STREAM(PA_LOG_STREAM(severity), PA_DLOG_IS_ON(severity))
@@ -375,11 +375,11 @@
 
 // Definitions for DCHECK et al.
 
-#if BUILDFLAG(PA_DCHECK_IS_CONFIGURABLE)
+#if PA_BUILDFLAG(PA_DCHECK_IS_CONFIGURABLE)
 PA_COMPONENT_EXPORT(PARTITION_ALLOC_BASE) extern LogSeverity LOGGING_DCHECK;
 #else
 constexpr LogSeverity LOGGING_DCHECK = LOGGING_FATAL;
-#endif  // BUILDFLAG(PA_DCHECK_IS_CONFIGURABLE)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_CONFIGURABLE)
 
 // Redefine the standard assert to use our nice log files
 #undef assert
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/logging_pa_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/logging_pa_unittest.cc
index fa8a3a03..a321e1e 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/logging_pa_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/logging_pa_unittest.cc
@@ -26,7 +26,7 @@
 TEST(PALoggingTest, BasicLogging) {
   MockLogSource mock_log_source;
   constexpr int kTimes =
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
       16;
 #else
       8;
@@ -88,7 +88,7 @@
   EXPECT_FALSE(PA_LOG_IS_ON(ERROR));
   // PA_LOG_IS_ON(FATAL) should always be true.
   EXPECT_TRUE(PA_LOG_IS_ON(FATAL));
-  // If BUILDFLAG(PA_DCHECK_IS_ON) then DFATAL is FATAL.
+  // If PA_BUILDFLAG(PA_DCHECK_IS_ON) then DFATAL is FATAL.
   EXPECT_EQ(BUILDFLAG(PA_DCHECK_IS_ON), PA_LOG_IS_ON(DFATAL));
 }
 
@@ -131,7 +131,7 @@
 }
 
 TEST(PALoggingTest, DebugLoggingReleaseBehavior) {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   int debug_only_variable = 1;
 #endif
   // These should avoid emitting references to |debug_only_variable|
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/memory/ref_counted.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/memory/ref_counted.cc
index da9e227..c31daac7 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/memory/ref_counted.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/memory/ref_counted.cc
@@ -21,7 +21,7 @@
   return !ref_count_.IsZero();
 }
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 RefCountedThreadSafeBase::~RefCountedThreadSafeBase() {
   PA_BASE_DCHECK(in_dtor_) << "RefCountedThreadSafe object deleted without "
                               "calling Release()";
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/memory/ref_counted.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/memory/ref_counted.h
index 2f06b618..592c404 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/memory/ref_counted.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/memory/ref_counted.h
@@ -28,12 +28,12 @@
   explicit constexpr RefCountedThreadSafeBase(StartRefCountFromZeroTag) {}
   explicit constexpr RefCountedThreadSafeBase(StartRefCountFromOneTag)
       : ref_count_(1) {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     needs_adopt_ref_ = true;
 #endif
   }
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   ~RefCountedThreadSafeBase();
 #else
   ~RefCountedThreadSafeBase() = default;
@@ -59,14 +59,14 @@
   friend scoped_refptr<U> AdoptRef(U*);
 
   void Adopted() const {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     PA_BASE_DCHECK(needs_adopt_ref_);
     needs_adopt_ref_ = false;
 #endif
   }
 
   PA_ALWAYS_INLINE void AddRefImpl() const {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     PA_BASE_DCHECK(!in_dtor_);
     // This RefCounted object is created with non-zero reference count.
     // The first reference to such a object has to be made by AdoptRef or
@@ -77,7 +77,7 @@
   }
 
   PA_ALWAYS_INLINE void AddRefWithCheckImpl() const {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     PA_BASE_DCHECK(!in_dtor_);
     // This RefCounted object is created with non-zero reference count.
     // The first reference to such a object has to be made by AdoptRef or
@@ -88,12 +88,12 @@
   }
 
   PA_ALWAYS_INLINE bool ReleaseImpl() const {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     PA_BASE_DCHECK(!in_dtor_);
     PA_BASE_DCHECK(!ref_count_.IsZero());
 #endif
     if (!ref_count_.Decrement()) {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
       in_dtor_ = true;
 #endif
       return true;
@@ -102,7 +102,7 @@
   }
 
   mutable AtomicRefCount ref_count_{0};
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   mutable bool needs_adopt_ref_ = false;
   mutable bool in_dtor_ = false;
 #endif
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/strings/cstring_builder.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/strings/cstring_builder.cc
index 2cafe39..f7442c07 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/strings/cstring_builder.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/strings/cstring_builder.cc
@@ -16,7 +16,7 @@
 #include <cstring>
 #include <limits>
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 #include "partition_alloc/partition_alloc_base/check.h"
 #define PA_RAW_DCHECK PA_RAW_CHECK
 #else
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/thread_annotations.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/thread_annotations.h
index a5df5c2f..525beb3e 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/thread_annotations.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/thread_annotations.h
@@ -246,7 +246,7 @@
 
 // The above is imported as-is from abseil-cpp. The following Chromium-specific
 // synonyms are added for Chromium concepts (SequenceChecker/ThreadChecker).
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 // Equivalent to PA_GUARDED_BY for SequenceChecker/ThreadChecker. Currently,
 #define PA_GUARDED_BY_CONTEXT(name) PA_GUARDED_BY(name)
@@ -254,11 +254,11 @@
 // Equivalent to PA_EXCLUSIVE_LOCKS_REQUIRED for SequenceChecker/ThreadChecker.
 #define PA_VALID_CONTEXT_REQUIRED(name) PA_EXCLUSIVE_LOCKS_REQUIRED(name)
 
-#else  // BUILDFLAG(PA_DCHECK_IS_ON)
+#else  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 #define PA_GUARDED_BY_CONTEXT(name)
 #define PA_VALID_CONTEXT_REQUIRED(name)
 
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 #endif  // PARTITION_ALLOC_PARTITION_ALLOC_BASE_THREAD_ANNOTATIONS_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_posix.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_posix.cc
index dfdb0d1..e399951 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_posix.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_posix.cc
@@ -95,7 +95,7 @@
       g_is_main_thread = false;
     }
   } else {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     if (g_thread_id != syscall(__NR_gettid)) {
       PA_RAW_LOG(
           FATAL,
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_posix_for_testing.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_posix_for_testing.cc
index c8551ad..d0bb1eb 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_posix_for_testing.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_posix_for_testing.cc
@@ -26,7 +26,7 @@
 #include <sys/resource.h>
 #endif
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && PA_BUILDFLAG(USE_STARSCAN)
 #include "partition_alloc/stack/stack.h"
 #include "partition_alloc/starscan/pcscan.h"
 #endif
@@ -52,14 +52,14 @@
 
     delegate = thread_params->delegate;
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && PA_BUILDFLAG(USE_STARSCAN)
     StackTopRegistry::Get().NotifyThreadCreated();
 #endif
   }
 
   delegate->ThreadMain();
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && PA_BUILDFLAG(USE_STARSCAN)
   StackTopRegistry::Get().NotifyThreadDestroyed();
 #endif
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_win_for_testing.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_win_for_testing.cc
index 0e82dde..2ff67148 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_win_for_testing.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/threading/platform_thread_win_for_testing.cc
@@ -13,7 +13,7 @@
 #include "partition_alloc/partition_alloc_base/threading/platform_thread_for_testing.h"
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && PA_BUILDFLAG(USE_STARSCAN)
 #include "partition_alloc/stack/stack.h"
 #include "partition_alloc/starscan/pcscan.h"
 #endif
@@ -63,7 +63,7 @@
                                  GetCurrentProcess(), &platform_handle, 0,
                                  FALSE, DUPLICATE_SAME_ACCESS);
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && PA_BUILDFLAG(USE_STARSCAN)
   StackTopRegistry::Get().NotifyThreadCreated();
 #endif
 
@@ -75,7 +75,7 @@
   delete thread_params;
   delegate->ThreadMain();
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && PA_BUILDFLAG(USE_STARSCAN)
   StackTopRegistry::Get().NotifyThreadDestroyed();
 #endif
   return 0;
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/time/time.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/time/time.h
index 42bed11..9a33219 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/time/time.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/time/time.h
@@ -866,14 +866,14 @@
 
 #endif  // BUILDFLAG(IS_APPLE)
 
-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(PA_IS_CHROMEOS_ASH)
+#if BUILDFLAG(IS_ANDROID) || PA_BUILDFLAG(PA_IS_CHROMEOS_ASH)
   // Converts to TimeTicks the value obtained from SystemClock.uptimeMillis().
   // Note: this conversion may be non-monotonic in relation to previously
   // obtained TimeTicks::Now() values because of the truncation (to
   // milliseconds) performed by uptimeMillis().
   static TimeTicks FromUptimeMillis(int64_t uptime_millis_value);
 
-#endif  // BUILDFLAG(IS_ANDROID) || BUILDFLAG(PA_IS_CHROMEOS_ASH)
+#endif  // BUILDFLAG(IS_ANDROID) || PA_BUILDFLAG(PA_IS_CHROMEOS_ASH)
 
 #if BUILDFLAG(IS_ANDROID)
   // Converts to TimeTicks the value obtained from System.nanoTime(). This
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_check.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_check.h
index d589b03..3e8aa7b 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_check.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_check.h
@@ -25,7 +25,7 @@
 // As a consequence:
 // - When PartitionAlloc is not malloc(), use the regular macros
 // - Otherwise, crash immediately. This provides worse error messages though.
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && !PA_BASE_CHECK_WILL_STREAM()
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && !PA_BASE_CHECK_WILL_STREAM()
 
 // For official build discard log strings to reduce binary bloat.
 // See base/check.h for implementation details.
@@ -33,11 +33,11 @@
   PA_UNLIKELY(!(condition)) ? PA_IMMEDIATE_CRASH() \
                             : PA_EAT_CHECK_STREAM_PARAMS()
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 #define PA_DCHECK(condition) PA_CHECK(condition)
 #else
 #define PA_DCHECK(condition) PA_EAT_CHECK_STREAM_PARAMS(!(condition))
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 #define PA_PCHECK(condition)                                 \
   if (!(condition)) {                                        \
@@ -47,25 +47,25 @@
   }                                                          \
   static_assert(true)
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 #define PA_DPCHECK(condition) PA_PCHECK(condition)
 #else
 #define PA_DPCHECK(condition) PA_EAT_CHECK_STREAM_PARAMS(!(condition))
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
-#else  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) &&
+#else  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) &&
        // !PA_BASE_CHECK_WILL_STREAM()
 #define PA_CHECK(condition) PA_BASE_CHECK(condition)
 #define PA_DCHECK(condition) PA_BASE_DCHECK(condition)
 #define PA_PCHECK(condition) PA_BASE_PCHECK(condition)
 #define PA_DPCHECK(condition) PA_BASE_DPCHECK(condition)
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) &&
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) &&
         // !PA_BASE_CHECK_WILL_STREAM()
 
 // Expensive dchecks that run within *Scan. These checks are only enabled in
 // debug builds with dchecks enabled.
 #if !defined(NDEBUG)
-#define PA_SCAN_DCHECK_IS_ON() BUILDFLAG(PA_DCHECK_IS_ON)
+#define PA_SCAN_DCHECK_IS_ON() PA_BUILDFLAG(PA_DCHECK_IS_ON)
 #else
 #define PA_SCAN_DCHECK_IS_ON() 0
 #endif
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_config.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_config.h
index ac33c50c..67f47573 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_config.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_config.h
@@ -30,20 +30,20 @@
 
 // Assert that the heuristic in partition_alloc.gni is accurate on supported
 // configurations.
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 static_assert(sizeof(void*) == 8, "");
 #else
 static_assert(sizeof(void*) != 8, "");
 #endif  // PA_CONFIG(HAS_64_BITS_POINTERS)
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS) && \
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS) && \
     (defined(__ARM_NEON) || defined(__ARM_NEON__)) && defined(__ARM_FP)
 #define PA_CONFIG_STARSCAN_NEON_SUPPORTED() 1
 #else
 #define PA_CONFIG_STARSCAN_NEON_SUPPORTED() 0
 #endif
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS) && BUILDFLAG(IS_IOS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS) && BUILDFLAG(IS_IOS)
 // Allow PA to select an alternate pool size at run-time before initialization,
 // rather than using a single constexpr value.
 //
@@ -54,9 +54,9 @@
 #define PA_CONFIG_DYNAMICALLY_SELECT_POOL_SIZE() 1
 #else
 #define PA_CONFIG_DYNAMICALLY_SELECT_POOL_SIZE() 0
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS) && BUILDFLAG(IS_IOS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS) && BUILDFLAG(IS_IOS)
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS) && \
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS) && \
     (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID))
 #include <linux/version.h>
 // TODO(bikineev): Enable for ChromeOS.
@@ -64,10 +64,10 @@
   (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
 #else
 #define PA_CONFIG_STARSCAN_UFFD_WRITE_PROTECTOR_SUPPORTED() 0
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS) &&
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS) &&
         // (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID))
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 // Use card table to avoid races for PCScan configuration without safepoints.
 // The card table provides the guaranteee that for a marked card the underling
 // super-page is fully initialized.
@@ -75,7 +75,7 @@
 #else
 // The card table is permanently disabled for 32-bit.
 #define PA_CONFIG_STARSCAN_USE_CARD_TABLE() 0
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 
 // Use batched freeing when sweeping pages. This builds up a freelist in the
 // scanner thread and appends to the slot-span's freelist only once.
@@ -133,7 +133,7 @@
 // Too expensive for official builds, as it adds cache misses to all
 // allocations. On the other hand, we want wide metrics coverage to get
 // realistic profiles.
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && !defined(OFFICIAL_BUILD)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && !defined(OFFICIAL_BUILD)
 #define PA_CONFIG_THREAD_CACHE_ALLOC_STATS() 1
 #else
 #define PA_CONFIG_THREAD_CACHE_ALLOC_STATS() 0
@@ -156,12 +156,12 @@
 #define PA_CONFIG_HAS_FREELIST_SHADOW_ENTRY() 0
 #endif
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 static_assert(sizeof(void*) == 8);
 #endif
 
 // Specifies whether allocation extras need to be added.
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 #define PA_CONFIG_EXTRAS_REQUIRED() 1
 #else
 #define PA_CONFIG_EXTRAS_REQUIRED() 0
@@ -201,10 +201,11 @@
 // calling malloc() again.
 //
 // Limitations:
-// - BUILDFLAG(PA_DCHECK_IS_ON) due to runtime cost
+// - PA_BUILDFLAG(PA_DCHECK_IS_ON) due to runtime cost
 // - thread_local TLS to simplify the implementation
 // - Not on Android due to bot failures
-#if BUILDFLAG(PA_DCHECK_IS_ON) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) &&               \
+    PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \
     PA_CONFIG(THREAD_LOCAL_TLS) && !BUILDFLAG(IS_ANDROID)
 #define PA_CONFIG_HAS_ALLOCATION_GUARD() 1
 #else
@@ -235,7 +236,7 @@
 
 // PartitionAlloc uses PartitionRootEnumerator to acquire all
 // PartitionRoots at BeforeFork and to release at AfterFork.
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && PA_CONFIG(HAS_ATFORK_HANDLER)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && PA_CONFIG(HAS_ATFORK_HANDLER)
 #define PA_CONFIG_USE_PARTITION_ROOT_ENUMERATOR() 1
 #else
 #define PA_CONFIG_USE_PARTITION_ROOT_ENUMERATOR() 0
@@ -245,11 +246,11 @@
 // are on. However, don't do this if that would cause InSlotMetadata to grow
 // past the size that would fit in InSlotMetadataTable (see
 // partition_alloc_constants.h), which currently can happen only when DPD is on.
-#define PA_CONFIG_IN_SLOT_METADATA_CHECK_COOKIE() \
-  (!(BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS) && \
-     BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)) && \
-   (BUILDFLAG(PA_DCHECK_IS_ON) ||                 \
-    BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)))
+#define PA_CONFIG_IN_SLOT_METADATA_CHECK_COOKIE()    \
+  (!(BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS) &&    \
+     PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)) && \
+   (BUILDFLAG(PA_DCHECK_IS_ON) ||                    \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)))
 
 // Use available space in the reference count to store the initially requested
 // size from the application. This is used for debugging.
@@ -290,8 +291,8 @@
 // metadatas are placed, and the real metadatas are set to read-only instead.
 // This feature is only enabled with 64-bit environment because pools work
 // differently with 32-bits pointers (see glossary).
-#if BUILDFLAG(ENABLE_SHADOW_METADATA_FOR_64_BITS_POINTERS) && \
-    BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(ENABLE_SHADOW_METADATA_FOR_64_BITS_POINTERS) && \
+    PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 #define PA_CONFIG_ENABLE_SHADOW_METADATA() 1
 #else
 #define PA_CONFIG_ENABLE_SHADOW_METADATA() 0
@@ -308,23 +309,23 @@
 //
 // The settings has MAYBE_ in the name, because the final decision to enable is
 // based on the operarting system version check done at run-time.
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) && BUILDFLAG(IS_MAC)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) && BUILDFLAG(IS_MAC)
 #define PA_CONFIG_MAYBE_ENABLE_MAC11_MALLOC_SIZE_HACK() 1
 #else
 #define PA_CONFIG_MAYBE_ENABLE_MAC11_MALLOC_SIZE_HACK() 0
 #endif
 
-#if BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#if PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 
 #if PA_CONFIG(DYNAMICALLY_SELECT_POOL_SIZE)
 #error "Dynamically selected pool size is currently not supported"
 #endif
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 // TODO(crbug.com/40243421): Address MTE once it's enabled.
 #error "Compressed pointers don't support tag in the upper bits"
 #endif
 
-#endif  // BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+#endif  // PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 
 // PA_CONFIG(IS_NONCLANG_MSVC): mimics the compound condition used by
 // Chromium's `//base/compiler_specific.h` to detect true (non-Clang)
@@ -336,9 +337,9 @@
 #endif
 
 // Set GN build override 'assert_cpp_20' to false to disable assertion.
-#if BUILDFLAG(ASSERT_CPP_20)
+#if PA_BUILDFLAG(ASSERT_CPP_20)
 static_assert(__cplusplus >= 202002L,
               "PartitionAlloc targets C++20 or higher.");
-#endif  // BUILDFLAG(ASSERT_CPP_20)
+#endif  // PA_BUILDFLAG(ASSERT_CPP_20)
 
 #endif  // PARTITION_ALLOC_PARTITION_ALLOC_CONFIG_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_constants.h b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_constants.h
index 1cc238c..63652bc 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_constants.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_constants.h
@@ -23,7 +23,7 @@
 #include <mach/vm_page_size.h>
 #endif
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 #include "partition_alloc/tagging.h"
 #endif
 
@@ -286,13 +286,13 @@
 
   kRegularPoolHandle,
   kBRPPoolHandle,
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   kConfigurablePoolHandle,
 #endif
 
 // New pool_handles will be added here.
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   // The thread isolated pool must come last since we write-protect its entry in
   // the metadata tables, e.g. AddressPoolManager::aligned_pools_
   kThreadIsolatedPoolHandle,
@@ -314,19 +314,19 @@
 //
 // When pointer compression is enabled, we cannot use large pools (at most
 // 8GB for each of the glued pools).
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) || \
-    BUILDFLAG(ENABLE_POINTER_COMPRESSION)
+    PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
 constexpr size_t kPoolMaxSize = 8 * kGiB;
 #else
 constexpr size_t kPoolMaxSize = 16 * kGiB;
 #endif
-#else  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#else  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 constexpr size_t kPoolMaxSize = 4 * kGiB;
 #endif
 constexpr size_t kMaxSuperPagesInPool = kPoolMaxSize / kSuperPageSize;
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 static_assert(kThreadIsolatedPoolHandle == kNumPools,
               "The thread isolated pool must come last since we write-protect "
               "its metadata.");
@@ -338,7 +338,7 @@
 // of large areas which are less likely to benefit from MTE protection.
 constexpr size_t kMaxMemoryTaggingSize = 1024;
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 // Returns whether the tag of |object| overflowed, meaning the containing slot
 // needs to be moved to quarantine.
 PA_ALWAYS_INLINE bool HasOverflowTag(void* object) {
@@ -348,7 +348,7 @@
                 "Overflow tag must be in tag bits");
   return (reinterpret_cast<uintptr_t>(object) & kPtrTagMask) == kOverflowTag;
 }
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
 PA_ALWAYS_INLINE PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR size_t
 NumPartitionPagesPerSuperPage() {
@@ -359,7 +359,7 @@
   return kMaxSuperPagesInPool;
 }
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 // In 64-bit mode, the direct map allocation granularity is super page size,
 // because this is the reservation granularity of the pools.
 PA_ALWAYS_INLINE constexpr size_t DirectMapAllocationGranularity() {
@@ -369,7 +369,7 @@
 PA_ALWAYS_INLINE constexpr size_t DirectMapAllocationGranularityShift() {
   return kSuperPageShift;
 }
-#else   // BUILDFLAG(HAS_64_BIT_POINTERS)
+#else   // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 // In 32-bit mode, address space is space is a scarce resource. Use the system
 // allocation granularity, which is the lowest possible address space allocation
 // unit. However, don't go below partition page size, so that pool bitmaps
@@ -383,7 +383,7 @@
 DirectMapAllocationGranularityShift() {
   return std::max(PageAllocationGranularityShift(), PartitionPageShift());
 }
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 PA_ALWAYS_INLINE PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR size_t
 DirectMapAllocationGranularityOffsetMask() {
@@ -470,7 +470,7 @@
 // PurgeFlags::kDecommitEmptySlotSpans flag will eagerly decommit all entries
 // in the ring buffer, so with periodic purge enabled, this typically happens
 // every few seconds.
-#if BUILDFLAG(USE_LARGE_EMPTY_SLOT_SPAN_RING)
+#if PA_BUILDFLAG(USE_LARGE_EMPTY_SLOT_SPAN_RING)
 // USE_LARGE_EMPTY_SLOT_SPAN_RING results in two size. kMaxEmptyCacheIndexBits,
 // which is used when the renderer is in the foreground, and
 // kMinEmptyCacheIndexBits which is used when the renderer is in the background.
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_unittest.cc
index cba6e61..fae9c9c 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_unittest.cc
@@ -70,7 +70,7 @@
 #include <sys/time.h>
 #endif  // BUILDFLAG(IS_POSIX)
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(IS_MAC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(IS_MAC)
 #include <OpenCL/opencl.h>
 #endif
 
@@ -78,7 +78,7 @@
 #include "partition_alloc/partition_alloc_base/mac/mac_util.h"
 #endif
 
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
 #include <sys/syscall.h>
 #endif
 
@@ -263,7 +263,7 @@
       PartitionAllocTestParam{BucketDistribution::kNeutral, false});
   params.emplace_back(
       PartitionAllocTestParam{BucketDistribution::kDenser, false});
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
   if (CPUHasPkeySupport()) {
     params.emplace_back(
         PartitionAllocTestParam{BucketDistribution::kNeutral, true});
@@ -350,11 +350,11 @@
   }
 
   void InitializeMainTestAllocators() {
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     PartitionOptions::EnableToggle enable_backup_ref_ptr =
         PartitionOptions::kEnabled;
 #endif
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
     int pkey = PkeyAlloc(UseThreadIsolatedPool() ? 0 : PKEY_DISABLE_WRITE);
     if (pkey != -1) {
       pkey_ = pkey;
@@ -372,22 +372,22 @@
     ThreadIsolationOption thread_isolation_opt;
     if (UseThreadIsolatedPool() && pkey_ != kInvalidPkey) {
       thread_isolation_opt = ThreadIsolationOption(pkey_);
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
       // BRP and thread isolated mode use different pools, so they can't be
       // enabled at the same time.
       enable_backup_ref_ptr = PartitionOptions::kDisabled;
 #endif
     }
-#endif  // BUILDFLAG(ENABLE_PKEYS)
+#endif  // PA_BUILDFLAG(ENABLE_PKEYS)
 
     PartitionOptions opts = GetCommonPartitionOptions();
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     opts.backup_ref_ptr = enable_backup_ref_ptr;
 #endif
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
     opts.thread_isolation = thread_isolation_opt;
 #endif
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
     opts.memory_tagging = {
         .enabled =
             partition_alloc::internal::base::CPU::GetInstanceNoAllocation()
@@ -395,7 +395,7 @@
                 ? PartitionOptions::kEnabled
                 : PartitionOptions::kDisabled,
     };
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
     InitializeTestRoot(
         allocator.root(), opts,
         PartitionTestOptions{.use_memory_reclaimer = true,
@@ -423,7 +423,7 @@
     allocator.root()->PurgeMemory(PurgeFlags::kDecommitEmptySlotSpans |
                                   PurgeFlags::kDiscardUnusedSystemPages);
     PartitionAllocGlobalUninitForTesting();
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
     if (pkey_ != kInvalidPkey) {
       PkeyFree(pkey_);
     }
@@ -443,12 +443,12 @@
   static size_t ExtraAllocSize(const PartitionAllocator& allocator) {
     size_t metadata_size = 0;
     // Duplicate the logic from PartitionRoot::Init().
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     if (allocator.root()->brp_enabled()) {
       metadata_size =
           AlignUpInSlotMetadataSizeForApple(kInSlotMetadataSizeAdjustment);
     }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     return kExtraAllocSizeWithoutMetadata + metadata_size;
   }
 
@@ -574,7 +574,7 @@
     PA_LOG(FATAL) << "Passed DoReturnNullTest";
   }
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   void RunRefCountReallocSubtest(size_t orig_size, size_t new_size);
 #endif
 
@@ -590,20 +590,20 @@
 
   bool UseThreadIsolatedPool() const { return GetParam().use_pkey_pool; }
   bool UseBRPPool() const {
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     return allocator.root()->brp_enabled();
 #else
     return false;
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   }
 
   partition_alloc::PartitionAllocatorForTesting allocator;
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
   partition_alloc::PartitionAllocatorForTesting pkey_allocator;
 #endif
   size_t test_bucket_index_;
 
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
   int pkey_ = kInvalidPkey;
 #endif
 };
@@ -1101,7 +1101,7 @@
   // Check that the realloc copied correctly.
   char* new_char_ptr = static_cast<char*>(new_ptr);
   EXPECT_EQ(*new_char_ptr, 'A');
-#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
+#if PA_BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
   // Subtle: this checks for an old bug where we copied too much from the
   // source of the realloc. The condition can be detected by a trashing of
   // the uninitialized value in the space of the upsized allocation.
@@ -1217,7 +1217,7 @@
     allocator.root()->Free(new_ptr_2);
     allocator.root()->Free(ptr4);
 
-#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
+#if PA_BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
     // |SlotSpanMetadata::Free| must poison the slot's contents with
     // |kFreedByte|.
     EXPECT_EQ(kFreedByte,
@@ -1271,7 +1271,7 @@
       allocator.root()->AllocationCapacityFromSlotStart(slot_start);
   EXPECT_EQ(predicted_capacity, actual_capacity);
   EXPECT_LT(requested_size, actual_capacity);
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   if (UseBRPPool()) {
     uintptr_t address = UntagPtr(ptr);
     for (size_t offset = 0; offset < requested_size; ++offset) {
@@ -1280,7 +1280,7 @@
                 slot_start);
     }
   }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   allocator.root()->Free(ptr);
 
   // Allocate a size that should be a perfect match for a bucket, because it
@@ -1295,7 +1295,7 @@
       allocator.root()->AllocationCapacityFromSlotStart(slot_start);
   EXPECT_EQ(predicted_capacity, actual_capacity);
   EXPECT_EQ(requested_size, actual_capacity);
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   if (UseBRPPool()) {
     uintptr_t address = UntagPtr(ptr);
     for (size_t offset = 0; offset < requested_size; offset += 877) {
@@ -1304,7 +1304,7 @@
                 slot_start);
     }
   }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   allocator.root()->Free(ptr);
 
   // Allocate a size that is a system page smaller than a bucket.
@@ -1325,7 +1325,7 @@
       allocator.root()->AllocationCapacityFromSlotStart(slot_start);
   EXPECT_EQ(predicted_capacity, actual_capacity);
   EXPECT_EQ(requested_size + SystemPageSize(), actual_capacity);
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   if (UseBRPPool()) {
     uintptr_t address = UntagPtr(ptr);
     for (size_t offset = 0; offset < requested_size; offset += 4999) {
@@ -1334,7 +1334,7 @@
                 slot_start);
     }
   }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   allocator.root()->Free(ptr);
 
   // Allocate the maximum allowed bucketed size.
@@ -1348,7 +1348,7 @@
       allocator.root()->AllocationCapacityFromSlotStart(slot_start);
   EXPECT_EQ(predicted_capacity, actual_capacity);
   EXPECT_EQ(requested_size, actual_capacity);
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   if (UseBRPPool()) {
     uintptr_t address = UntagPtr(ptr);
     for (size_t offset = 0; offset < requested_size; offset += 4999) {
@@ -1357,7 +1357,7 @@
                 slot_start);
     }
   }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
   // Check that we can write at the end of the reported size too.
   char* char_ptr = static_cast<char*>(ptr);
@@ -1378,7 +1378,7 @@
 
     EXPECT_LT(requested_size, actual_capacity);
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     if (UseBRPPool()) {
       uintptr_t address = UntagPtr(ptr);
       for (size_t offset = 0; offset < requested_size; offset += 16111) {
@@ -1387,7 +1387,7 @@
                   slot_start);
       }
     }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     allocator.root()->Free(ptr);
   }
 
@@ -1398,7 +1398,7 @@
   EXPECT_EQ(requested_size, predicted_capacity);
 }
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 TEST_P(PartitionAllocTest, MTEProtectsFreedPtr) {
   // This test checks that Arm's memory tagging extension (MTE) is correctly
   // protecting freed pointers.
@@ -1437,9 +1437,9 @@
   // We don't check anything about ptr3, but we do clean it up to avoid DCHECKs.
   allocator.root()->Free(ptr3);
 }
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 TEST_P(PartitionAllocTest, IsPtrWithinSameAlloc) {
   if (!UseBRPPool()) {
     return;
@@ -1462,7 +1462,7 @@
                            kMaxBucketed + SystemPageSize(),
                            kMaxBucketed + PartitionPageSize(),
                            kSuperPageSize};
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   constexpr size_t kFarFarAwayDelta = 512 * kGiB;
 #else
   constexpr size_t kFarFarAwayDelta = kGiB;
@@ -1502,7 +1502,7 @@
                 PtrPosWithinAlloc::kInBounds);
       EXPECT_EQ(IsPtrWithinSameAlloc(address, address + requested_size / 2, 0u),
                 PtrPosWithinAlloc::kInBounds);
-#if BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
       EXPECT_EQ(IsPtrWithinSameAlloc(address, address + requested_size - 1, 1u),
                 PtrPosWithinAlloc::kInBounds);
       EXPECT_EQ(IsPtrWithinSameAlloc(address, address + requested_size, 1u),
@@ -1514,7 +1514,7 @@
                       address, address + requested_size - subtrahend, 4u),
                   PtrPosWithinAlloc::kAllocEnd);
       }
-#else  // BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#else  // PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
       EXPECT_EQ(IsPtrWithinSameAlloc(address, address + requested_size, 0u),
                 PtrPosWithinAlloc::kInBounds);
 #endif
@@ -1537,7 +1537,7 @@
       EXPECT_EQ(IsPtrWithinSameAlloc(address + requested_size,
                                      address + requested_size + 1, 0u),
                 PtrPosWithinAlloc::kFarOOB);
-#if BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
       EXPECT_EQ(IsPtrWithinSameAlloc(address + requested_size - 1,
                                      address + requested_size - 1, 1u),
                 PtrPosWithinAlloc::kInBounds);
@@ -1556,7 +1556,7 @@
                                  address + requested_size - 4 + addend, 4u),
             PtrPosWithinAlloc::kAllocEnd);
       }
-#else  // BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#else  // PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
       EXPECT_EQ(IsPtrWithinSameAlloc(address + requested_size,
                                      address + requested_size, 0u),
                 PtrPosWithinAlloc::kInBounds);
@@ -1641,7 +1641,7 @@
     allocator.root()->Free(ptr);
   }
 }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 // Test the realloc() contract.
 TEST_P(PartitionAllocTest, Realloc) {
@@ -1668,7 +1668,7 @@
   char* char_ptr2 = static_cast<char*>(ptr2);
   EXPECT_EQ('A', char_ptr2[0]);
   EXPECT_EQ('A', char_ptr2[size - 1]);
-#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
+#if PA_BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
   EXPECT_EQ(kUninitializedByte, static_cast<unsigned char>(char_ptr2[size]));
 #endif
 
@@ -1680,7 +1680,7 @@
   char* char_ptr = static_cast<char*>(ptr);
   EXPECT_EQ('A', char_ptr[0]);
   EXPECT_EQ('A', char_ptr[size - 2]);
-#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
+#if PA_BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
   EXPECT_EQ(kUninitializedByte, static_cast<unsigned char>(char_ptr[size - 1]));
 #endif
 
@@ -1700,7 +1700,7 @@
   char_ptr2 = static_cast<char*>(ptr2);
   EXPECT_EQ('A', char_ptr2[0]);
   EXPECT_EQ('A', char_ptr2[size - 1]);
-#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
+#if PA_BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
   EXPECT_EQ(kUninitializedByte, static_cast<unsigned char>(char_ptr2[size]));
 #endif
   allocator.root()->Free(ptr2);
@@ -1716,7 +1716,7 @@
   char_ptr2 = static_cast<char*>(ptr2);
   EXPECT_EQ('A', char_ptr2[0]);
   EXPECT_EQ('A', char_ptr2[size / 2 - 1]);
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   // For single-slot slot spans, the cookie is always placed immediately after
   // the allocation.
   EXPECT_EQ(kCookieValue[0], static_cast<unsigned char>(char_ptr2[size / 2]));
@@ -2404,7 +2404,7 @@
 // Performing them as death tests causes them to be forked into their own
 // process, so they won't pollute other tests.
 //
-// These tests are *very* slow when BUILDFLAG(PA_DCHECK_IS_ON), because they
+// These tests are *very* slow when PA_BUILDFLAG(PA_DCHECK_IS_ON), because they
 // memset() many GiB of data (see crbug.com/1168168).
 // TODO(lizeb): make these tests faster.
 TEST_P(PartitionAllocDeathTest, MAYBE_RepeatedAllocReturnNullDirect) {
@@ -2446,7 +2446,7 @@
                "Passed DoReturnNullTest");
 }
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 // Check that Arm's memory tagging extension (MTE) is correctly protecting
 // freed pointers. Writes to a free pointer should result in a crash.
 TEST_P(PartitionAllocDeathTest, MTEProtectsFreedPtr) {
@@ -2479,7 +2479,7 @@
       },
       testing::KilledBySignal(SIGSEGV), "");
 }
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
 // Make sure that malloc(-1) dies.
 // In the past, we had an integer overflow that would alias malloc(-1) to
@@ -2609,7 +2609,8 @@
   allocator.root()->Free(fake_freelist_entry);
 }
 
-// With BUILDFLAG(PA_DCHECK_IS_ON), cookie already handles off-by-one detection.
+// With PA_BUILDFLAG(PA_DCHECK_IS_ON), cookie already handles off-by-one
+// detection.
 #if !BUILDFLAG(PA_DCHECK_IS_ON)
 TEST_P(PartitionAllocDeathTest, OffByOneDetection) {
   base::CPU cpu;
@@ -4160,7 +4161,7 @@
   }
 }
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 TEST_P(PartitionAllocTest, RefCountBasic) {
   if (!UseBRPPool()) {
@@ -4378,9 +4379,9 @@
   }
 }
 #endif  // !BUILDFLAG(HAS_64_BIT_POINTERS)
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
-#if BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
+#if PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
 
 // Allocate memory, and reference it from 3 raw_ptr. Among them 2 will be
 // dangling.
@@ -4822,7 +4823,7 @@
 
 #endif  //! defined(OFFICIAL_BUILD) || !defined(NDEBUG)
 #endif  // PA_USE_DEATH_TESTS()
-#endif  // BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
+#endif  // PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
 
 TEST_P(PartitionAllocTest, ReservationOffset) {
   // For normal buckets, offset should be kOffsetTagNormalBuckets.
@@ -4957,10 +4958,11 @@
       partition_alloc::internal::base::bits::AlignDown(address, kSuperPageSize);
 
   // DCHECKs don't work with EXPECT_DEATH on official builds.
-#if BUILDFLAG(PA_DCHECK_IS_ON) && (!defined(OFFICIAL_BUILD) || !defined(NDEBUG))
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) && \
+    (!defined(OFFICIAL_BUILD) || !defined(NDEBUG))
   // Expect to DCHECK on unallocated region.
   EXPECT_DEATH_IF_SUPPORTED(IsReservationStart(address_to_check), "");
-#endif  //  BUILDFLAG(PA_DCHECK_IS_ON) && (!defined(OFFICIAL_BUILD) ||
+#endif  //  PA_BUILDFLAG(PA_DCHECK_IS_ON) && (!defined(OFFICIAL_BUILD) ||
         //  !defined(NDEBUG))
 
   EXPECT_FALSE(IsManagedByNormalBuckets(address_to_check));
@@ -5042,7 +5044,7 @@
 // Not on chromecast, since gtest considers extra output from itself as a test
 // failure:
 // https://ci.chromium.org/ui/p/chromium/builders/ci/Cast%20Audio%20Linux/98492/overview
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && PA_USE_DEATH_TESTS() && \
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && PA_USE_DEATH_TESTS() && \
     !BUILDFLAG(PA_IS_CASTOS)
 
 namespace {
@@ -5119,7 +5121,7 @@
   }
 }
 
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) &&
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) &&
         // PA_USE_DEATH_TESTS() && !BUILDFLAG(PA_IS_CASTOS)
 
 // Checks the bucket index logic.
@@ -5337,7 +5339,8 @@
 #endif
 }
 
-#if BUILDFLAG(PA_IS_CAST_ANDROID) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(PA_IS_CAST_ANDROID) && \
+    PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 extern "C" {
 void* __real_malloc(size_t);
 }  // extern "C"
@@ -5405,16 +5408,16 @@
   allocator.root()->Free(first_ptr);
 }
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(IS_LINUX) && \
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(IS_LINUX) && \
     defined(ARCH_CPU_64_BITS)
 TEST_P(PartitionAllocTest, CrashOnUnknownPointer) {
   int not_a_heap_object = 42;
   EXPECT_DEATH(allocator.root()->Free(&not_a_heap_object), "");
 }
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) &&
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) &&
         // BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_64_BITS)
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(IS_MAC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(IS_MAC)
 
 // Adapted from crashpad tests.
 class ScopedOpenCLNoOpKernel {
@@ -5509,7 +5512,7 @@
 #endif
 }
 
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) &&
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) &&
         // BUILDFLAG(IS_MAC)
 
 TEST_P(PartitionAllocTest, SmallSlotSpanWaste) {
@@ -5600,7 +5603,7 @@
   run_test(1);
 }
 
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
 TEST_P(PartitionAllocTest, FreeSlotBitmapMarkedAsUsedAfterAlloc) {
   void* ptr = allocator.root()->Alloc(kTestAllocSize, type_name);
   uintptr_t slot_start = allocator.root()->ObjectToSlotStart(ptr);
@@ -5648,9 +5651,9 @@
   allocator.root()->Free(ptr1);
 }
 
-#endif  // BUILDFLAG(USE_FREESLOT_BITMAP)
+#endif  // PA_BUILDFLAG(USE_FREESLOT_BITMAP)
 
-#if BUILDFLAG(USE_LARGE_EMPTY_SLOT_SPAN_RING)
+#if PA_BUILDFLAG(USE_LARGE_EMPTY_SLOT_SPAN_RING)
 TEST_P(PartitionAllocTest, GlobalEmptySlotSpanRingIndexResets) {
   // Switch to the larger slot span size, and set the
   // global_empty_slot_span_ring_index to one less than max.
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_bucket.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_bucket.cc
index a91b507..a4111ba 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_bucket.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_bucket.cc
@@ -38,7 +38,7 @@
 #include "partition_alloc/reservation_offset_table.h"
 #include "partition_alloc/tagging.h"
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 #include "partition_alloc/starscan/pcscan.h"
 #endif
 
@@ -73,7 +73,8 @@
   PA_IMMEDIATE_CRASH();  // Not required, kept as documentation.
 }
 
-#if !BUILDFLAG(HAS_64_BIT_POINTERS) && BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if !BUILDFLAG(HAS_64_BIT_POINTERS) && \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 // |start| has to be aligned to kSuperPageSize, but |end| doesn't. This means
 // that a partial super page is allowed at the end. Since the block list uses
 // kSuperPageSize granularity, a partial super page is considered blocked if
@@ -93,7 +94,7 @@
   return true;
 }
 #endif  // !BUILDFLAG(HAS_64_BIT_POINTERS) &&
-        // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+        // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 // Reserves |requested_size| worth of super pages from the specified pool.
 // If BRP pool is requested this function will honor BRP block list.
@@ -122,7 +123,8 @@
 
   // In 32-bit mode, when allocating from BRP pool, verify that the requested
   // allocation honors the block list. Find a better address otherwise.
-#if !BUILDFLAG(HAS_64_BIT_POINTERS) && BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if !BUILDFLAG(HAS_64_BIT_POINTERS) && \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   if (pool == kBRPPoolHandle) {
     constexpr int kMaxRandomAddressTries = 10;
     for (int i = 0; i < kMaxRandomAddressTries; ++i) {
@@ -172,7 +174,7 @@
     }
   }
 #endif  // !BUILDFLAG(HAS_64_BIT_POINTERS) &&
-        // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+        // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 #if !BUILDFLAG(HAS_64_BIT_POINTERS)
   // Only mark the region as belonging to the pool after it has passed the
@@ -264,7 +266,7 @@
     const size_t reservation_size = PartitionRoot::GetDirectMapReservationSize(
         raw_size + padding_for_alignment);
     PA_DCHECK(reservation_size >= raw_size);
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     const size_t available_reservation_size =
         reservation_size - padding_for_alignment -
         PartitionRoot::GetDirectMapMetadataAndGuardPagesSize();
@@ -755,7 +757,7 @@
   uintptr_t state_bitmap =
       super_page + PartitionPageSize() +
       (is_direct_mapped() ? 0 : ReservedFreeSlotBitmapSize());
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
   PA_DCHECK(SuperPageStateBitmapAddr(super_page) == state_bitmap);
   const size_t state_bitmap_reservation_size =
       root->IsQuarantineAllowed() ? ReservedStateBitmapSize() : 0;
@@ -767,7 +769,7 @@
   uintptr_t payload = state_bitmap + state_bitmap_reservation_size;
 #else
   uintptr_t payload = state_bitmap;
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 
   root->next_partition_page = payload;
   root->next_partition_page_end = root->next_super_page - PartitionPageSize();
@@ -860,7 +862,7 @@
   // sure to register the super-page after it has been fully initialized.
   // Otherwise, the concurrent scanner may try to access |extent->root| which
   // could be not initialized yet.
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
   if (root->IsQuarantineEnabled()) {
     {
       ScopedSyscallTimer timer{root};
@@ -871,9 +873,9 @@
     }
     PCScan::RegisterNewSuperPage(root, super_page);
   }
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
   // Commit the pages for freeslot bitmap.
   if (!is_direct_mapped()) {
     uintptr_t freeslot_bitmap_addr = super_page + PartitionPageSize();
@@ -964,14 +966,14 @@
                 slot_span->num_unprovisioned_slots <=
             get_slots_per_span());
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   const bool use_tagging =
       root->IsMemoryTaggingEnabled() && slot_size <= kMaxMemoryTaggingSize;
   if (PA_LIKELY(use_tagging)) {
     // Ensure the MTE-tag of the memory pointed by |return_slot| is unguessable.
     TagMemoryRangeRandomly(return_slot, slot_size);
   }
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   // Add all slots that fit within so far committed pages to the free list.
   PartitionFreelistEntry* prev_entry = nullptr;
   uintptr_t next_slot_end = next_slot + slot_size;
@@ -981,7 +983,7 @@
 
   while (next_slot_end <= commit_end) {
     void* next_slot_ptr;
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
     if (PA_LIKELY(use_tagging)) {
       // Ensure the MTE-tag of the memory pointed by other provisioned slot is
       // unguessable. They will be returned to the app as is, and the MTE-tag
@@ -991,7 +993,7 @@
       // No MTE-tagging for larger slots, just cast.
       next_slot_ptr = reinterpret_cast<void*>(next_slot);
     }
-#else  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#else  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
     next_slot_ptr = reinterpret_cast<void*>(next_slot);
 #endif
 
@@ -1005,22 +1007,22 @@
       PA_DCHECK(free_list_entries_added);
       freelist_dispatcher->SetNext(prev_entry, entry);
     }
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
     FreeSlotBitmapMarkSlotAsFree(next_slot);
 #endif
     next_slot = next_slot_end;
     next_slot_end = next_slot + slot_size;
     prev_entry = entry;
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     free_list_entries_added++;
 #endif
   }
 
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
   FreeSlotBitmapMarkSlotAsFree(return_slot);
 #endif
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   // The only provisioned slot not added to the free list is the one being
   // returned.
   PA_DCHECK(slots_to_provision == free_list_entries_added + 1);
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_bucket_lookup.h b/base/allocator/partition_allocator/src/partition_alloc/partition_bucket_lookup.h
index 3b12a30..b2643784 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_bucket_lookup.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_bucket_lookup.h
@@ -44,11 +44,11 @@
          (kNumBucketsPerOrderBits + 1);
 }
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 static_assert(kBitsPerSizeT == 64, "");
 #else
 static_assert(kBitsPerSizeT == 32, "");
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 // Orders range from 0 to `kBitsPerSizeT`, inclusive.
 inline constexpr uint8_t kNumOrders = kBitsPerSizeT + 1;
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_cookie.h b/base/allocator/partition_allocator/src/partition_alloc/partition_cookie.h
index 9db2a3e6..be2ba028 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_cookie.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_cookie.h
@@ -14,7 +14,7 @@
 static constexpr size_t kCookieSize = 16;
 
 // Cookie is enabled for debug builds.
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 inline constexpr unsigned char kCookieValue[kCookieSize] = {
     0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE, 0xD0, 0x0D,
@@ -42,7 +42,7 @@
 
 PA_ALWAYS_INLINE void PartitionCookieWriteValue(unsigned char* cookie_ptr) {}
 
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 }  // namespace partition_alloc::internal
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_dcheck_helper.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_dcheck_helper.cc
index 0609571..f1f5a35 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_dcheck_helper.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_dcheck_helper.cc
@@ -12,7 +12,7 @@
 
 namespace partition_alloc::internal {
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 void DCheckIsValidSlotSpan(internal::SlotSpanMetadata* slot_span) {
   PartitionRoot* root = PartitionRoot::FromSlotSpanMetadata(slot_span);
@@ -62,6 +62,6 @@
   DCheckRootLockIsAcquired(PartitionRoot::FromSlotSpanMetadata(slot_span));
 }
 
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 }  // namespace partition_alloc::internal
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_dcheck_helper.h b/base/allocator/partition_allocator/src/partition_alloc/partition_dcheck_helper.h
index ace5d32c..dec2aa2 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_dcheck_helper.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_dcheck_helper.h
@@ -14,7 +14,7 @@
 
 struct PartitionSuperPageExtentEntry;
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 // To allow these asserts to have empty bodies in no-DCHECK() builds, while
 // avoiding issues with circular includes.
@@ -22,7 +22,7 @@
 // Export symbol if dcheck-is-on. Because the body is not empty.
 #define PA_EXPORT_IF_DCHECK_IS_ON() PA_COMPONENT_EXPORT(PARTITION_ALLOC)
 
-#else  // BUILDFLAG(PA_DCHECK_IS_ON)
+#else  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 // The static_assert() eats follow-on semicolons.
 #define PA_EMPTY_BODY_IF_DCHECK_IS_OFF() \
@@ -31,7 +31,7 @@
 // inline if dcheck-is-off so it's no overhead.
 #define PA_EXPORT_IF_DCHECK_IS_ON() PA_ALWAYS_INLINE
 
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 PA_EXPORT_IF_DCHECK_IS_ON()
 void DCheckIsValidSlotSpan(internal::SlotSpanMetadata* slot_span)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_freelist_entry.h b/base/allocator/partition_allocator/src/partition_alloc/partition_freelist_entry.h
index f787eeb..244e52b 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_freelist_entry.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_freelist_entry.h
@@ -27,7 +27,7 @@
 // We are assessing an alternate implementation using an alternate
 // encoding (pool offsets). When build support is enabled, the
 // freelist implementation is determined at runtime.
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
 #include "partition_alloc/pool_offset_freelist.h"  // IWYU pragma: export
 #endif
 
@@ -37,7 +37,7 @@
 
 static_assert(kSmallestBucket >= sizeof(EncodedNextFreelistEntry),
               "Need enough space for freelist entries in the smallest slot");
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
 static_assert(kSmallestBucket >= sizeof(PoolOffsetFreelistEntry),
               "Need enough space for freelist entries in the smallest slot");
 #endif
@@ -47,22 +47,22 @@
   kPoolOffsetFreeList,
 };
 
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
 union PartitionFreelistEntry {
   EncodedNextFreelistEntry encoded_entry_;
   PoolOffsetFreelistEntry pool_offset_entry_;
 };
 #else
 using PartitionFreelistEntry = EncodedNextFreelistEntry;
-#endif  // BUILDFLAG(USE_FREELIST_DISPATCHER)
+#endif  // PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
 
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
 static_assert(offsetof(PartitionFreelistEntry, encoded_entry_) == 0ull);
 static_assert(offsetof(PartitionFreelistEntry, pool_offset_entry_) == 0ull);
 #endif
 
 struct PartitionFreelistDispatcher {
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
   static const PartitionFreelistDispatcher* Create(
       PartitionFreelistEncoding encoding);
 
@@ -186,10 +186,10 @@
   }
 
   ~PartitionFreelistDispatcher() = default;
-#endif  // BUILDFLAG(USE_FREELIST_DISPATCHER)
+#endif  // PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
 };
 
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
 template <PartitionFreelistEncoding encoding>
 struct PartitionFreelistDispatcherImpl : PartitionFreelistDispatcher {
   using Entry =
@@ -312,7 +312,7 @@
     }
   }
 }
-#endif  // BUILDFLAG(USE_FREELIST_DISPATCHER)
+#endif  // PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
 }  // namespace partition_alloc::internal
 
 #endif  // PARTITION_ALLOC_PARTITION_FREELIST_ENTRY_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_lock.h b/base/allocator/partition_allocator/src/partition_alloc/partition_lock.h
index 5b3c8d80..d83fa6e 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_lock.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_lock.h
@@ -24,8 +24,8 @@
  public:
   inline constexpr Lock();
   void Acquire() PA_EXCLUSIVE_LOCK_FUNCTION() {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
     LiftThreadIsolationScope lift_thread_isolation_restrictions;
 #endif
 
@@ -65,8 +65,8 @@
   }
 
   void Release() PA_UNLOCK_FUNCTION() {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
     LiftThreadIsolationScope lift_thread_isolation_restrictions;
 #endif
     owning_thread_ref_.store(base::PlatformThreadRef(),
@@ -76,8 +76,8 @@
   }
   void AssertAcquired() const PA_ASSERT_EXCLUSIVE_LOCK() {
     lock_.AssertAcquired();
-#if BUILDFLAG(PA_DCHECK_IS_ON)
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
     LiftThreadIsolationScope lift_thread_isolation_restrictions;
 #endif
     PA_DCHECK(owning_thread_ref_.load(std ::memory_order_acquire) ==
@@ -87,7 +87,7 @@
 
   void Reinit() PA_UNLOCK_FUNCTION() {
     lock_.AssertAcquired();
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     owning_thread_ref_.store(base::PlatformThreadRef(),
                              std::memory_order_release);
 #endif
@@ -97,7 +97,7 @@
  private:
   SpinningMutex lock_;
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   // Should in theory be protected by |lock_|, but we need to read it to detect
   // recursive lock acquisition (and thus, the allocator becoming reentrant).
   std::atomic<base::PlatformThreadRef> owning_thread_ref_ =
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_lock_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_lock_unittest.cc
index 66c942b..2fc6228 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_lock_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_lock_unittest.cc
@@ -165,7 +165,7 @@
 
 // AssertAcquired() is only enforced with DCHECK()s.
 // DCHECKs don't work with EXPECT_DEATH on official builds.
-#if defined(GTEST_HAS_DEATH_TEST) && BUILDFLAG(PA_DCHECK_IS_ON) && \
+#if defined(GTEST_HAS_DEATH_TEST) && PA_BUILDFLAG(PA_DCHECK_IS_ON) && \
     (!defined(OFFICIAL_BUILD) || !defined(NDEBUG))
 
 TEST(PartitionAllocLockTest, AssertAcquiredDeathTest) {
@@ -201,7 +201,8 @@
   base::PlatformThreadForTesting::Join(handle);
 
   // DCHECKs don't work with EXPECT_DEATH on official builds.
-#if BUILDFLAG(PA_DCHECK_IS_ON) && (!defined(OFFICIAL_BUILD) || !defined(NDEBUG))
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) && \
+    (!defined(OFFICIAL_BUILD) || !defined(NDEBUG))
   EXPECT_DEATH(lock.AssertAcquired(), "");
 #endif
 }
@@ -240,6 +241,6 @@
 }
 #endif  // BUILDFLAG(IS_APPLE)
 
-#endif  // defined(GTEST_HAS_DEATH_TEST) && BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // defined(GTEST_HAS_DEATH_TEST) && PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 }  // namespace partition_alloc::internal
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_page.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_page.cc
index 5ce9c65..6a2d0ad8 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_page.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_page.cc
@@ -193,11 +193,11 @@
       return;
     }
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     const PartitionFreelistDispatcher* freelist_dispatcher =
         PartitionRoot::FromSlotSpanMetadata(this)->get_freelist_dispatcher();
     freelist_dispatcher->CheckFreeList(freelist_head, bucket->slot_size);
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
     // If it's the current active slot span, change it. We bounce the slot span
     // to the empty list as a force towards defragmentation.
@@ -234,7 +234,7 @@
       slot_span_start, size_to_decommit,
       PageAccessibilityDisposition::kAllowKeepForPerf);
 
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
   FreeSlotBitmapReset(slot_span_start, slot_span_start + size_to_decommit,
                       bucket->slot_size);
 #endif
@@ -317,37 +317,37 @@
               size_t reservation_size,
               pool_handle pool) {
   PA_DCHECK(reservation_start && reservation_size > 0);
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   // When ENABLE_BACKUP_REF_PTR_SUPPORT is off, BRP pool isn't used.
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   if (pool == kBRPPoolHandle) {
     // In 32-bit mode, the beginning of a reservation may be excluded from the
     // BRP pool, so shift the pointer. Other pools don't have this logic.
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
     PA_DCHECK(IsManagedByPartitionAllocBRPPool(reservation_start));
 #else
     PA_DCHECK(IsManagedByPartitionAllocBRPPool(
         reservation_start +
         AddressPoolManagerBitmap::kBytesPer1BitOfBRPPoolBitmap *
             AddressPoolManagerBitmap::kGuardOffsetOfBRPPoolBitmap));
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
   } else
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   {
     const bool received_expected_pool_handle =
         pool == kRegularPoolHandle
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
         || pool == kThreadIsolatedPoolHandle
 #endif
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
         || (pool == kConfigurablePoolHandle && IsConfigurablePoolAvailable())
 #endif
         ;
     PA_DCHECK(received_expected_pool_handle);
 
     // Non-BRP pools don't need adjustment that BRP needs in 32-bit mode.
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
     PA_DCHECK(IsManagedByPartitionAllocThreadIsolatedPool(reservation_start) ||
               IsManagedByPartitionAllocRegularPool(reservation_start) ||
               IsManagedByPartitionAllocConfigurablePool(reservation_start));
@@ -356,7 +356,7 @@
               IsManagedByPartitionAllocConfigurablePool(reservation_start));
 #endif
   }
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
   PA_DCHECK((reservation_start & kSuperPageOffsetMask) == 0);
   uintptr_t reservation_end = reservation_start + reservation_size;
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_page.h b/base/allocator/partition_allocator/src/partition_alloc/partition_page.h
index 2a82685..43230c3c 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_page.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_page.h
@@ -28,17 +28,17 @@
 #include "partition_alloc/partition_superpage_extent_entry.h"
 #include "partition_alloc/reservation_offset_table.h"
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 #include "partition_alloc/starscan/state_bitmap.h"
 #endif
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 #include "partition_alloc/tagging.h"
 #endif
 
 namespace partition_alloc::internal {
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 using AllocationStateMap =
     StateBitmap<kSuperPageSize, kSuperPageAlignment, kAlignment>;
 #endif
@@ -376,7 +376,7 @@
       PartitionSuperPageToMetadataArea(super_page));
 }
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 
 // Size that should be reserved for state bitmap (if present) inside a super
 // page. Elements of a super page are partition-page-aligned, hence the returned
@@ -408,14 +408,14 @@
       SuperPageStateBitmapAddr(super_page));
 }
 
-#else  // BUILDFLAG(USE_STARSCAN)
+#else  // PA_BUILDFLAG(USE_STARSCAN)
 
 PA_ALWAYS_INLINE PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR size_t
 ReservedStateBitmapSize() {
   return 0ull;
 }
 
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 
 PA_ALWAYS_INLINE uintptr_t
 SuperPagePayloadStartOffset(bool is_managed_by_normal_buckets,
@@ -481,7 +481,7 @@
     uintptr_t address) {
   uintptr_t super_page = address & kSuperPageBaseMask;
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   PA_DCHECK(IsReservationStart(super_page));
   DCheckIsWithInSuperPagePayload(address);
 #endif
@@ -556,11 +556,11 @@
 PA_ALWAYS_INLINE SlotSpanMetadata* SlotSpanMetadata::FromSlotStart(
     uintptr_t slot_start) {
   auto* slot_span = FromAddr(slot_start);
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   // Checks that the pointer is a multiple of slot size.
   uintptr_t slot_span_start = ToSlotSpanStart(slot_span);
   PA_DCHECK(!((slot_start - slot_span_start) % slot_span->bucket->slot_size));
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
   return slot_span;
 }
 
@@ -583,13 +583,13 @@
 PA_ALWAYS_INLINE SlotSpanMetadata* SlotSpanMetadata::FromObjectInnerAddr(
     uintptr_t address) {
   auto* slot_span = FromAddr(address);
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   // Checks that the address is within the expected object boundaries.
   uintptr_t slot_span_start = ToSlotSpanStart(slot_span);
   uintptr_t shift_from_slot_start =
       (address - slot_span_start) % slot_span->bucket->slot_size;
   DCheckIsValidShiftFromSlotStart(slot_span, shift_from_slot_start);
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
   return slot_span;
 }
 
@@ -614,7 +614,7 @@
 
 PA_ALWAYS_INLINE void SlotSpanMetadata::SetFreelistHead(
     PartitionFreelistEntry* new_head) {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   // |this| is in the metadata region, hence isn't MTE-tagged. Untag |new_head|
   // as well.
   uintptr_t new_head_untagged = UntagPtr(new_head);
@@ -682,7 +682,7 @@
     PartitionRoot* root,
     const PartitionFreelistDispatcher* freelist_dispatcher)
     PA_EXCLUSIVE_LOCKS_REQUIRED(PartitionRootLock(root)) {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   DCheckRootLockIsAcquired(root);
   PA_DCHECK(!(freelist_dispatcher->GetNext(tail, bucket->slot_size)));
   PA_DCHECK(number_of_freed);
@@ -775,7 +775,7 @@
   next_slot_span = nullptr;
 }
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 // Returns the state bitmap from an address within a normal-bucket super page.
 // It's the caller's responsibility to ensure that the bitmap exists.
 PA_ALWAYS_INLINE AllocationStateMap* StateBitmapFromAddr(uintptr_t address) {
@@ -783,7 +783,7 @@
   uintptr_t super_page = address & kSuperPageBaseMask;
   return SuperPageStateBitmap(super_page);
 }
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 
 // Iterates over all slot spans in a super-page. |Callback| must return true if
 // early return is needed.
@@ -791,7 +791,7 @@
 void IterateSlotSpans(uintptr_t super_page,
                       bool with_quarantine,
                       Callback callback) {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   PA_DCHECK(!(super_page % kSuperPageAlignment));
   auto* extent_entry = PartitionSuperPageToExtent(super_page);
   DCheckRootLockIsAcquired(extent_entry->root);
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_page_constants.h b/base/allocator/partition_allocator/src/partition_alloc/partition_page_constants.h
index 773d9ee..8a99d537e 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_page_constants.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_page_constants.h
@@ -11,7 +11,7 @@
 
 namespace partition_alloc::internal {
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS) && BUILDFLAG(IS_APPLE)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS) && BUILDFLAG(IS_APPLE)
 // System page size is not a constant on Apple OSes, but is either 4 or 16kiB
 // (1 << 12 or 1 << 14), as checked in PartitionRoot::Init(). And
 // PartitionPageSize() is 4 times the OS page size.
@@ -26,7 +26,7 @@
 // larger, so it doesn't have as many slots.
 static constexpr size_t kMaxSlotsPerSlotSpan =
     PartitionPageSize() / kSmallestBucket;
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS) && BUILDFLAG(IS_APPLE)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS) && BUILDFLAG(IS_APPLE)
 
 }  // namespace partition_alloc::internal
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc b/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc
index d7b9419e..26110c2d 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc
@@ -34,7 +34,7 @@
 #include "partition_alloc/partition_alloc_base/mac/mac_util.h"
 #endif
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 #include "partition_alloc/starscan/pcscan.h"
 #endif
 
@@ -54,7 +54,7 @@
 
 namespace partition_alloc::internal {
 
-#if BUILDFLAG(RECORD_ALLOC_INFO)
+#if PA_BUILDFLAG(RECORD_ALLOC_INFO)
 // Even if this is not hidden behind a BUILDFLAG, it should not use any memory
 // when recording is disabled, since it ends up in the .bss section.
 AllocInfo g_allocs = {};
@@ -63,9 +63,9 @@
   g_allocs.allocs[g_allocs.index.fetch_add(1, std::memory_order_relaxed) %
                   kAllocInfoSize] = {addr, size};
 }
-#endif  // BUILDFLAG(RECORD_ALLOC_INFO)
+#endif  // PA_BUILDFLAG(RECORD_ALLOC_INFO)
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 PtrPosWithinAlloc IsPtrWithinSameAlloc(uintptr_t orig_address,
                                        uintptr_t test_address,
                                        size_t type_size) {
@@ -89,7 +89,7 @@
   uintptr_t object_end = object_addr + root->GetSlotUsableSize(slot_span);
   if (test_address < object_addr || object_end < test_address) {
     return PtrPosWithinAlloc::kFarOOB;
-#if BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
   } else if (object_end - type_size < test_address) {
     // Not even a single element of the type referenced by the pointer can fit
     // between the pointer and the end of the object.
@@ -99,7 +99,7 @@
     return PtrPosWithinAlloc::kInBounds;
   }
 }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 }  // namespace partition_alloc::internal
 
@@ -201,7 +201,7 @@
 
 #endif  // PA_USE_PARTITION_ROOT_ENUMERATOR
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 namespace {
 
@@ -324,7 +324,7 @@
 }
 #endif  // BUILDFLAG(IS_APPLE)
 
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 namespace internal {
 
@@ -565,7 +565,7 @@
                 num_provisioned_slots - slot_span->num_allocated_slots);
     }
 
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
     FreeSlotBitmapReset(slot_span_start + (slot_size * num_provisioned_slots),
                         end_addr, slot_size);
 #endif
@@ -765,15 +765,15 @@
   }
 }
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 void DCheckIfManagedByPartitionAllocBRPPool(uintptr_t address) {
   PA_DCHECK(IsManagedByPartitionAllocBRPPool(address));
 }
 #endif
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 void PartitionAllocThreadIsolationInit(ThreadIsolationOption thread_isolation) {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   ThreadIsolationSettings::settings.enabled = true;
 #endif
   PartitionAddressSpace::InitThreadIsolatedPool(thread_isolation);
@@ -781,7 +781,7 @@
   // permissions to to globals afterwards.
   WriteProtectThreadIsolatedGlobals(thread_isolation);
 }
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 
 }  // namespace internal
 
@@ -860,7 +860,7 @@
   // this function on PartitionRoots without a thread cache.
   PA_CHECK(!settings.with_thread_cache);
   auto pool_handle = ChoosePool();
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   // The pages managed by thread isolated pool will be free-ed at
   // UninitThreadIsolatedForTesting(). Don't invoke FreePages() for the pages.
   if (pool_handle == internal::kThreadIsolatedPoolHandle) {
@@ -911,7 +911,8 @@
 }
 #endif  // PA_CONFIG(MAYBE_ENABLE_MAC11_MALLOC_SIZE_HACK)
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) && !BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) && \
+    !BUILDFLAG(HAS_64_BIT_POINTERS)
 namespace {
 std::atomic<bool> g_reserve_brp_guard_region_called;
 // An address constructed by repeating `kQuarantinedByte` shouldn't never point
@@ -946,7 +947,7 @@
   }
 }
 }  // namespace
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) &&
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) &&
         // !BUILDFLAG(HAS_64_BIT_POINTERS)
 
 void PartitionRoot::Init(PartitionOptions opts) {
@@ -971,25 +972,26 @@
       return;
     }
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
     // Reserve address space for PartitionAlloc.
     internal::PartitionAddressSpace::Init();
 #endif
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) && !BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) && \
+    !BUILDFLAG(HAS_64_BIT_POINTERS)
     ReserveBackupRefPtrGuardRegionIfNeeded();
 #endif
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     settings.use_cookie = true;
 #else
     static_assert(!Settings::use_cookie);
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     settings.brp_enabled_ = opts.backup_ref_ptr == PartitionOptions::kEnabled;
-#else   // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#else   // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     PA_CHECK(opts.backup_ref_ptr == PartitionOptions::kDisabled);
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     settings.use_configurable_pool =
         (opts.use_configurable_pool == PartitionOptions::kAllowed) &&
         IsConfigurablePoolAvailable();
@@ -1014,7 +1016,7 @@
       PA_CHECK(!scheduler_loop_quarantine.has_value());
     }
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
     settings.memory_tagging_enabled_ =
         opts.memory_tagging.enabled == PartitionOptions::kEnabled;
     // Memory tagging is not supported in the configurable pool because MTE
@@ -1027,24 +1029,24 @@
 
     settings.memory_tagging_reporting_mode_ =
         opts.memory_tagging.reporting_mode;
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
     settings.use_pool_offset_freelists =
         opts.use_pool_offset_freelists == PartitionOptions::kEnabled;
 
     // brp_enabled() is not supported in the configurable pool because
     // BRP requires objects to be in a different Pool.
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     PA_CHECK(!(settings.use_configurable_pool && brp_enabled()));
 #endif
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
     // BRP and thread isolated mode use different pools, so they can't be
     // enabled at the same time.
     PA_CHECK(!opts.thread_isolation.enabled ||
              opts.backup_ref_ptr == PartitionOptions::kDisabled);
     settings.thread_isolation = opts.thread_isolation;
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 
 #if PA_CONFIG(EXTRAS_REQUIRED)
     settings.extras_size = 0;
@@ -1053,7 +1055,7 @@
       settings.extras_size += internal::kPartitionCookieSizeAdjustment;
     }
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     if (brp_enabled()) {
       size_t in_slot_metadata_size =
           internal::AlignUpInSlotMetadataSizeForApple(
@@ -1066,17 +1068,17 @@
       EnableMac11MallocSizeHackIfNeeded();
 #endif
     }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 #endif  // PA_CONFIG(EXTRAS_REQUIRED)
 
     settings.quarantine_mode =
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
         (opts.star_scan_quarantine == PartitionOptions::kDisallowed
              ? QuarantineMode::kAlwaysDisabled
              : QuarantineMode::kDisabledByDefault);
 #else
         QuarantineMode::kAlwaysDisabled;
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 
     // We mark the sentinel slot span as free to make sure it is skipped by our
     // logic to find a new active slot span.
@@ -1127,11 +1129,11 @@
   }
 
   // Called without the lock, might allocate.
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
   PartitionAllocMallocInitOnce();
 #endif
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   if (settings.thread_isolation.enabled) {
     internal::PartitionAllocThreadIsolationInit(settings.thread_isolation);
   }
@@ -1148,10 +1150,10 @@
 }
 
 PartitionRoot::~PartitionRoot() {
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
   PA_CHECK(!settings.with_thread_cache)
       << "Must not destroy a partition with a thread cache";
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 #if PA_CONFIG(USE_PARTITION_ROOT_ENUMERATOR)
   if (initialized) {
@@ -1234,14 +1236,14 @@
   size_t available_reservation_size =
       current_reservation_size - extent->padding_for_alignment -
       PartitionRoot::GetDirectMapMetadataAndGuardPagesSize();
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   uintptr_t reservation_start = slot_start & internal::kSuperPageBaseMask;
   PA_DCHECK(internal::IsReservationStart(reservation_start));
   PA_DCHECK(slot_start + available_reservation_size ==
             reservation_start + current_reservation_size -
                 GetDirectMapMetadataAndGuardPagesSize() +
                 internal::PartitionPageSize());
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
   PA_DCHECK(new_slot_size > internal::kMaxMemoryTaggingSize);
   if (new_slot_size == current_slot_size) {
@@ -1266,7 +1268,7 @@
     // entries in the reservation offset table (for entire reservation_size
     // region) have been already initialized.
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     memset(reinterpret_cast<void*>(slot_start + current_slot_size),
            internal::kUninitializedByte, recommit_slot_size_growth);
 #endif
@@ -1322,25 +1324,25 @@
   // memory as we're already using, so re-use the allocation after updating
   // statistics (and cookie, if present).
   if (slot_span->CanStoreRawSize()) {
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) && BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) && PA_BUILDFLAG(PA_DCHECK_IS_ON)
     internal::InSlotMetadata* old_ref_count = nullptr;
     if (PA_LIKELY(brp_enabled())) {
       old_ref_count = InSlotMetadataPointerFromSlotStartAndSize(
           slot_start, slot_span->bucket->slot_size);
     }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) &&
-        // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) &&
+        // PA_BUILDFLAG(PA_DCHECK_IS_ON)
     size_t new_raw_size = AdjustSizeForExtrasAdd(new_size);
     slot_span->SetRawSize(new_raw_size);
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) && BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) && PA_BUILDFLAG(PA_DCHECK_IS_ON)
     if (PA_LIKELY(brp_enabled())) {
       internal::InSlotMetadata* new_ref_count =
           InSlotMetadataPointerFromSlotStartAndSize(
               slot_start, slot_span->bucket->slot_size);
       PA_DCHECK(new_ref_count == old_ref_count);
     }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) &&
-        // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) &&
+        // PA_BUILDFLAG(PA_DCHECK_IS_ON)
     // Write a new trailing cookie only when it is possible to keep track
     // raw size (otherwise we wouldn't know where to look for it later).
     if (settings.use_cookie) {
@@ -1365,7 +1367,7 @@
   {
     ::partition_alloc::internal::ScopedGuard guard{
         internal::PartitionRootLock(this)};
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
     // Avoid purging if there is PCScan task currently scheduled. Since pcscan
     // takes snapshot of all allocated pages, decommitting pages here (even
     // under the lock) is racy.
@@ -1373,7 +1375,7 @@
     if (PCScan::IsInProgress()) {
       return;
     }
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 
     if (flags & PurgeFlags::kDecommitEmptySlotSpans) {
       DecommitEmptySlotSpans();
@@ -1471,7 +1473,7 @@
         max_size_of_committed_pages.load(std::memory_order_relaxed);
     stats.total_allocated_bytes = total_size_of_allocated_bytes;
     stats.max_allocated_bytes = max_size_of_allocated_bytes;
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     stats.total_brp_quarantined_bytes =
         total_size_of_brp_quarantined_bytes.load(std::memory_order_relaxed);
     stats.total_brp_quarantined_count =
@@ -1586,7 +1588,7 @@
   ::partition_alloc::internal::ScopedGuard guard{
       internal::PartitionRootLock(this)};
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   if (!allow_leaks) {
     unsigned num_allocated_slots = 0;
     for (Bucket& bucket : buckets) {
@@ -1712,7 +1714,7 @@
   sort_active_slot_spans_ = new_value;
 }
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 PA_NOINLINE void PartitionRoot::QuarantineForBrp(
     const SlotSpanMetadata* slot_span,
     void* object) {
@@ -1724,7 +1726,7 @@
     internal::SecureMemset(object, internal::kQuarantinedByte, usable_size);
   }
 }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 // Explicitly define common template instantiations to reduce compile time.
 #define EXPORT_TEMPLATE \
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_root.h b/base/allocator/partition_allocator/src/partition_alloc/partition_root.h
index 96fc2a4..b4e5abb 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_root.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_root.h
@@ -78,7 +78,7 @@
 #include "partition_alloc/thread_cache.h"
 #include "partition_alloc/thread_isolation/thread_isolation.h"
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 #include "partition_alloc/starscan/pcscan.h"
 #endif
 
@@ -96,11 +96,11 @@
   } allocs[kAllocInfoSize] = {};
 };
 
-#if BUILDFLAG(RECORD_ALLOC_INFO)
+#if PA_BUILDFLAG(RECORD_ALLOC_INFO)
 extern AllocInfo g_allocs;
 
 void RecordAllocOrFree(uintptr_t addr, size_t size);
-#endif  // BUILDFLAG(RECORD_ALLOC_INFO)
+#endif  // PA_BUILDFLAG(RECORD_ALLOC_INFO)
 }  // namespace partition_alloc::internal
 
 namespace partition_alloc {
@@ -108,7 +108,7 @@
 namespace internal {
 // Avoid including partition_address_space.h from this .h file, by moving the
 // call to IsManagedByPartitionAllocBRPPool into the .cc file.
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 PA_COMPONENT_EXPORT(PARTITION_ALLOC)
 void DCheckIfManagedByPartitionAllocBRPPool(uintptr_t address);
 #else
@@ -182,7 +182,7 @@
     TagViolationReportingMode reporting_mode =
         TagViolationReportingMode::kUndefined;
   } memory_tagging;
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   ThreadIsolationOption thread_isolation;
 #endif
 
@@ -210,7 +210,7 @@
   using FreeListEntry = internal::PartitionFreelistEntry;
   using SuperPageExtentEntry = internal::PartitionSuperPageExtentEntry;
   using DirectMapExtent = internal::PartitionDirectMapExtent;
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
   using PCScan = internal::PCScan;
 #endif
 
@@ -250,28 +250,28 @@
 
     bool with_thread_cache = false;
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     bool use_cookie = false;
 #else
     static constexpr bool use_cookie = false;
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     bool brp_enabled_ = false;
 #if PA_CONFIG(MAYBE_ENABLE_MAC11_MALLOC_SIZE_HACK)
     bool mac11_malloc_size_hack_enabled_ = false;
     size_t mac11_malloc_size_hack_usable_size_ = 0;
 #endif  // PA_CONFIG(MAYBE_ENABLE_MAC11_MALLOC_SIZE_HACK)
     size_t in_slot_metadata_size = 0;
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     bool use_configurable_pool = false;
     bool zapping_by_free_flags = false;
     bool scheduler_loop_quarantine = false;
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
     bool memory_tagging_enabled_ = false;
     TagViolationReportingMode memory_tagging_reporting_mode_ =
         TagViolationReportingMode::kUndefined;
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
     ThreadIsolationOption thread_isolation;
 #endif
 
@@ -326,7 +326,7 @@
   // Atomic, because system calls can be made without the lock held.
   std::atomic<uint64_t> syscall_count{};
   std::atomic<uint64_t> syscall_total_time_ns{};
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   std::atomic<size_t> total_size_of_brp_quarantined_bytes{0};
   std::atomic<size_t> total_count_of_brp_quarantined_slots{0};
   std::atomic<size_t> cumulative_size_of_brp_quarantined_bytes{0};
@@ -574,13 +574,13 @@
   PA_ALWAYS_INLINE size_t
   AllocationCapacityFromRequestedSize(size_t size) const;
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   PA_ALWAYS_INLINE static internal::InSlotMetadata*
   InSlotMetadataPointerFromSlotStartAndSize(uintptr_t slot_start,
                                             size_t slot_size);
   PA_ALWAYS_INLINE internal::InSlotMetadata*
   InSlotMetadataPointerFromObjectForTesting(void* object) const;
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
   PA_ALWAYS_INLINE bool IsMemoryTaggingEnabled() const;
   PA_ALWAYS_INLINE TagViolationReportingMode
@@ -676,18 +676,18 @@
   }
 
   internal::pool_handle ChoosePool() const {
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
     if (settings.use_configurable_pool) {
       PA_DCHECK(IsConfigurablePoolAvailable());
       return internal::kConfigurablePoolHandle;
     }
 #endif
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
     if (settings.thread_isolation.enabled) {
       return internal::kThreadIsolatedPoolHandle;
     }
 #endif
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
     if (PA_LIKELY(brp_enabled())) {
       return internal::kBRPPoolHandle;
     } else {
@@ -695,7 +695,7 @@
     }
 #else
     return internal::kRegularPoolHandle;
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   }
 
   PA_ALWAYS_INLINE bool IsQuarantineAllowed() const {
@@ -710,7 +710,7 @@
     if (PA_UNLIKELY(settings.quarantine_mode != QuarantineMode::kEnabled)) {
       return false;
     }
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
     if (PA_UNLIKELY(quarantine_always_for_testing)) {
       return true;
     }
@@ -724,7 +724,7 @@
     return true;
 #else
     return true;
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   }
 
   PA_ALWAYS_INLINE void SetQuarantineAlwaysForTesting(bool value) {
@@ -839,9 +839,9 @@
     // TODO(bartekn): Check that the result is indeed a slot start.
   }
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   bool brp_enabled() const { return settings.brp_enabled_; }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
   PA_ALWAYS_INLINE bool uses_configurable_pool() const {
     return settings.use_configurable_pool;
@@ -896,12 +896,12 @@
   }
 
   const internal::PartitionFreelistDispatcher* get_freelist_dispatcher() {
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
     if (settings.use_pool_offset_freelists) {
       return internal::PartitionFreelistDispatcher::Create(
           internal::PartitionFreelistEncoding::kPoolOffsetFreeList);
     }
-#endif  // BUILDFLAG(USE_FREELIST_DISPATCHER)
+#endif  // PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
     return internal::PartitionFreelistDispatcher::Create(
         internal::PartitionFreelistEncoding::kEncodedFreeList);
   }
@@ -1039,10 +1039,10 @@
   PA_ALWAYS_INLINE FreeNotificationData
   CreateFreeNotificationData(void* address) const;
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   PA_NOINLINE void QuarantineForBrp(const SlotSpanMetadata* slot_span,
                                     void* object);
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 #if PA_CONFIG(USE_PARTITION_ROOT_ENUMERATOR)
   static internal::Lock& GetEnumeratorLock();
@@ -1089,7 +1089,7 @@
 #endif
 };
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 struct SlotAddressAndSize {
   uintptr_t slot_start;
@@ -1099,13 +1099,13 @@
 PA_ALWAYS_INLINE SlotAddressAndSize
 PartitionAllocGetDirectMapSlotStartAndSizeInBRPPool(uintptr_t address) {
   PA_DCHECK(IsManagedByPartitionAllocBRPPool(address));
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   // Use this variant of GetDirectMapReservationStart as it has better
   // performance.
   uintptr_t offset = OffsetInBRPPool(address);
   uintptr_t reservation_start =
       GetDirectMapReservationStart(address, kBRPPoolHandle, offset);
-#else  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#else  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   uintptr_t reservation_start = GetDirectMapReservationStart(address);
 #endif
   if (!reservation_start) {
@@ -1123,7 +1123,7 @@
   PA_DCHECK(!page_metadata->slot_span_metadata_offset);
   auto* slot_span = &page_metadata->slot_span_metadata;
   uintptr_t slot_start = SlotSpanMetadata::ToSlotSpanStart(slot_span);
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   auto* direct_map_metadata =
       PartitionDirectMapMetadata::FromSlotSpanMetadata(slot_span);
   size_t padding_for_alignment =
@@ -1133,7 +1133,7 @@
                 PartitionPageSize());
   PA_DCHECK(slot_start ==
             reservation_start + PartitionPageSize() + padding_for_alignment);
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
   return SlotAddressAndSize{.slot_start = slot_start,
                             .size = slot_span->bucket->slot_size};
 }
@@ -1157,12 +1157,12 @@
   }
 
   auto* slot_span = SlotSpanMetadata::FromAddr(address);
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   auto* root = PartitionRoot::FromSlotSpanMetadata(slot_span);
   // Double check that in-slot metadata is indeed present. Currently that's the
   // case only when BRP is used.
   PA_DCHECK(root->brp_enabled());
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
   // Get the offset from the beginning of the slot span.
   uintptr_t slot_span_start = SlotSpanMetadata::ToSlotSpanStart(slot_span);
@@ -1182,7 +1182,7 @@
   // When BACKUP_REF_PTR_POISON_OOB_PTR is disabled, end-of-allocation pointers
   // are also considered in-bounds.
   kInBounds,
-#if BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
   kAllocEnd,
 #endif
   kFarOOB
@@ -1216,7 +1216,7 @@
                  ->IsAlive());
 
   // Iterating over the entire slot can be really expensive.
-#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
+#if PA_BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
   auto hook = PartitionAllocHooks::GetQuarantineOverrideHook();
   // If we have a hook the object segment is not necessarily filled
   // with |kQuarantinedByte|.
@@ -1229,7 +1229,7 @@
   }
   DebugMemset(SlotStartAddr2Ptr(slot_start), kFreedByte,
               slot_span->GetUtilizedSlotSize());
-#endif  // BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
+#endif  // PA_BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
 
   root->total_size_of_brp_quarantined_bytes.fetch_sub(
       slot_span->GetSlotSizeForBookkeeping(), std::memory_order_relaxed);
@@ -1238,7 +1238,7 @@
 
   root->RawFreeWithThreadCache(slot_start, slot_span);
 }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 }  // namespace internal
 
@@ -1310,7 +1310,7 @@
   IncreaseTotalSizeOfAllocatedBytes(
       slot_start, slot_span->GetSlotSizeForBookkeeping(), raw_size);
 
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
   if (!slot_span->bucket->is_direct_mapped()) {
     internal::FreeSlotBitmapMarkSlotAsUsed(slot_start);
   }
@@ -1327,7 +1327,7 @@
   AllocationNotificationData notification_data(object, size, type_name);
 
   if (IsMemoryTaggingEnabled()) {
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
     notification_data.SetMteReportingMode(memory_tagging_reporting_mode());
 #endif
   }
@@ -1346,7 +1346,7 @@
       CreateDefaultFreeNotificationData(address);
 
   if (IsMemoryTaggingEnabled()) {
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
     notification_data.SetMteReportingMode(memory_tagging_reporting_mode());
 #endif
   }
@@ -1391,20 +1391,20 @@
 }
 
 PA_ALWAYS_INLINE bool PartitionRoot::IsMemoryTaggingEnabled() const {
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   return settings.memory_tagging_enabled_;
 #else
   return false;
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 }
 
 PA_ALWAYS_INLINE TagViolationReportingMode
 PartitionRoot::memory_tagging_reporting_mode() const {
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   return settings.memory_tagging_reporting_mode_;
 #else
   return TagViolationReportingMode::kUndefined;
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 }
 
 // static
@@ -1461,7 +1461,7 @@
   //
   // On Android Chromecast devices, this is already checked in PartitionFree()
   // in the shim.
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \
     (BUILDFLAG(IS_ANDROID) && !BUILDFLAG(PA_IS_CAST_ANDROID))
   uintptr_t object_addr = internal::ObjectPtr2Addr(object);
   PA_CHECK(IsManagedByPartitionAlloc(object_addr));
@@ -1470,7 +1470,7 @@
   SlotSpanMetadata* slot_span = SlotSpanMetadata::FromObject(object);
   PA_DCHECK(PartitionRoot::FromSlotSpanMetadata(slot_span) == this);
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   if (PA_LIKELY(IsMemoryTaggingEnabled())) {
     const size_t slot_size = slot_span->bucket->slot_size;
     if (PA_LIKELY(slot_size <= internal::kMaxMemoryTaggingSize)) {
@@ -1483,7 +1483,7 @@
       object = TaggedSlotStartToObject(retagged_slot_start);
     }
   }
-#else   // BUILDFLAG(HAS_MEMORY_TAGGING)
+#else   // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   // We are going to read from |*slot_span| in all branches, but haven't done it
   // yet.
   //
@@ -1496,7 +1496,7 @@
   // Don't do it when memory tagging is enabled, as |*slot_span| has already
   // been touched above.
   PA_PREFETCH(slot_span);
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
   uintptr_t slot_start = ObjectToSlotStart(object);
   PA_DCHECK(slot_span == SlotSpanMetadata::FromSlotStart(slot_start));
@@ -1514,7 +1514,7 @@
   // For better debuggability, we should do these checks before quarantining.
   if constexpr (ContainsFlags(flags, FreeFlags::kSchedulerLoopQuarantine)) {
     if (settings.scheduler_loop_quarantine) {
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
       // TODO(keishi): Add PA_LIKELY when brp is fully enabled as |brp_enabled|
       // will be false only for the aligned partition.
       if (brp_enabled()) {
@@ -1522,14 +1522,14 @@
             slot_start, slot_span->bucket->slot_size);
         ref_count->PreReleaseFromAllocator();
       }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
       GetSchedulerLoopQuarantineBranch().Quarantine(object, slot_span,
                                                     slot_start);
       return;
     }
   }
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
   // TODO(bikineev): Change the condition to PA_LIKELY once PCScan is enabled by
   // default.
   if (PA_UNLIKELY(ShouldQuarantine(object))) {
@@ -1541,7 +1541,7 @@
       return;
     }
   }
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 
   FreeNoHooksImmediate(object, slot_span, slot_start);
 }
@@ -1585,7 +1585,7 @@
                                         GetSlotUsableSize(slot_span));
   }
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
   // TODO(bikineev): Change the condition to PA_LIKELY once PCScan is enabled by
   // default.
   if (PA_UNLIKELY(IsQuarantineEnabled())) {
@@ -1594,9 +1594,9 @@
       internal::StateBitmapFromAddr(slot_start)->Free(slot_start);
     }
   }
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   if (PA_LIKELY(brp_enabled())) {
     auto* ref_count = InSlotMetadataPointerFromSlotStartAndSize(
         slot_start, slot_span->bucket->slot_size);
@@ -1619,10 +1619,10 @@
       return;
     }
   }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
   // memset() can be really expensive.
-#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
+#if PA_BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
   internal::DebugMemset(internal::SlotStartAddr2Ptr(slot_start),
                         internal::kFreedByte, slot_span->GetUtilizedSlotSize());
 #elif PA_CONFIG(ZERO_RANDOMLY_ON_FREE)
@@ -1643,7 +1643,7 @@
     SlotSpanMetadata* slot_span) {
   DecreaseTotalSizeOfAllocatedBytes(slot_start,
                                     slot_span->GetSlotSizeForBookkeeping());
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
   if (!slot_span->bucket->is_direct_mapped()) {
     internal::FreeSlotBitmapMarkSlotAsFree(slot_start);
   }
@@ -1809,9 +1809,9 @@
   total_size_of_allocated_bytes += len;
   max_size_of_allocated_bytes =
       std::max(max_size_of_allocated_bytes, total_size_of_allocated_bytes);
-#if BUILDFLAG(RECORD_ALLOC_INFO)
+#if PA_BUILDFLAG(RECORD_ALLOC_INFO)
   partition_alloc::internal::RecordAllocOrFree(addr | 0x01, raw_size);
-#endif  // BUILDFLAG(RECORD_ALLOC_INFO)
+#endif  // PA_BUILDFLAG(RECORD_ALLOC_INFO)
 }
 
 PA_ALWAYS_INLINE void PartitionRoot::DecreaseTotalSizeOfAllocatedBytes(
@@ -1821,9 +1821,9 @@
   // somewhere.
   PA_DCHECK(total_size_of_allocated_bytes >= len);
   total_size_of_allocated_bytes -= len;
-#if BUILDFLAG(RECORD_ALLOC_INFO)
+#if PA_BUILDFLAG(RECORD_ALLOC_INFO)
   partition_alloc::internal::RecordAllocOrFree(addr | 0x00, len);
-#endif  // BUILDFLAG(RECORD_ALLOC_INFO)
+#endif  // PA_BUILDFLAG(RECORD_ALLOC_INFO)
 }
 
 PA_ALWAYS_INLINE void PartitionRoot::IncreaseCommittedPages(size_t len) {
@@ -1986,12 +1986,12 @@
 PartitionRoot::GetPageAccessibility(bool request_tagging) const {
   PageAccessibilityConfiguration::Permissions permissions =
       PageAccessibilityConfiguration::kReadWrite;
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   if (IsMemoryTaggingEnabled() && request_tagging) {
     permissions = PageAccessibilityConfiguration::kReadWriteTagged;
   }
 #endif
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   return PageAccessibilityConfiguration(permissions, settings.thread_isolation);
 #else
   return PageAccessibilityConfiguration(permissions);
@@ -2001,7 +2001,7 @@
 PA_ALWAYS_INLINE PageAccessibilityConfiguration
 PartitionRoot::PageAccessibilityWithThreadIsolationIfEnabled(
     PageAccessibilityConfiguration::Permissions permissions) const {
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   return PageAccessibilityConfiguration(permissions, settings.thread_isolation);
 #endif
   return PageAccessibilityConfiguration(permissions);
@@ -2017,7 +2017,7 @@
   return AdjustSizeForExtrasSubtract(slot_span->bucket->slot_size);
 }
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 PA_ALWAYS_INLINE internal::InSlotMetadata*
 PartitionRoot::InSlotMetadataPointerFromSlotStartAndSize(uintptr_t slot_start,
                                                          size_t slot_size) {
@@ -2031,7 +2031,7 @@
   return InSlotMetadataPointerFromSlotStartAndSize(
       slot_start, slot_span->bucket->slot_size);
 }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
 // static
 PA_ALWAYS_INLINE uint16_t
@@ -2080,7 +2080,7 @@
     hooks_enabled = PartitionAllocHooks::AreHooksEnabled();
     if (hooks_enabled) {
       auto additional_flags = AllocFlags::kNone;
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
       if (IsMemoryTaggingEnabled()) {
         additional_flags |= AllocFlags::kMemoryShouldBeTaggedForMte;
       }
@@ -2144,7 +2144,7 @@
   uintptr_t slot_start = 0;
   size_t slot_size = 0;
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
   const bool is_quarantine_enabled = IsQuarantineEnabled();
   // PCScan safepoint. Call before trying to allocate from cache.
   // TODO(bikineev): Change the condition to PA_LIKELY once PCScan is enabled by
@@ -2152,7 +2152,7 @@
   if (PA_UNLIKELY(is_quarantine_enabled)) {
     PCScan::JoinScanIfNeeded();
   }
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 
   auto* thread_cache = GetOrCreateThreadCache();
 
@@ -2174,7 +2174,7 @@
       // Keep it in sync!
       usable_size = AdjustSizeForExtrasSubtract(slot_size);
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
       // Make sure that the allocated pointer comes from the same place it would
       // for a non-thread cache allocation.
       SlotSpanMetadata* slot_span = SlotSpanMetadata::FromSlotStart(slot_start);
@@ -2222,7 +2222,7 @@
   //     (f) slot_size
   //
   // Notes:
-  // - Cookie exists only in the BUILDFLAG(PA_DCHECK_IS_ON) case.
+  // - Cookie exists only in the PA_BUILDFLAG(PA_DCHECK_IS_ON) case.
   // - Think of raw_size as the minimum size required internally to satisfy
   //   the allocation request (i.e. requested_size + extras)
   // - At most one "empty" or "unused" space can occur at a time. They occur
@@ -2259,14 +2259,14 @@
   // PA_LIKELY: operator new() calls malloc(), not calloc().
   if constexpr (!zero_fill) {
     // memset() can be really expensive.
-#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
+#if PA_BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
     internal::DebugMemset(object, internal::kUninitializedByte, usable_size);
 #endif
   } else if (!is_already_zeroed) {
     memset(object, 0, usable_size);
   }
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   if (PA_LIKELY(brp_enabled())) {
     bool needs_mac11_malloc_size_hack = false;
 #if PA_CONFIG(MAYBE_ENABLE_MAC11_MALLOC_SIZE_HACK)
@@ -2287,9 +2287,9 @@
     (void)ref_count;
 #endif
   }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
   // TODO(bikineev): Change the condition to PA_LIKELY once PCScan is enabled by
   // default.
   if (PA_UNLIKELY(is_quarantine_enabled)) {
@@ -2298,7 +2298,7 @@
       internal::StateBitmapFromAddr(slot_start)->Allocate(slot_start);
     }
   }
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 
   return object;
 }
@@ -2574,20 +2574,20 @@
                                                                      size_t);
 #undef EXPORT_TEMPLATE
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 // Usage in `raw_ptr_backup_ref_impl.cc` is notable enough to merit a
 // non-internal alias.
 using ::partition_alloc::internal::PartitionAllocGetSlotStartAndSizeInBRPPool;
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
 
-#if BUILDFLAG(IS_APPLE) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if BUILDFLAG(IS_APPLE) && PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 PA_COMPONENT_EXPORT(PARTITION_ALLOC)
 void PartitionAllocMallocHookOnBeforeForkInParent();
 PA_COMPONENT_EXPORT(PARTITION_ALLOC)
 void PartitionAllocMallocHookOnAfterForkInParent();
 PA_COMPONENT_EXPORT(PARTITION_ALLOC)
 void PartitionAllocMallocHookOnAfterForkInChild();
-#endif  // BUILDFLAG(IS_APPLE) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // BUILDFLAG(IS_APPLE) && PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 }  // namespace partition_alloc
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_stats.h b/base/allocator/partition_allocator/src/partition_alloc/partition_stats.h
index 2cc61f2..df967b2 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_stats.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_stats.h
@@ -77,7 +77,7 @@
   size_t total_active_count;  // Total count of active objects in the partition.
   size_t total_decommittable_bytes;  // Total bytes that could be decommitted.
   size_t total_discardable_bytes;    // Total bytes that could be discarded.
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   size_t
       total_brp_quarantined_bytes;  // Total bytes that are quarantined by BRP.
   size_t total_brp_quarantined_count;       // Total number of slots that are
diff --git a/base/allocator/partition_allocator/src/partition_alloc/pointers/instance_tracer.cc b/base/allocator/partition_allocator/src/partition_alloc/pointers/instance_tracer.cc
index 9f9c94c..b61e0ed 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/pointers/instance_tracer.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/pointers/instance_tracer.cc
@@ -16,7 +16,7 @@
 
 namespace base::internal {
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_INSTANCE_TRACER)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_INSTANCE_TRACER)
 
 static_assert(BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT),
               "Instance tracing requires BackupRefPtr support.");
diff --git a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h
index 708a3ca..98eab67 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h
@@ -27,29 +27,30 @@
 #include "partition_alloc/partition_alloc_base/win/win_handle_types.h"
 #endif
 
-#if BUILDFLAG(USE_PARTITION_ALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC)
 #include "partition_alloc/partition_alloc_base/check.h"
 // Live implementation of MiraclePtr being built.
-#if BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) || BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
+#if PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) || \
+    PA_BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
 #define PA_RAW_PTR_CHECK(condition) PA_BASE_CHECK(condition)
 #else
 // No-op implementation of MiraclePtr being built.
 // Note that `PA_BASE_DCHECK()` evaporates from non-DCHECK builds,
 // minimizing impact of generated code.
 #define PA_RAW_PTR_CHECK(condition) PA_BASE_DCHECK(condition)
-#endif  // BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||
-        // BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
-#else   // BUILDFLAG(USE_PARTITION_ALLOC)
+#endif  // PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||
+        // PA_BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
+#else   // PA_BUILDFLAG(USE_PARTITION_ALLOC)
 // Without PartitionAlloc, there's no `PA_BASE_D?CHECK()` implementation
 // available.
 #define PA_RAW_PTR_CHECK(condition)
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC)
 
-#if BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL)
+#if PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL)
 #include "partition_alloc/pointers/raw_ptr_backup_ref_impl.h"
-#elif BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL)
+#elif PA_BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL)
 #include "partition_alloc/pointers/raw_ptr_asan_unowned_impl.h"
-#elif BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL)
+#elif PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL)
 #include "partition_alloc/pointers/raw_ptr_hookable_impl.h"
 #else
 #include "partition_alloc/pointers/raw_ptr_noop_impl.h"
@@ -107,7 +108,7 @@
   kMayDangle = (1 << 0),
 
   // Disables any hooks, when building with
-  // BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL).
+  // PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL).
   //
   // Internal use only.
   kDisableHooks = (1 << 2),
@@ -259,7 +260,7 @@
 #undef PA_WINDOWS_HANDLE_TYPE
 #endif
 
-#if BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL)
+#if PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL)
 template <RawPtrTraits Traits>
 using UnderlyingImplForTraits = internal::RawPtrBackupRefImpl<
     /*AllowDangling=*/partition_alloc::internal::ContainsFlags(
@@ -269,14 +270,14 @@
         Traits,
         RawPtrTraits::kDisableBRP)>;
 
-#elif BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL)
+#elif PA_BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL)
 template <RawPtrTraits Traits>
 using UnderlyingImplForTraits = internal::RawPtrAsanUnownedImpl<
     partition_alloc::internal::ContainsFlags(Traits,
                                              RawPtrTraits::kAllowPtrArithmetic),
     partition_alloc::internal::ContainsFlags(Traits, RawPtrTraits::kMayDangle)>;
 
-#elif BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL)
+#elif PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL)
 template <RawPtrTraits Traits>
 using UnderlyingImplForTraits = internal::RawPtrHookableImpl<
     /*EnableHooks=*/!partition_alloc::internal::ContainsFlags(
@@ -289,7 +290,7 @@
 #endif
 
 constexpr bool IsPtrArithmeticAllowed([[maybe_unused]] RawPtrTraits Traits) {
-#if BUILDFLAG(ENABLE_POINTER_ARITHMETIC_TRAIT_CHECK)
+#if PA_BUILDFLAG(ENABLE_POINTER_ARITHMETIC_TRAIT_CHECK)
   return partition_alloc::internal::ContainsFlags(
       Traits, RawPtrTraits::kAllowPtrArithmetic);
 #else
@@ -357,16 +358,16 @@
                                          Traits,
                                          RawPtrTraits::kAllowUninitialized));
   static constexpr bool kZeroOnMove =
-      Impl::kMustZeroOnMove || BUILDFLAG(RAW_PTR_ZERO_ON_MOVE);
+      Impl::kMustZeroOnMove || PA_BUILDFLAG(RAW_PTR_ZERO_ON_MOVE);
   static constexpr bool kZeroOnDestruct =
-      Impl::kMustZeroOnDestruct || BUILDFLAG(RAW_PTR_ZERO_ON_DESTRUCT);
+      Impl::kMustZeroOnDestruct || PA_BUILDFLAG(RAW_PTR_ZERO_ON_DESTRUCT);
 
 // A non-trivial default ctor is required for complex implementations (e.g.
 // BackupRefPtr), or even for NoOpImpl when zeroing is requested.
-#if BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||   \
-    BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) || \
-    BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) ||     \
-    BUILDFLAG(RAW_PTR_ZERO_ON_CONSTRUCT)
+#if PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||   \
+    PA_BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) || \
+    PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) ||     \
+    PA_BUILDFLAG(RAW_PTR_ZERO_ON_CONSTRUCT)
   PA_ALWAYS_INLINE constexpr raw_ptr() noexcept {
     if constexpr (kZeroOnConstruct) {
       wrapped_ptr_ = nullptr;
@@ -377,18 +378,18 @@
   // uninitialized).
   PA_ALWAYS_INLINE constexpr raw_ptr() noexcept = default;
   static_assert(!kZeroOnConstruct);
-#endif  // BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||
-        // BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) ||
-        // BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) ||
-        // BUILDFLAG(RAW_PTR_ZERO_ON_CONSTRUCT)
+#endif  // PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||
+        // PA_BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) ||
+        // PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) ||
+        // PA_BUILDFLAG(RAW_PTR_ZERO_ON_CONSTRUCT)
 
 // A non-trivial copy ctor and assignment operator are required for complex
 // implementations (e.g. BackupRefPtr). Unlike the blocks around, we don't need
 // these for NoOpImpl even when zeroing is requested; better to keep them
 // trivial.
-#if BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||   \
-    BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) || \
-    BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL)
+#if PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||   \
+    PA_BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) || \
+    PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL)
   PA_ALWAYS_INLINE constexpr raw_ptr(const raw_ptr& p) noexcept
       : wrapped_ptr_(Impl::Duplicate(p.wrapped_ptr_)) {
     Impl::Trace(tracer_.owner_id(), p.wrapped_ptr_);
@@ -411,16 +412,17 @@
 #else
   PA_ALWAYS_INLINE raw_ptr(const raw_ptr&) noexcept = default;
   PA_ALWAYS_INLINE raw_ptr& operator=(const raw_ptr&) noexcept = default;
-#endif  // BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||
-        // BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) ||
-        // BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL)
+#endif  // PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||
+        // PA_BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) ||
+        // PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL)
 
 // A non-trivial move ctor and assignment operator are required for complex
 // implementations (e.g. BackupRefPtr), or even for NoOpImpl when zeroing is
 // requested.
-#if BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||   \
-    BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) || \
-    BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) || BUILDFLAG(RAW_PTR_ZERO_ON_MOVE)
+#if PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||   \
+    PA_BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) || \
+    PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) ||     \
+    PA_BUILDFLAG(RAW_PTR_ZERO_ON_MOVE)
   PA_ALWAYS_INLINE constexpr raw_ptr(raw_ptr&& p) noexcept {
     wrapped_ptr_ = p.wrapped_ptr_;
     Impl::Trace(tracer_.owner_id(), wrapped_ptr_);
@@ -448,17 +450,17 @@
   PA_ALWAYS_INLINE raw_ptr(raw_ptr&&) noexcept = default;
   PA_ALWAYS_INLINE raw_ptr& operator=(raw_ptr&&) noexcept = default;
   static_assert(!kZeroOnMove);
-#endif  // BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||
-        // BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) ||
-        // BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) ||
-        // BUILDFLAG(RAW_PTR_ZERO_ON_MOVE)
+#endif  // PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||
+        // PA_BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) ||
+        // PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) ||
+        // PA_BUILDFLAG(RAW_PTR_ZERO_ON_MOVE)
 
 // A non-trivial default dtor is required for complex implementations (e.g.
 // BackupRefPtr), or even for NoOpImpl when zeroing is requested.
-#if BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||   \
-    BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) || \
-    BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) ||     \
-    BUILDFLAG(RAW_PTR_ZERO_ON_DESTRUCT)
+#if PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||   \
+    PA_BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) || \
+    PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) ||     \
+    PA_BUILDFLAG(RAW_PTR_ZERO_ON_DESTRUCT)
   PA_ALWAYS_INLINE PA_CONSTEXPR_DTOR ~raw_ptr() noexcept {
     Impl::ReleaseWrappedPtr(wrapped_ptr_);
     Impl::Untrace(tracer_.owner_id());
@@ -470,10 +472,10 @@
 #else
   PA_ALWAYS_INLINE ~raw_ptr() noexcept = default;
   static_assert(!kZeroOnDestruct);
-#endif  // BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||
-        // BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) ||
-        // BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) ||
-        // BUILDFLAG(RAW_PTR_ZERO_ON_DESTRUCT)
+#endif  // PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||
+        // PA_BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) ||
+        // PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) ||
+        // PA_BUILDFLAG(RAW_PTR_ZERO_ON_DESTRUCT)
 
   // Cross-kind copy constructor.
   // Move is not supported as different traits may use different ref-counts, so
@@ -583,7 +585,8 @@
     // Make sure that pointer isn't assigned to itself (look at raw_ptr address,
     // not its contained pointer value). The comparison is only needed when they
     // are the same type, otherwise they can't be the same raw_ptr object.
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
     if constexpr (std::is_same_v<raw_ptr, std::decay_t<decltype(ptr)>>) {
       PA_RAW_PTR_CHECK(this != &ptr);
     }
@@ -604,7 +607,8 @@
     // Make sure that pointer isn't assigned to itself (look at raw_ptr address,
     // not its contained pointer value). The comparison is only needed when they
     // are the same type, otherwise they can't be the same raw_ptr object.
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
     if constexpr (std::is_same_v<raw_ptr, std::decay_t<decltype(ptr)>>) {
       PA_RAW_PTR_CHECK(this != &ptr);
     }
@@ -966,7 +970,7 @@
   }
 
   PA_ALWAYS_INLINE void ReportIfDangling() const noexcept {
-#if BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL)
+#if PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL)
     Impl::ReportIfDangling(wrapped_ptr_);
 #endif
   }
diff --git a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_backup_ref_impl.cc b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_backup_ref_impl.cc
index c9f2417..98e04767 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_backup_ref_impl.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_backup_ref_impl.cc
@@ -19,7 +19,8 @@
 template <bool AllowDangling, bool DisableBRP>
 void RawPtrBackupRefImpl<AllowDangling, DisableBRP>::AcquireInternal(
     uintptr_t address) {
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
   PA_BASE_CHECK(UseBrp(address));
 #endif
   auto [slot_start, slot_size] =
@@ -38,7 +39,8 @@
 template <bool AllowDangling, bool DisableBRP>
 void RawPtrBackupRefImpl<AllowDangling, DisableBRP>::ReleaseInternal(
     uintptr_t address) {
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
   PA_BASE_CHECK(UseBrp(address));
 #endif
   auto [slot_start, slot_size] =
@@ -87,7 +89,7 @@
   PA_BASE_CHECK(ptr_pos_within_alloc !=
                 partition_alloc::internal::PtrPosWithinAlloc::kFarOOB);
 
-#if BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
   return ptr_pos_within_alloc ==
          partition_alloc::internal::PtrPosWithinAlloc::kAllocEnd;
 #else
@@ -98,7 +100,8 @@
 template <bool AllowDangling, bool DisableBRP>
 bool RawPtrBackupRefImpl<AllowDangling, DisableBRP>::IsPointeeAlive(
     uintptr_t address) {
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
   PA_BASE_CHECK(UseBrp(address));
 #endif
   auto [slot_start, slot_size] =
@@ -119,7 +122,8 @@
 template struct RawPtrBackupRefImpl</*AllowDangling=*/true,
                                     /*DisableBRP=*/true>;
 
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
 void CheckThatAddressIsntWithinFirstPartitionPage(uintptr_t address) {
   if (partition_alloc::internal::IsManagedByDirectMap(address)) {
     uintptr_t reservation_start =
@@ -132,7 +136,7 @@
                   partition_alloc::PartitionPageSize());
   }
 }
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON) ||
-        // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON) ||
+        // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
 
 }  // namespace base::internal
diff --git a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_backup_ref_impl.h b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_backup_ref_impl.h
index df1ddf0..d521162 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_backup_ref_impl.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_backup_ref_impl.h
@@ -30,7 +30,8 @@
 
 namespace base::internal {
 
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
 PA_COMPONENT_EXPORT(RAW_PTR)
 void CheckThatAddressIsntWithinFirstPartitionPage(uintptr_t address);
 #endif
@@ -70,11 +71,12 @@
     // address is nullptr.
 #if PA_HAS_BUILTIN(__builtin_constant_p)
     if (__builtin_constant_p(address == 0) && (address == 0)) {
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
       PA_BASE_CHECK(
           !partition_alloc::IsManagedByPartitionAllocBRPPool(address));
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON) ||
-        // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON) ||
+        // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
       return false;
     }
 #endif  // PA_HAS_BUILTIN(__builtin_constant_p)
@@ -100,7 +102,8 @@
     // IsManagedByPartitionAllocBRPPool returns true for a valid pointer,
     // it must be at least partition page away from the beginning of a super
     // page.
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
     if (use_brp) {
       CheckThatAddressIsntWithinFirstPartitionPage(address);
     }
@@ -109,7 +112,7 @@
     return use_brp;
   }
 
-#if BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
   // Out-Of-Bounds (OOB) poison bit is set when the pointer has overflowed by
   // one byte.
 #if defined(ARCH_CPU_X86_64)
@@ -139,12 +142,12 @@
     return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(ptr) |
                                 OOB_POISON_BIT);
   }
-#else   // BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#else   // PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
   template <typename T>
   PA_ALWAYS_INLINE static T* UnpoisonPtr(T* ptr) {
     return ptr;
   }
-#endif  // BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#endif  // PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
 
  public:
   // Wraps a pointer.
@@ -155,7 +158,8 @@
     }
     uintptr_t address = partition_alloc::UntagPtr(UnpoisonPtr(ptr));
     if (IsSupportedAndNotNull(address)) {
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
       PA_BASE_CHECK(ptr != nullptr);
 #endif
       AcquireInternal(address);
@@ -189,7 +193,8 @@
     }
     uintptr_t address = partition_alloc::UntagPtr(UnpoisonPtr(wrapped_ptr));
     if (IsSupportedAndNotNull(address)) {
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
       PA_BASE_CHECK(wrapped_ptr != nullptr);
 #endif
       ReleaseInternal(address);
@@ -212,8 +217,9 @@
     if (partition_alloc::internal::base::is_constant_evaluated()) {
       return wrapped_ptr;
     }
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
-#if BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
     PA_BASE_CHECK(!IsPtrOOB(wrapped_ptr));
 #endif
     uintptr_t address = partition_alloc::UntagPtr(wrapped_ptr);
@@ -221,8 +227,8 @@
       PA_BASE_CHECK(wrapped_ptr != nullptr);
       PA_BASE_CHECK(IsPointeeAlive(address));  // Detects use-after-free.
     }
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON) ||
-        // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON) ||
+        // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
     return wrapped_ptr;
   }
 
@@ -235,7 +241,7 @@
       return wrapped_ptr;
     }
     T* unpoisoned_ptr = UnpoisonPtr(wrapped_ptr);
-#if BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
     // Some code uses invalid pointer values as indicators, so those values must
     // be passed through unchanged during extraction. The following check will
     // pass invalid values through if those values do not fall within the BRP
@@ -248,7 +254,7 @@
     // OOB conditions, e.g., in code that extracts an end-of-allocation pointer
     // for use in a loop termination condition. The poison bit would make that
     // pointer appear to reference a very high address.
-#endif  // BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#endif  // PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
     return unpoisoned_ptr;
   }
 
@@ -312,11 +318,11 @@
       constexpr size_t size = sizeof(T);
       [[maybe_unused]] const bool is_end =
           CheckPointerWithinSameAlloc(before_addr, after_addr, size);
-#if BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
       if (is_end) {
         new_ptr = PoisonOOBPtr(new_ptr);
       }
-#endif  // BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#endif  // PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
     } else {
       // Check that the new address didn't migrate into the BRP pool, as it
       // would result in more pointers pointing to an allocation than its
@@ -387,7 +393,7 @@
 
     T* unpoisoned_ptr1 = UnpoisonPtr(wrapped_ptr1);
     T* unpoisoned_ptr2 = UnpoisonPtr(wrapped_ptr2);
-#if BUILDFLAG(ENABLE_POINTER_SUBTRACTION_CHECK)
+#if PA_BUILDFLAG(ENABLE_POINTER_SUBTRACTION_CHECK)
     if (partition_alloc::internal::base::is_constant_evaluated()) {
       return unpoisoned_ptr1 - unpoisoned_ptr2;
     }
@@ -403,7 +409,7 @@
     } else {
       PA_BASE_CHECK(!IsSupportedAndNotNull(address2));
     }
-#endif  // BUILDFLAG(ENABLE_POINTER_SUBTRACTION_CHECK)
+#endif  // PA_BUILDFLAG(ENABLE_POINTER_SUBTRACTION_CHECK)
     return unpoisoned_ptr1 - unpoisoned_ptr2;
   }
 
@@ -445,7 +451,7 @@
     }
   }
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_INSTANCE_TRACER)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_INSTANCE_TRACER)
   template <typename T>
   static constexpr void Trace(uint64_t owner_id, T* wrapped_ptr) {
     if (partition_alloc::internal::base::is_constant_evaluated()) {
diff --git a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_unittest.cc
index 08dab52..51e9f8b 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_unittest.cc
@@ -45,7 +45,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/abseil-cpp/absl/types/variant.h"
 
-#if BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
+#if PA_BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
 #include <sanitizer/asan_interface.h>
 #include "base/debug/asan_service.h"
 #endif
@@ -1338,10 +1338,10 @@
   RawPtrCountingImpl::ClearCounters();
   size_t number_of_cleared_elements = vector.size();
   vector.clear();
-#if BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||   \
-    BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) || \
-    BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) ||     \
-    BUILDFLAG(RAW_PTR_ZERO_ON_DESTRUCT)
+#if PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||   \
+    PA_BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) || \
+    PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL) ||     \
+    PA_BUILDFLAG(RAW_PTR_ZERO_ON_DESTRUCT)
   EXPECT_EQ((int)number_of_cleared_elements,
             RawPtrCountingImpl::release_wrapped_ptr_cnt);
 #else
@@ -1352,9 +1352,9 @@
   // BackupRefPtr ships to the Stable channel).
   EXPECT_EQ(0, RawPtrCountingImpl::release_wrapped_ptr_cnt);
   std::ignore = number_of_cleared_elements;
-#endif  // BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||
-        // BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) ||
-        // BUILDFLAG(RAW_PTR_ZERO_ON_DESTRUCT)
+#endif  // PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) ||
+        // PA_BUILDFLAG(USE_RAW_PTR_ASAN_UNOWNED_IMPL) ||
+        // PA_BUILDFLAG(RAW_PTR_ZERO_ON_DESTRUCT)
 }
 
 struct BaseStruct {
@@ -1588,7 +1588,7 @@
 
 namespace base::internal {
 
-#if BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) && \
+#if PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) && \
     !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
 
 void HandleOOM(size_t unused_size) {
@@ -1648,10 +1648,10 @@
   EXPECT_EQ(*raw_ptr1, *wrapped_ptr1);
 
   allocator_.root()->Free(raw_ptr1);
-#if DCHECK_IS_ON() || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if DCHECK_IS_ON() || PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
   // In debug builds, the use-after-free should be caught immediately.
   EXPECT_DEATH_IF_SUPPORTED(g_volatile_int_to_ignore = *wrapped_ptr1, "");
-#else   // DCHECK_IS_ON() || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#else   // DCHECK_IS_ON() || PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
   if (cpu.has_mte()) {
     // If the hardware supports MTE, the use-after-free should also be caught.
     EXPECT_DEATH_IF_SUPPORTED(g_volatile_int_to_ignore = *wrapped_ptr1, "");
@@ -1672,7 +1672,7 @@
   EXPECT_EQ(partition_alloc::UntagPtr(raw_ptr1),
             partition_alloc::UntagPtr(raw_ptr3));
   allocator_.root()->Free(raw_ptr3);
-#endif  // DCHECK_IS_ON() || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#endif  // DCHECK_IS_ON() || PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
 }
 
 TEST_F(BackupRefPtrTest, ZeroSized) {
@@ -1753,7 +1753,7 @@
 void RunBackupRefPtrImplAdvanceTest(
     partition_alloc::PartitionAllocator& allocator,
     size_t requested_size) {
-#if BUILDFLAG(BACKUP_REF_PTR_EXTRA_OOB_CHECKS)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_EXTRA_OOB_CHECKS)
   char* ptr = static_cast<char*>(allocator.root()->Alloc(requested_size));
   raw_ptr<char, AllowPtrArithmetic> protected_ptr = ptr;
   protected_ptr += 123;
@@ -1764,7 +1764,7 @@
   // end-of-allocation address should not cause an error immediately, but it may
   // result in the pointer being poisoned.
   protected_ptr = protected_ptr + (requested_size + 1) / 2;
-#if BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
   EXPECT_DEATH_IF_SUPPORTED(*protected_ptr = ' ', "");
   protected_ptr -= 1;  // This brings the pointer back within
                        // bounds, which causes the poison to be removed.
@@ -1785,7 +1785,7 @@
   EXPECT_CHECK_DEATH(protected_ptr -= 1);
   EXPECT_CHECK_DEATH(--protected_ptr);
 
-#if BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
   // An array of a size that doesn't cleanly fit into the allocation. This is to
   // check that one can't access elements that don't fully fit in the
   // allocation.
@@ -1804,11 +1804,11 @@
   protected_arr_ptr++;
   EXPECT_CHECK_DEATH(** protected_arr_ptr = 4);
   protected_arr_ptr = nullptr;
-#endif  // BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#endif  // PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
 
   protected_ptr = nullptr;
   allocator.root()->Free(ptr);
-#endif  // BUILDFLAG(BACKUP_REF_PTR_EXTRA_OOB_CHECKS)
+#endif  // PA_BUILDFLAG(BACKUP_REF_PTR_EXTRA_OOB_CHECKS)
 }
 
 TEST_F(BackupRefPtrTest, Advance) {
@@ -1875,7 +1875,7 @@
             checked_cast<ptrdiff_t>(requested_size));
   EXPECT_EQ(protected_ptr1 - protected_ptr1_4,
             -checked_cast<ptrdiff_t>(requested_size));
-#if BUILDFLAG(ENABLE_POINTER_SUBTRACTION_CHECK)
+#if PA_BUILDFLAG(ENABLE_POINTER_SUBTRACTION_CHECK)
   EXPECT_CHECK_DEATH(protected_ptr2 - protected_ptr1);
   EXPECT_CHECK_DEATH(protected_ptr1 - protected_ptr2);
   EXPECT_CHECK_DEATH(protected_ptr2 - protected_ptr1_4);
@@ -1884,7 +1884,7 @@
   EXPECT_CHECK_DEATH(protected_ptr1 - protected_ptr2_2);
   EXPECT_CHECK_DEATH(protected_ptr2_2 - protected_ptr1_4);
   EXPECT_CHECK_DEATH(protected_ptr1_4 - protected_ptr2_2);
-#endif  // BUILDFLAG(ENABLE_POINTER_SUBTRACTION_CHECK)
+#endif  // PA_BUILDFLAG(ENABLE_POINTER_SUBTRACTION_CHECK)
   EXPECT_EQ(protected_ptr2_2 - protected_ptr2, 1);
   EXPECT_EQ(protected_ptr2 - protected_ptr2_2, -1);
 
@@ -1902,7 +1902,7 @@
 volatile char g_volatile_char_to_ignore;
 
 TEST_F(BackupRefPtrTest, IndexOperator) {
-#if BUILDFLAG(BACKUP_REF_PTR_EXTRA_OOB_CHECKS)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_EXTRA_OOB_CHECKS)
   size_t requested_size = GetRequestSizeThatFills512BSlot();
   char* ptr = static_cast<char*>(allocator_.root()->Alloc(requested_size));
   {
@@ -1911,13 +1911,13 @@
     std::ignore = array[requested_size - 1];
     EXPECT_CHECK_DEATH(std::ignore = array[-1]);
     EXPECT_CHECK_DEATH(std::ignore = array[requested_size + 1]);
-#if BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
     EXPECT_DEATH_IF_SUPPORTED(g_volatile_char_to_ignore = array[requested_size],
                               "");
 #endif
   }
   allocator_.root()->Free(ptr);
-#endif  // BUILDFLAG(BACKUP_REF_PTR_EXTRA_OOB_CHECKS)
+#endif  // PA_BUILDFLAG(BACKUP_REF_PTR_EXTRA_OOB_CHECKS)
 }
 
 bool IsQuarantineEmpty(partition_alloc::PartitionAllocator& allocator) {
@@ -2098,7 +2098,7 @@
 
   void* ptr = allocator_.root()->Alloc(16);
   raw_ptr<void> dangling_ptr = ptr;
-#if BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
+#if PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
   BASE_EXPECT_DEATH(
       {
         allocator_.root()->Free(ptr);  // Dangling raw_ptr detected.
@@ -2196,7 +2196,7 @@
 
   raw_ptr<int> ptr =
       static_cast<int*>(allocator_.root()->Alloc(sizeof(int), ""));
-#if BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
+#if PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
   BASE_EXPECT_DEATH(
       {
         allocator_.root()->Free(ptr.get());  // Dangling raw_ptr detected.
@@ -2208,7 +2208,7 @@
 #else
   allocator_.root()->Free(ptr.get());
   ptr = nullptr;
-#endif  // BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
+#endif  // PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_CHECKS)
 }
 
 TEST_F(BackupRefPtrTest, SpatialAlgoCompat) {
@@ -2300,7 +2300,7 @@
   allocator_.root()->Free(ptr);
 }
 
-#if BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#if PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
 TEST_F(BackupRefPtrTest, Duplicate) {
   size_t requested_size = allocator_.root()->AdjustSizeForExtrasSubtract(512);
   char* ptr = static_cast<char*>(allocator_.root()->Alloc(requested_size));
@@ -2327,9 +2327,9 @@
   protected_ptr3 = nullptr;
   allocator_.root()->Free(ptr);
 }
-#endif  // BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
+#endif  // PA_BUILDFLAG(BACKUP_REF_PTR_POISON_OOB_PTR)
 
-#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
+#if PA_BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
 TEST_F(BackupRefPtrTest, WriteAfterFree) {
   constexpr uint64_t kPayload = 0x1234567890ABCDEF;
 
@@ -2349,7 +2349,7 @@
       },
       "");
 }
-#endif  // BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
+#endif  // PA_BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON)
 
 namespace {
 constexpr uint8_t kCustomQuarantineByte = 0xff;
@@ -2402,7 +2402,8 @@
     // Freeing would  update the MTE tag so use |TagPtr()| to dereference it
     // below.
     allocator_.root()->Free(ptr);
-#if BUILDFLAG(PA_DCHECK_IS_ON) || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON) || \
+    PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
     // Recreate the raw_ptr so we can use a pointer with the updated MTE tag.
     // Reassigning to |ptr| would hit the PartitionRefCount cookie check rather
     // than the |IsPointeeAlive()| check.
@@ -2432,10 +2433,10 @@
   allocator_.root()->Free(sentinel);
 }
 
-#endif  // BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) &&
+#endif  // PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL) &&
         // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
 
-#if BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL)
+#if PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL)
 
 namespace {
 #define FOR_EACH_RAW_PTR_OPERATION(F) \
@@ -2577,7 +2578,7 @@
   EXPECT_EQ(CountingHooks::Get()->unsafely_unwrap_for_duplication_count, 1u);
 }
 
-#endif  // BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL)
+#endif  // PA_BUILDFLAG(USE_RAW_PTR_HOOKABLE_IMPL)
 
 TEST(DanglingPtrTest, DetectAndReset) {
   auto instrumentation = test::DanglingPtrInstrumentation::Create();
@@ -2638,8 +2639,8 @@
   EXPECT_EQ(instrumentation->dangling_ptr_released(), 1u);
 }
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_INSTANCE_TRACER) && \
-    BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_INSTANCE_TRACER) && \
+    PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL)
 TEST(RawPtrInstanceTracerTest, CreateAndDestroy) {
   auto owned = std::make_unique<int>(8);
 
@@ -2959,7 +2960,7 @@
   EXPECT_THAT(InstanceTracer::GetStackTracesForAddressForTest(owned2.get()),
               IsEmpty());
 }
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_INSTANCE_TRACER) &&
-        // BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_INSTANCE_TRACER) &&
+        // PA_BUILDFLAG(USE_RAW_PTR_BACKUP_REF_IMPL)
 
 }  // namespace base::internal
diff --git a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ref_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ref_unittest.cc
index 03bcdbf..0e859d3 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ref_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ref_unittest.cc
@@ -18,10 +18,10 @@
 #include "partition_alloc/pointers/raw_ptr_counting_impl_for_test.h"
 #include "partition_alloc/pointers/raw_ptr_test_support.h"
 #include "testing/gtest/include/gtest/gtest.h"
-#if BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
+#if PA_BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
 #include "base/debug/asan_service.h"
 #include "base/memory/raw_ptr_asan_service.h"
-#endif  // BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
+#endif  // PA_BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
 
 namespace {
 
@@ -561,8 +561,8 @@
 // `raw_ref` evaluate to nothing. Therefore, death tests relying on
 // these CHECKs firing are disabled in their absence.
 
-#if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) || \
-    BUILDFLAG(USE_ASAN_BACKUP_REF_PTR) || BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) || \
+    PA_BUILDFLAG(USE_ASAN_BACKUP_REF_PTR) || PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 TEST(RawRefDeathTest, CopyConstructAfterMove) {
   int i = 1;
@@ -802,9 +802,9 @@
   }
 }
 
-#endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) ||
-        // BUILDFLAG(USE_ASAN_BACKUP_REF_PTR) ||
-        // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) ||
+        // PA_BUILDFLAG(USE_ASAN_BACKUP_REF_PTR) ||
+        // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 TEST(RawRef, CTAD) {
   int i = 1;
@@ -962,7 +962,7 @@
               CountersMatch());
 }
 
-#if BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
+#if PA_BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
 
 TEST(AsanBackupRefPtrImpl, RawRefGet) {
   base::debug::AsanService::GetInstance()->Initialize();
@@ -1016,6 +1016,6 @@
   [[maybe_unused]] volatile int& ref = *safe_ref;
 }
 
-#endif  // BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
+#endif  // PA_BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
 
 }  // namespace
diff --git a/base/allocator/partition_allocator/src/partition_alloc/pool_offset_freelist.h b/base/allocator/partition_allocator/src/partition_alloc/pool_offset_freelist.h
index b2213d5d..36a954e6 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/pool_offset_freelist.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/pool_offset_freelist.h
@@ -210,7 +210,7 @@
     // SetNext() is either called on the freelist head, when provisioning new
     // slots, or when GetNext() has been called before, no need to pass the
     // size.
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     // Regular freelists always point to an entry within the same super page.
     //
     // This is most likely a PartitionAlloc bug if this triggers.
@@ -219,7 +219,7 @@
                         (SlotStartPtr2Addr(entry) & kSuperPageBaseMask))) {
       FreelistCorruptionDetected(0);
     }
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
     encoded_next_ = EncodedPoolOffset(entry);
 #if PA_CONFIG(HAS_FREELIST_SHADOW_ENTRY)
@@ -325,7 +325,7 @@
     const bool same_super_page = (here_address & kSuperPageBaseMask) ==
                                  (next_address & kSuperPageBaseMask);
 
-#if BUILDFLAG(USE_FREESLOT_BITMAP)
+#if PA_BUILDFLAG(USE_FREESLOT_BITMAP)
     // TODO(crbug.com/40274683): Add support for freeslot bitmaps.
     static_assert(false, "USE_FREESLOT_BITMAP not supported");
 #else
diff --git a/base/allocator/partition_allocator/src/partition_alloc/reservation_offset_table.cc b/base/allocator/partition_allocator/src/partition_alloc/reservation_offset_table.cc
index 656f3a1..0ab06c05c2 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/reservation_offset_table.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/reservation_offset_table.cc
@@ -8,11 +8,11 @@
 
 namespace partition_alloc::internal {
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 ReservationOffsetTable ReservationOffsetTable::singleton_;
 #else
 ReservationOffsetTable::_ReservationOffsetTable
     ReservationOffsetTable::reservation_offset_table_;
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 }  // namespace partition_alloc::internal
diff --git a/base/allocator/partition_allocator/src/partition_alloc/reservation_offset_table.h b/base/allocator/partition_allocator/src/partition_alloc/reservation_offset_table.h
index b7ba07c3..34d8ce05 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/reservation_offset_table.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/reservation_offset_table.h
@@ -67,7 +67,7 @@
 class PA_COMPONENT_EXPORT(PARTITION_ALLOC)
     PA_THREAD_ISOLATED_ALIGN ReservationOffsetTable {
  public:
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   // There is one reservation offset table per Pool in 64-bit mode.
   static constexpr size_t kReservationOffsetTableCoverage = kPoolMaxSize;
   static constexpr size_t kReservationOffsetTableLength =
@@ -78,7 +78,7 @@
   static constexpr uint64_t kGiB = 1024 * 1024 * 1024ull;
   static constexpr size_t kReservationOffsetTableLength =
       4 * kGiB / kSuperPageSize;
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   static_assert(kReservationOffsetTableLength < kOffsetTagNormalBuckets,
                 "Offsets should be smaller than kOffsetTagNormalBuckets.");
 
@@ -96,7 +96,7 @@
       }
     }
   };
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   // If thread isolation support is enabled, we need to write-protect the tables
   // of the thread isolated pool. For this, we need to pad the tables so that
   // the thread isolated ones start on a page boundary.
@@ -115,10 +115,10 @@
 #else
   // A single table for the entire 32-bit address space.
   static PA_CONSTINIT struct _ReservationOffsetTable reservation_offset_table_;
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 };
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 PA_ALWAYS_INLINE uint16_t* GetReservationOffsetTable(pool_handle handle) {
   PA_DCHECK(kNullPoolHandle < handle && handle <= kNumPools);
   return ReservationOffsetTable::singleton_.tables[handle - 1].offsets;
@@ -148,7 +148,7 @@
             ReservationOffsetTable::kReservationOffsetTableLength);
   return GetReservationOffsetTable(pool) + table_index;
 }
-#else   // BUILDFLAG(HAS_64_BIT_POINTERS)
+#else   // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 PA_ALWAYS_INLINE uint16_t* GetReservationOffsetTable(uintptr_t address) {
   return ReservationOffsetTable::reservation_offset_table_.offsets;
 }
@@ -158,10 +158,10 @@
   return ReservationOffsetTable::reservation_offset_table_.offsets +
          ReservationOffsetTable::kReservationOffsetTableLength;
 }
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 PA_ALWAYS_INLINE uint16_t* ReservationOffsetPointer(uintptr_t address) {
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   // In 64-bit mode, find the owning Pool and compute the offset from its base.
   PartitionAddressSpace::PoolInfo info = GetPoolInfo(address);
   return ReservationOffsetPointer(info.handle, info.offset);
@@ -182,12 +182,12 @@
 // If the given address doesn't point to direct-map allocated memory,
 // returns 0.
 PA_ALWAYS_INLINE uintptr_t GetDirectMapReservationStart(uintptr_t address) {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   bool is_in_brp_pool = IsManagedByPartitionAllocBRPPool(address);
   bool is_in_regular_pool = IsManagedByPartitionAllocRegularPool(address);
   bool is_in_configurable_pool =
       IsManagedByPartitionAllocConfigurablePool(address);
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   bool is_in_thread_isolated_pool =
       IsManagedByPartitionAllocThreadIsolatedPool(address);
 #endif
@@ -196,14 +196,14 @@
 #if !BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
   PA_DCHECK(!is_in_brp_pool);
 #endif
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
   uint16_t* offset_ptr = ReservationOffsetPointer(address);
   PA_DCHECK(*offset_ptr != kOffsetTagNotAllocated);
   if (*offset_ptr == kOffsetTagNormalBuckets) {
     return 0;
   }
   uintptr_t reservation_start = ComputeReservationStart(address, offset_ptr);
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   // MSVC workaround: the preprocessor seems to choke on an `#if` embedded
   // inside another macro (PA_DCHECK).
 #if !BUILDFLAG(HAS_64_BIT_POINTERS)
@@ -223,17 +223,17 @@
             IsManagedByPartitionAllocRegularPool(reservation_start));
   PA_DCHECK(is_in_configurable_pool ==
             IsManagedByPartitionAllocConfigurablePool(reservation_start));
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
   PA_DCHECK(is_in_thread_isolated_pool ==
             IsManagedByPartitionAllocThreadIsolatedPool(reservation_start));
 #endif
   PA_DCHECK(*ReservationOffsetPointer(reservation_start) == 0);
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
   return reservation_start;
 }
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 // If the given address doesn't point to direct-map allocated memory,
 // returns 0.
 // This variant has better performance than the regular one on 64-bit builds if
@@ -254,7 +254,7 @@
   PA_DCHECK(*ReservationOffsetPointer(reservation_start) == 0);
   return reservation_start;
 }
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 // Returns true if |address| is the beginning of the first super page of a
 // reservation, i.e. either a normal bucket super page, or the first super page
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_interception_apple.h b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_interception_apple.h
index 3a91ab6..e0d4876 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_interception_apple.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_interception_apple.h
@@ -7,7 +7,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_ALLOCATOR_SHIM)
+#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 #include <cstddef>
 
 #include "partition_alloc/partition_alloc_base/component_export.h"
@@ -66,6 +66,6 @@
 
 }  // namespace allocator_shim
 
-#endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
+#endif  // PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 
 #endif  // PARTITION_ALLOC_SHIM_ALLOCATOR_INTERCEPTION_APPLE_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_interception_apple.mm b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_interception_apple.mm
index 3554fb2c11..1aa4345 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_interception_apple.mm
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_interception_apple.mm
@@ -19,7 +19,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_ALLOCATOR_SHIM)
+#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 #include <CoreFoundation/CoreFoundation.h>
 #import <Foundation/Foundation.h>
 #include <mach/mach.h>
@@ -630,4 +630,4 @@
 
 }  // namespace allocator_shim
 
-#endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
+#endif  // PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_interception_apple_unittest.mm b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_interception_apple_unittest.mm
index ffefcca..c043c2f 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_interception_apple_unittest.mm
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_interception_apple_unittest.mm
@@ -6,7 +6,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_ALLOCATOR_SHIM)
+#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 #include <mach/mach.h>
 
 #include "partition_alloc/shim/allocator_shim.h"
@@ -72,4 +72,4 @@
 
 }  // namespace allocator_shim
 
-#endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
+#endif  // PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.cc b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.cc
index 9e2909b..eb7251e5 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.cc
@@ -9,7 +9,7 @@
 #include "partition_alloc/build_config.h"
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 #include "partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h"
 #endif
 
@@ -48,7 +48,7 @@
 // quite likely to keep working in the future. For instance, LLVM for LSAN uses
 // this mechanism.
 
-#if defined(LIBC_GLIBC) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if defined(LIBC_GLIBC) && PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 #include "partition_alloc/shim/allocator_shim_override_glibc_weak_symbols.h"
 #endif
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.h b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.h
index 3654002..9091dd9 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.h
@@ -10,14 +10,14 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_ALLOCATOR_SHIM)
+#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 #include "partition_alloc/build_config.h"
 #include "partition_alloc/partition_alloc_base/component_export.h"
 #include "partition_alloc/partition_alloc_base/types/strong_alias.h"
 #include "partition_alloc/shim/allocator_dispatch.h"
 #include "partition_alloc/tagging.h"
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && PA_BUILDFLAG(USE_STARSCAN)
 #include "partition_alloc/starscan/pcscan.h"
 #endif
 
@@ -91,16 +91,16 @@
 #endif  // BUILDFLAG(IS_APPLE)
 
 #if BUILDFLAG(IS_APPLE)
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 PA_COMPONENT_EXPORT(ALLOCATOR_SHIM)
 void InitializeDefaultAllocatorPartitionRoot();
 bool IsDefaultAllocatorPartitionRootInitialized();
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 // On macOS, the allocator shim needs to be turned on during runtime.
 PA_COMPONENT_EXPORT(ALLOCATOR_SHIM) void InitializeAllocatorShim();
 #endif  // BUILDFLAG(IS_APPLE)
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 PA_COMPONENT_EXPORT(ALLOCATOR_SHIM) void EnablePartitionAllocMemoryReclaimer();
 
 using EnableBrp =
@@ -137,14 +137,14 @@
 PA_COMPONENT_EXPORT(ALLOCATOR_SHIM) void AdjustDefaultAllocatorForForeground();
 PA_COMPONENT_EXPORT(ALLOCATOR_SHIM) void AdjustDefaultAllocatorForBackground();
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 PA_COMPONENT_EXPORT(ALLOCATOR_SHIM)
 void EnablePCScan(partition_alloc::internal::PCScan::InitConfig);
 #endif
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 }  // namespace allocator_shim
 
-#endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
+#endif  // PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 
 #endif  // PARTITION_ALLOC_SHIM_ALLOCATOR_SHIM_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_android.cc b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_android.cc
index c12907c..7c8f014 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_android.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_android.cc
@@ -9,7 +9,7 @@
 #include "partition_alloc/build_config.h"
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 #include "partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h"
 #endif
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_apple.cc b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_apple.cc
index 8cf5a8b43..8b9bd37 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_apple.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_apple.cc
@@ -13,7 +13,7 @@
 #include "partition_alloc/partition_alloc_check.h"
 #include "partition_alloc/shim/allocator_interception_apple.h"
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 #include "partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h"
 #endif
 
@@ -59,7 +59,7 @@
 
 #include "partition_alloc/shim/shim_alloc_functions.h"
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 // Cpp symbols (new / delete) should always be routed through the shim layer
 // except on Windows and macOS (except for PartitionAlloc-Everywhere) where the
 // malloc intercept is deep enough that it also catches the cpp calls.
@@ -72,11 +72,11 @@
 #include "partition_alloc/shim/allocator_shim_override_cpp_symbols.h"
 #endif
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 #include "partition_alloc/shim/allocator_shim_override_apple_default_zone.h"
-#else  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#else  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 #include "partition_alloc/shim/allocator_shim_override_apple_symbols.h"
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 namespace allocator_shim {
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.cc b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.cc
index 379268f..c3a4004 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.cc
@@ -302,11 +302,11 @@
                                                                      size, "");
 }
 
-#if BUILDFLAG(PA_IS_CAST_ANDROID)
+#if PA_BUILDFLAG(PA_IS_CAST_ANDROID)
 extern "C" {
 void __real_free(void*);
 }       // extern "C"
-#endif  // BUILDFLAG(PA_IS_CAST_ANDROID)
+#endif  // PA_BUILDFLAG(PA_IS_CAST_ANDROID)
 
 void PartitionFree(const AllocatorDispatch*, void* object, void* context) {
   partition_alloc::ScopedDisallowAllocations guard{};
@@ -326,7 +326,7 @@
   // malloc() pointer can be passed to PartitionAlloc's free(). If we don't own
   // the pointer, pass it along. This should not have a runtime cost vs regular
   // Android, since on Android we have a PA_CHECK() rather than the branch here.
-#if BUILDFLAG(PA_IS_CAST_ANDROID)
+#if PA_BUILDFLAG(PA_IS_CAST_ANDROID)
   if (PA_UNLIKELY(!partition_alloc::IsManagedByPartitionAlloc(
                       reinterpret_cast<uintptr_t>(object)) &&
                   object)) {
@@ -335,7 +335,7 @@
     // here.
     return __real_free(object);
   }
-#endif  // BUILDFLAG(PA_IS_CAST_ANDROID)
+#endif  // PA_BUILDFLAG(PA_IS_CAST_ANDROID)
 
   partition_alloc::PartitionRoot::FreeInlineInUnknownRoot<
       partition_alloc::FreeFlags::kNoHooks>(object);
@@ -467,7 +467,7 @@
 
 }  // namespace allocator_shim::internal
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 namespace allocator_shim {
 
@@ -574,7 +574,7 @@
 #endif  // PA_CONFIG(EXTRAS_REQUIRED)
 }
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 void EnablePCScan(partition_alloc::internal::PCScan::InitConfig config) {
   partition_alloc::internal::PCScan::Initialize(config);
 
@@ -588,7 +588,7 @@
   allocator_shim::NonScannableAllocator::Instance().NotifyPCScanEnabled();
   allocator_shim::NonQuarantinableAllocator::Instance().NotifyPCScanEnabled();
 }
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 
 void AdjustDefaultAllocatorForForeground() {
   Allocator()->AdjustForForeground();
@@ -722,4 +722,4 @@
 
 #endif  // BUILDFLAG(IS_APPLE)
 
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h
index f65db82..e6e287e 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h
@@ -7,7 +7,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_ALLOCATOR_SHIM)
+#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 #include "partition_alloc/partition_alloc.h"
 #include "partition_alloc/partition_alloc_base/component_export.h"
 #include "partition_alloc/shim/allocator_shim.h"
@@ -78,7 +78,7 @@
 
 }  // namespace internal
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 // Provide a ConfigurePartitions() helper, to mimic what Chromium uses. This way
 // we're making it more resilient to ConfigurePartitions() interface changes, so
 // that we don't have to modify multiple callers. This is particularly important
@@ -104,10 +104,10 @@
                       scheduler_loop_quarantine_capacity_in_bytes,
                       zapping_by_free_flags, use_pool_offset_freelists);
 }
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 }  // namespace allocator_shim
 
-#endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
+#endif  // PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 
 #endif  // PARTITION_ALLOC_SHIM_ALLOCATOR_SHIM_DEFAULT_DISPATCH_TO_PARTITION_ALLOC_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc_unittest.cc
index 3fdecdc..20eef1f 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc_unittest.cc
@@ -22,10 +22,11 @@
 #include <malloc/malloc.h>
 #endif
 
-#if !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) && BUILDFLAG(USE_PARTITION_ALLOC)
+#if !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) && \
+    PA_BUILDFLAG(USE_PARTITION_ALLOC)
 namespace allocator_shim::internal {
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 // Platforms on which we override weak libc symbols.
 #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
@@ -90,7 +91,7 @@
 
 #endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
 
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 // Note: the tests below are quite simple, they are used as simple smoke tests
 // for PartitionAlloc-Everywhere. Most of these directly dispatch to
@@ -186,7 +187,7 @@
                     alignof(partition_alloc::PartitionRoot));
 }
 
-#if BUILDFLAG(IS_APPLE) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if BUILDFLAG(IS_APPLE) && PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 // Make sure that a sequence a "good sizes" grows fast enough. This is
 // implicitly required by CoreFoundation, and to match Apple's implementation.
 // Non-regression test for crbug.com/1501312
@@ -199,8 +200,8 @@
   }
   EXPECT_LT(iterations, 100);
 }
-#endif  // BUILDFLAG(IS_APPLE) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // BUILDFLAG(IS_APPLE) && PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 }  // namespace allocator_shim::internal
 #endif  // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) &&
-        // BUILDFLAG(USE_PARTITION_ALLOC)
+        // PA_BUILDFLAG(USE_PARTITION_ALLOC)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_apple_symbols.h b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_apple_symbols.h
index b130eb5..0ee2bd5 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_apple_symbols.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_apple_symbols.h
@@ -11,7 +11,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_ALLOCATOR_SHIM)
+#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 #include "partition_alloc/shim/malloc_zone_functions_apple.h"
 #include "partition_alloc/third_party/apple_apsl/malloc.h"
 
@@ -72,6 +72,6 @@
 
 }  // namespace allocator_shim
 
-#endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
+#endif  // PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 
 #endif  // PARTITION_ALLOC_SHIM_ALLOCATOR_SHIM_OVERRIDE_APPLE_SYMBOLS_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_cpp_symbols.h b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_cpp_symbols.h
index 8bda956..d25a4dc 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_cpp_symbols.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_cpp_symbols.h
@@ -11,7 +11,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_ALLOCATOR_SHIM)
+#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 // Preempt the default new/delete C++ symbols so they call the shim entry
 // points. This file is strongly inspired by tcmalloc's
 // libc_override_redefine.h.
@@ -35,7 +35,7 @@
 #endif
 
 SHIM_CPP_SYMBOLS_EXPORT void* operator new(size_t size) {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   return malloc(size);
 #else
   return ShimCppNew(size);
@@ -43,7 +43,7 @@
 }
 
 SHIM_CPP_SYMBOLS_EXPORT void operator delete(void* p) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   free(p);
 #else
   ShimCppDelete(p);
@@ -51,7 +51,7 @@
 }
 
 SHIM_CPP_SYMBOLS_EXPORT void* operator new[](size_t size) {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   return malloc(size);
 #else
   return ShimCppNew(size);
@@ -59,7 +59,7 @@
 }
 
 SHIM_CPP_SYMBOLS_EXPORT void operator delete[](void* p) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   free(p);
 #else
   ShimCppDelete(p);
@@ -68,7 +68,7 @@
 
 SHIM_CPP_SYMBOLS_EXPORT void* operator new(size_t size,
                                            const std::nothrow_t&) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   return malloc(size);
 #else
   return ShimCppNewNoThrow(size);
@@ -77,7 +77,7 @@
 
 SHIM_CPP_SYMBOLS_EXPORT void* operator new[](size_t size,
                                              const std::nothrow_t&) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   return malloc(size);
 #else
   return ShimCppNewNoThrow(size);
@@ -86,7 +86,7 @@
 
 SHIM_CPP_SYMBOLS_EXPORT void operator delete(void* p,
                                              const std::nothrow_t&) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   free(p);
 #else
   ShimCppDelete(p);
@@ -95,7 +95,7 @@
 
 SHIM_CPP_SYMBOLS_EXPORT void operator delete[](void* p,
                                                const std::nothrow_t&) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   free(p);
 #else
   ShimCppDelete(p);
@@ -103,7 +103,7 @@
 }
 
 SHIM_CPP_SYMBOLS_EXPORT void operator delete(void* p, size_t) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   free(p);
 #else
   ShimCppDelete(p);
@@ -111,7 +111,7 @@
 }
 
 SHIM_CPP_SYMBOLS_EXPORT void operator delete[](void* p, size_t) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   free(p);
 #else
   ShimCppDelete(p);
@@ -120,7 +120,7 @@
 
 SHIM_CPP_SYMBOLS_EXPORT void* operator new(std::size_t size,
                                            std::align_val_t alignment) {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   return aligned_alloc(static_cast<size_t>(alignment), size);
 #else
   return ShimCppAlignedNew(size, static_cast<size_t>(alignment));
@@ -130,7 +130,7 @@
 SHIM_CPP_SYMBOLS_EXPORT void* operator new(std::size_t size,
                                            std::align_val_t alignment,
                                            const std::nothrow_t&) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   return aligned_alloc(static_cast<size_t>(alignment), size);
 #else
   return ShimCppAlignedNew(size, static_cast<size_t>(alignment));
@@ -139,7 +139,7 @@
 
 SHIM_CPP_SYMBOLS_EXPORT void operator delete(void* p,
                                              std::align_val_t) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   free(p);
 #else
   ShimCppDelete(p);
@@ -149,7 +149,7 @@
 SHIM_CPP_SYMBOLS_EXPORT void operator delete(void* p,
                                              std::size_t size,
                                              std::align_val_t) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   free(p);
 #else
   ShimCppDelete(p);
@@ -159,7 +159,7 @@
 SHIM_CPP_SYMBOLS_EXPORT void operator delete(void* p,
                                              std::align_val_t,
                                              const std::nothrow_t&) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   free(p);
 #else
   ShimCppDelete(p);
@@ -168,7 +168,7 @@
 
 SHIM_CPP_SYMBOLS_EXPORT void* operator new[](std::size_t size,
                                              std::align_val_t alignment) {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   return aligned_alloc(static_cast<size_t>(alignment), size);
 #else
   return ShimCppAlignedNew(size, static_cast<size_t>(alignment));
@@ -178,7 +178,7 @@
 SHIM_CPP_SYMBOLS_EXPORT void* operator new[](std::size_t size,
                                              std::align_val_t alignment,
                                              const std::nothrow_t&) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   return aligned_alloc(static_cast<size_t>(alignment), size);
 #else
   return ShimCppAlignedNew(size, static_cast<size_t>(alignment));
@@ -187,7 +187,7 @@
 
 SHIM_CPP_SYMBOLS_EXPORT void operator delete[](void* p,
                                                std::align_val_t) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   free(p);
 #else
   ShimCppDelete(p);
@@ -197,7 +197,7 @@
 SHIM_CPP_SYMBOLS_EXPORT void operator delete[](void* p,
                                                std::size_t size,
                                                std::align_val_t) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   free(p);
 #else
   ShimCppDelete(p);
@@ -207,13 +207,13 @@
 SHIM_CPP_SYMBOLS_EXPORT void operator delete[](void* p,
                                                std::align_val_t,
                                                const std::nothrow_t&) __THROW {
-#if BUILDFLAG(FORWARD_THROUGH_MALLOC)
+#if PA_BUILDFLAG(FORWARD_THROUGH_MALLOC)
   free(p);
 #else
   ShimCppDelete(p);
 #endif
 }
 
-#endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
+#endif  // PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 
 #endif  // PARTITION_ALLOC_SHIM_ALLOCATOR_SHIM_OVERRIDE_CPP_SYMBOLS_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_glibc_weak_symbols.h b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_glibc_weak_symbols.h
index 1089c1773..a060117 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_glibc_weak_symbols.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_glibc_weak_symbols.h
@@ -22,7 +22,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_ALLOCATOR_SHIM)
+#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 #include <features.h>  // for __GLIBC__
 #include <malloc.h>
 #include <unistd.h>
@@ -123,6 +123,6 @@
 shim by setting use_allocator_shim=false in GN args.
 #endif
 
-#endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
+#endif  // PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 
 #endif  // PARTITION_ALLOC_SHIM_ALLOCATOR_SHIM_OVERRIDE_GLIBC_WEAK_SYMBOLS_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_libc_symbols.h b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_libc_symbols.h
index d60cfa9..010f0c2 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_libc_symbols.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_libc_symbols.h
@@ -14,7 +14,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_ALLOCATOR_SHIM)
+#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 #include "partition_alloc/build_config.h"
 
 #if BUILDFLAG(IS_APPLE)
@@ -92,6 +92,6 @@
 
 }  // extern "C"
 
-#endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
+#endif  // PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 
 #endif  // PARTITION_ALLOC_SHIM_ALLOCATOR_SHIM_OVERRIDE_LIBC_SYMBOLS_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_linker_wrapped_symbols.h b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_linker_wrapped_symbols.h
index 0d4ecd2..3157d53b 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_linker_wrapped_symbols.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_linker_wrapped_symbols.h
@@ -17,7 +17,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_ALLOCATOR_SHIM)
+#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 #include <algorithm>
 #include <cstring>
 
@@ -178,6 +178,6 @@
 
 }  // extern "C"
 
-#endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
+#endif  // PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 
 #endif  // PARTITION_ALLOC_SHIM_ALLOCATOR_SHIM_OVERRIDE_LINKER_WRAPPED_SYMBOLS_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_ucrt_symbols_win.h b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_ucrt_symbols_win.h
index 782a6f7..e46d9af 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_ucrt_symbols_win.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_override_ucrt_symbols_win.h
@@ -14,7 +14,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_ALLOCATOR_SHIM)
+#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 #include "partition_alloc/partition_alloc_base/component_export.h"
 #include "partition_alloc/partition_alloc_check.h"
 #include "partition_alloc/shim/allocator_shim_internals.h"
@@ -261,6 +261,6 @@
 #endif
 
 }  // extern "C"
-#endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
+#endif  // PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 
 #endif  // PARTITION_ALLOC_SHIM_ALLOCATOR_SHIM_OVERRIDE_UCRT_SYMBOLS_WIN_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_unittest.cc
index 57dd77e..b937ca3 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_unittest.cc
@@ -423,7 +423,7 @@
 
 // See allocator_shim_override_glibc_weak_symbols.h for why we intercept
 // internal libc symbols.
-#if defined(LIBC_GLIBC) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if defined(LIBC_GLIBC) && PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
   void* libc_memalign_ptr = __libc_memalign(512, 56);
   ASSERT_NE(nullptr, memalign_ptr);
   ASSERT_EQ(0u, reinterpret_cast<uintptr_t>(libc_memalign_ptr) % 512);
@@ -467,7 +467,7 @@
 
 #endif  // !BUILDFLAG(IS_WIN)
 
-#if defined(LIBC_GLIBC) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if defined(LIBC_GLIBC) && PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
   free(libc_memalign_ptr);
   ASSERT_GE(frees_intercepted_by_addr[Hash(memalign_ptr)], 1u);
 #endif
@@ -587,7 +587,7 @@
 
 // PartitionAlloc disallows large allocations to avoid errors with int
 // overflows.
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 struct TooLarge {
   char padding1[1UL << 31];
   int padding2;
@@ -742,7 +742,7 @@
   RemoveAllocatorDispatchForTesting(&g_mock_dispatch);
 }
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 // Non-regression test for crbug.com/1166558.
 TEST_F(AllocatorShimTest, InterceptVasprintf) {
   // Printing a float which expands to >=30 characters calls vasprintf() in
@@ -775,11 +775,11 @@
   free(str);
 }
 
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 #endif  // BUILDFLAG(IS_ANDROID)
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(IS_APPLE)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(IS_APPLE)
 
 // Non-regression test for crbug.com/1291885.
 TEST_F(AllocatorShimTest, BatchMalloc) {
@@ -798,7 +798,7 @@
   EXPECT_GE(good_size, kTestSize);
 }
 
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(IS_APPLE)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(IS_APPLE)
 
 TEST_F(AllocatorShimTest, OptimizeAllocatorDispatchTable) {
   const AllocatorDispatch* prev = GetAllocatorDispatchChainHeadForTesting();
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_win_static.cc b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_win_static.cc
index 1775084..b62a860 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_win_static.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_win_static.cc
@@ -9,7 +9,7 @@
 #include "partition_alloc/shim/allocator_shim.h"
 #include "partition_alloc/shim/checked_multiply_win.h"
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 #include "partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h"
 #endif
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/malloc_zone_functions_apple.h b/base/allocator/partition_allocator/src/partition_alloc/shim/malloc_zone_functions_apple.h
index 7d32024..6180662 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/malloc_zone_functions_apple.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/malloc_zone_functions_apple.h
@@ -7,7 +7,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_ALLOCATOR_SHIM)
+#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 #include <malloc/malloc.h>
 
 #include <cstddef>
@@ -114,6 +114,6 @@
 
 }  // namespace allocator_shim
 
-#endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
+#endif  // PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 
 #endif  // PARTITION_ALLOC_SHIM_MALLOC_ZONE_FUNCTIONS_APPLE_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/nonscannable_allocator.cc b/base/allocator/partition_allocator/src/partition_alloc/shim/nonscannable_allocator.cc
index 86bc0ae1..a2b96a43 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/nonscannable_allocator.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/nonscannable_allocator.cc
@@ -6,18 +6,18 @@
 
 #include "partition_alloc/partition_root.h"
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 #include "partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h"
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 #include "partition_alloc/internal_allocator.h"
 #include "partition_alloc/starscan/pcscan.h"
 #endif
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 namespace allocator_shim::internal {
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 template <bool quarantinable>
 NonScannableAllocatorImpl<quarantinable>::NonScannableAllocatorImpl() = default;
 template <bool quarantinable>
@@ -35,14 +35,14 @@
 
 template <bool quarantinable>
 void* NonScannableAllocatorImpl<quarantinable>::Alloc(size_t size) {
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
   // TODO(bikineev): Change to LIKELY once PCScan is enabled by default.
   if (PA_UNLIKELY(pcscan_enabled_.load(std::memory_order_acquire))) {
     PA_DCHECK(allocator_.get());
     return allocator_->root()
         ->AllocInline<partition_alloc::AllocFlags::kNoHooks>(size);
   }
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
   // Otherwise, dispatch to default partition.
   return allocator_shim::internal::PartitionAllocMalloc::Allocator()
       ->AllocInline<partition_alloc::AllocFlags::kNoHooks>(size);
@@ -50,19 +50,19 @@
 
 template <bool quarantinable>
 void NonScannableAllocatorImpl<quarantinable>::Free(void* ptr) {
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
   if (PA_UNLIKELY(pcscan_enabled_.load(std::memory_order_acquire))) {
     allocator_->root()->FreeInline<partition_alloc::FreeFlags::kNoHooks>(ptr);
     return;
   }
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
   partition_alloc::PartitionRoot::FreeInlineInUnknownRoot<
       partition_alloc::FreeFlags::kNoHooks>(ptr);
 }
 
 template <bool quarantinable>
 void NonScannableAllocatorImpl<quarantinable>::NotifyPCScanEnabled() {
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
   partition_alloc::PartitionOptions opts;
   opts.star_scan_quarantine =
       quarantinable ? partition_alloc::PartitionOptions::kAllowed
@@ -75,7 +75,7 @@
         allocator_->root());
   }
   pcscan_enabled_.store(true, std::memory_order_release);
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 }
 
 template class PA_EXPORT_TEMPLATE_DEFINE(PA_COMPONENT_EXPORT(ALLOCATOR_SHIM))
@@ -83,6 +83,6 @@
 template class PA_EXPORT_TEMPLATE_DEFINE(PA_COMPONENT_EXPORT(ALLOCATOR_SHIM))
     NonScannableAllocatorImpl<false>;
 
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 }  // namespace allocator_shim::internal
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/nonscannable_allocator.h b/base/allocator/partition_allocator/src/partition_alloc/shim/nonscannable_allocator.h
index bb210e3..b976a7f 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/nonscannable_allocator.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/nonscannable_allocator.h
@@ -14,17 +14,17 @@
 #include "partition_alloc/partition_alloc_base/no_destructor.h"
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 #include "partition_alloc/partition_alloc.h"
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 #include "partition_alloc/internal_allocator_forward.h"
 #endif
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 namespace allocator_shim {
 
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 namespace internal {
 
 // Represents allocator that contains memory for data-like objects (that don't
@@ -46,14 +46,14 @@
   // Returns PartitionRoot corresponding to the allocator, or nullptr if the
   // allocator is not enabled.
   partition_alloc::PartitionRoot* root() {
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
     if (!allocator_.get()) {
       return nullptr;
     }
     return allocator_->root();
 #else
     return nullptr;
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
   }
 
   void NotifyPCScanEnabled();
@@ -65,12 +65,12 @@
   NonScannableAllocatorImpl();
   ~NonScannableAllocatorImpl();
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
   std::unique_ptr<partition_alloc::PartitionAllocator,
                   partition_alloc::internal::InternalPartitionDeleter>
       allocator_;
   std::atomic_bool pcscan_enabled_{false};
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 };
 
 extern template class PA_EXPORT_TEMPLATE_DECLARE(
@@ -83,7 +83,7 @@
 using NonScannableAllocator = internal::NonScannableAllocatorImpl<true>;
 using NonQuarantinableAllocator = internal::NonScannableAllocatorImpl<false>;
 
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
 
 }  // namespace allocator_shim
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/winheap_stubs_win.cc b/base/allocator/partition_allocator/src/partition_alloc/shim/winheap_stubs_win.cc
index 3318cf9..931ec65f 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/winheap_stubs_win.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/winheap_stubs_win.cc
@@ -104,12 +104,12 @@
   static_assert(
       kMaxWindowsAllocation < std::numeric_limits<unsigned int>::max(),
       "original_allocation_offset must be able to fit into an unsigned int");
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   // Magic value used to check that _aligned_free() and _aligned_realloc() are
   // only ever called on an aligned allocated chunk.
   static constexpr unsigned int kMagic = 0x12003400;
   unsigned int magic;
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 };
 
 // Compute how large an allocation we need to fit an allocation with the given
@@ -134,18 +134,18 @@
   prefix->original_allocation_offset =
       partition_alloc::internal::base::checked_cast<unsigned int>(
           address - reinterpret_cast<uintptr_t>(ptr));
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   prefix->magic = AlignedPrefix::kMagic;
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
   return reinterpret_cast<void*>(address);
 }
 
 // Return the original allocation from an aligned allocation.
 void* UnalignAllocation(void* ptr) {
   AlignedPrefix* prefix = reinterpret_cast<AlignedPrefix*>(ptr) - 1;
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   PA_DCHECK(prefix->magic == AlignedPrefix::kMagic);
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
   void* unaligned =
       static_cast<uint8_t*>(ptr) - prefix->original_allocation_offset;
   PA_CHECK(unaligned < ptr);
diff --git a/base/allocator/partition_allocator/src/partition_alloc/shim/winheap_stubs_win.h b/base/allocator/partition_allocator/src/partition_alloc/shim/winheap_stubs_win.h
index 65e1766..be8fd29 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/shim/winheap_stubs_win.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/shim/winheap_stubs_win.h
@@ -13,7 +13,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(USE_ALLOCATOR_SHIM)
+#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 #include "partition_alloc/partition_alloc_base/component_export.h"
 
 namespace allocator_shim {
@@ -47,6 +47,6 @@
 
 }  // namespace allocator_shim
 
-#endif  // BUILDFLAG(USE_ALLOCATOR_SHIM)
+#endif  // PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
 
 #endif  // PARTITION_ALLOC_SHIM_WINHEAP_STUBS_WIN_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/stack/stack.cc b/base/allocator/partition_allocator/src/partition_alloc/stack/stack.cc
index 3c4086b..1f3ce3f 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/stack/stack.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/stack/stack.cc
@@ -136,12 +136,12 @@
 }  // namespace
 
 void Stack::IteratePointers(StackVisitor* visitor) const {
-#if BUILDFLAG(STACK_SCAN_SUPPORTED)
+#if PA_BUILDFLAG(STACK_SCAN_SUPPORTED)
   PAPushAllRegistersAndIterateStack(this, visitor, &IteratePointersImpl);
   // No need to deal with callee-saved registers as they will be kept alive by
   // the regular conservative stack iteration.
   IterateSafeStackIfNecessary(visitor);
-#endif  // BUILDFLAG(STACK_SCAN_SUPPORTED)
+#endif  // PA_BUILDFLAG(STACK_SCAN_SUPPORTED)
 }
 
 StackTopRegistry::StackTopRegistry() = default;
diff --git a/base/allocator/partition_allocator/src/partition_alloc/starscan/pcscan_internal.cc b/base/allocator/partition_allocator/src/partition_alloc/starscan/pcscan_internal.cc
index 3bb2948..3c31ec1 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/starscan/pcscan_internal.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/starscan/pcscan_internal.cc
@@ -621,7 +621,7 @@
   PA_SCAN_DCHECK(IsManagedByPartitionAllocRegularPool(maybe_ptr));
   // First, check if |maybe_ptr| points to a valid super page or a quarantined
   // card.
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 #if PA_CONFIG(STARSCAN_USE_CARD_TABLE)
   // Check if |maybe_ptr| points to a quarantined card.
   if (PA_LIKELY(
@@ -642,11 +642,11 @@
     return nullptr;
   }
 #endif  // PA_CONFIG(STARSCAN_USE_CARD_TABLE)
-#else   // BUILDFLAG(HAS_64_BIT_POINTERS)
+#else   // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   if (PA_LIKELY(!IsManagedByPartitionAllocRegularPool(maybe_ptr))) {
     return nullptr;
   }
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
   // We are certain here that |maybe_ptr| points to an allocated super-page.
   return StateBitmapFromAddr(maybe_ptr);
@@ -785,14 +785,14 @@
   size_t quarantine_size() const { return quarantine_size_; }
 
  private:
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   PA_ALWAYS_INLINE static uintptr_t RegularPoolBase() {
     return PartitionAddressSpace::RegularPoolBase();
   }
   PA_ALWAYS_INLINE static uintptr_t RegularPoolMask() {
     return PartitionAddressSpace::RegularPoolBaseMask();
   }
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
   PA_SCAN_INLINE void CheckPointer(uintptr_t maybe_ptr_maybe_tagged) {
     // |maybe_ptr| may have an MTE tag, so remove it first.
@@ -1296,7 +1296,7 @@
 
 void PCScanInternal::Initialize(PCScan::InitConfig config) {
   PA_DCHECK(!is_initialized_);
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   // Make sure that pools are initialized.
   PartitionAddressSpace::Init();
 #endif
diff --git a/base/allocator/partition_allocator/src/partition_alloc/starscan/pcscan_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/starscan/pcscan_unittest.cc
index b22f6505..e2d37e1 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/starscan/pcscan_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/starscan/pcscan_unittest.cc
@@ -24,7 +24,7 @@
 #include "partition_alloc/use_death_tests.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if BUILDFLAG(USE_STARSCAN)
+#if PA_BUILDFLAG(USE_STARSCAN)
 
 namespace partition_alloc::internal {
 
@@ -786,7 +786,7 @@
   TestDanglingReference(*this, source, value, root());
 }
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 TEST_F(PartitionAllocPCScanWithMTETest, QuarantineOnlyOnTagOverflow) {
   using ListType = List<64>;
 
@@ -828,11 +828,11 @@
 
   EXPECT_FALSE(true && "Should never be reached");
 }
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
 }  // namespace
 
 }  // namespace partition_alloc::internal
 
-#endif  // BUILDFLAG(USE_STARSCAN)
+#endif  // PA_BUILDFLAG(USE_STARSCAN)
 #endif  // defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/starscan/scan_loop.h b/base/allocator/partition_allocator/src/partition_alloc/starscan/scan_loop.h
index 619218d..c3a6252f 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/starscan/scan_loop.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/starscan/scan_loop.h
@@ -97,12 +97,12 @@
 void ScanLoop<Derived>::RunUnvectorized(uintptr_t begin, uintptr_t end) {
   PA_SCAN_DCHECK(!(begin % sizeof(uintptr_t)));
   PA_SCAN_DCHECK(!(end % sizeof(uintptr_t)));
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   // If the read value is a pointer into the PA region, it's likely
   // MTE-tagged. Piggyback on |mask| to untag, for efficiency.
   const uintptr_t mask = Derived::RegularPoolMask() & kPtrUntagMask;
   const uintptr_t base = Derived::RegularPoolBase();
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   for (; begin < end; begin += sizeof(uintptr_t)) {
     // Read the region word-by-word. Everything that we read is a potential
     // pointer to or inside an object on heap. Such an object should be
@@ -110,7 +110,7 @@
     //
     // Keep it MTE-untagged. See DisableMTEScope for details.
     const uintptr_t maybe_ptr = *reinterpret_cast<uintptr_t*>(begin);
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
     if (PA_LIKELY((maybe_ptr & mask) != base)) {
       continue;
     }
@@ -118,7 +118,7 @@
     if (!maybe_ptr) {
       continue;
     }
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
     derived().CheckPointer(maybe_ptr);
   }
 }
diff --git a/base/allocator/partition_allocator/src/partition_alloc/starscan/scan_loop_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/starscan/scan_loop_unittest.cc
index 5c3aedff..6d7aa81 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/starscan/scan_loop_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/starscan/scan_loop_unittest.cc
@@ -12,7 +12,7 @@
 #include "partition_alloc/partition_alloc_config.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 namespace partition_alloc::internal {
 
@@ -172,4 +172,4 @@
 
 }  // namespace partition_alloc::internal
 
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/tagging.cc b/base/allocator/partition_allocator/src/partition_alloc/tagging.cc
index 46b4767..2cfcab49 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/tagging.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/tagging.cc
@@ -14,7 +14,7 @@
 #include "partition_alloc/partition_alloc_check.h"
 #include "partition_alloc/partition_alloc_config.h"
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 #include <arm_acle.h>
 #include <asm/hwcap.h>
 #include <sys/auxv.h>
@@ -48,7 +48,7 @@
 #if BUILDFLAG(IS_ANDROID)
 #include "partition_alloc/partition_alloc_base/files/file_path.h"
 #include "partition_alloc/partition_alloc_base/native_library.h"
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 #include <malloc.h>
 #endif  // BUILDFLAGS(HAS_MEMORY_TAGGING)
 #endif  // BUILDFLAG(IS_ANDROID)
@@ -56,7 +56,7 @@
 namespace partition_alloc {
 void ChangeMemoryTaggingModeForCurrentThreadNoOp(TagViolationReportingMode m) {}
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 using ChangeMemoryTaggingModeForCurrentThreadInternalFn =
     void(TagViolationReportingMode);
 
@@ -85,10 +85,10 @@
              ? &ChangeMemoryTaggingModeForCurrentThreadForMte
              : &ChangeMemoryTaggingModeForCurrentThreadNoOp;
 }
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
 void ChangeMemoryTaggingModeForCurrentThread(TagViolationReportingMode m)
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
     __attribute__((ifunc("ResolveChangeMemoryTaggingModeForCurrentThread")));
 #else
 {
@@ -101,7 +101,7 @@
 #if BUILDFLAG(IS_ANDROID)
 bool ChangeMemoryTaggingModeForAllThreadsPerProcess(
     TagViolationReportingMode m) {
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   // In order to support Android NDK API level below 26, we need to call
   // mallopt via dynamic linker.
   // int mallopt(int param, int value);
@@ -134,7 +134,7 @@
   return status != 0;
 #else
   return false;
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 }
 #endif  // BUILDFLAG(IS_ANDROID)
 
@@ -147,7 +147,7 @@
   return ret;
 }
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 void* TagRegionRandomlyForMTE(void* ptr, size_t sz, uint64_t mask) {
   // Randomly tag a region (MTE-enabled systems only). The first 16-byte
   // granule is randomly tagged, all other granules in the region are
@@ -204,11 +204,11 @@
 void* RemaskVoidPtrNoOp(void* ptr) {
   return ptr;
 }
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
 }  // namespace
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 using RemaskPtrInternalFn = void*(void* ptr);
 using TagMemoryRangeIncrementInternalFn = void*(void* ptr, size_t size);
 using TagMemoryRangeRandomlyInternalFn = void*(void* ptr,
@@ -247,13 +247,13 @@
     __attribute__((ifunc("ResolveTagMemoryRandomly")));
 void* RemaskPointerInternal(void* ptr)
     __attribute__((ifunc("ResolveRemaskPointer")));
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
 TagViolationReportingMode GetMemoryTaggingModeForCurrentThreadNoMte() {
   return TagViolationReportingMode::kUndefined;
 }
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 using GetMemoryTaggingModeForCurrentThreadInternalFn =
     TagViolationReportingMode();
 
@@ -277,10 +277,10 @@
   return IsMteEnabled(hwcap, hw) ? &GetMemoryTaggingModeForCurrentThreadMte
                                  : &GetMemoryTaggingModeForCurrentThreadNoMte;
 }
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
 TagViolationReportingMode GetMemoryTaggingModeForCurrentThread()
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
     __attribute__((ifunc("ResolveGetMemoryTaggingModeForCurrentThread")));
 #else
 {
@@ -290,7 +290,7 @@
 
 }  // namespace internal
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING) && BUILDFLAG(IS_ANDROID)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING) && BUILDFLAG(IS_ANDROID)
 bool PermissiveMte::enabled_ = false;
 
 // static
@@ -314,6 +314,6 @@
   }
   return false;
 }
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING) && BUILDFLAG(IS_ANDROID)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING) && BUILDFLAG(IS_ANDROID)
 
 }  // namespace partition_alloc
diff --git a/base/allocator/partition_allocator/src/partition_alloc/tagging.h b/base/allocator/partition_allocator/src/partition_alloc/tagging.h
index d01419a..de2fc78 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/tagging.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/tagging.h
@@ -17,7 +17,7 @@
 #include "partition_alloc/partition_alloc_buildflags.h"
 #include "partition_alloc/partition_alloc_config.h"
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING) && BUILDFLAG(IS_ANDROID)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING) && BUILDFLAG(IS_ANDROID)
 #include <csignal>
 #endif
 
@@ -43,11 +43,11 @@
 namespace internal {
 
 constexpr uint64_t kMemTagGranuleSize = 16u;
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 constexpr uint64_t kPtrTagMask = 0xff00000000000000uLL;
 #else
 constexpr uint64_t kPtrTagMask = 0;
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 constexpr uint64_t kPtrUntagMask = ~kPtrTagMask;
 
 #if BUILDFLAG(IS_ANDROID)
@@ -66,24 +66,24 @@
 
 // These forward-defined functions do not really exist in tagging.cc, they're
 // resolved by the dynamic linker to MTE-capable versions on the right hardware.
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 PA_COMPONENT_EXPORT(PARTITION_ALLOC)
 void* TagMemoryRangeIncrementInternal(void* ptr, size_t size);
 PA_COMPONENT_EXPORT(PARTITION_ALLOC)
 void* TagMemoryRangeRandomlyInternal(void* ptr, size_t size, uint64_t mask);
 PA_COMPONENT_EXPORT(PARTITION_ALLOC)
 void* RemaskPointerInternal(void* ptr);
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
 // Increments the tag of the memory range ptr. Useful for provable revocations
 // (e.g. free). Returns the pointer with the new tag. Ensures that the entire
 // range is set to the same tag.
 PA_ALWAYS_INLINE void* TagMemoryRangeIncrement(void* ptr, size_t size) {
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   return TagMemoryRangeIncrementInternal(ptr, size);
 #else
   return ptr;
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 }
 
 PA_ALWAYS_INLINE void* TagMemoryRangeIncrement(uintptr_t address, size_t size) {
@@ -97,22 +97,22 @@
                                               size_t size,
                                               uint64_t mask = 0u) {
   void* ptr = reinterpret_cast<void*>(address);
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   return reinterpret_cast<void*>(
       TagMemoryRangeRandomlyInternal(ptr, size, mask));
 #else
   return ptr;
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 }
 
 // Gets a version of ptr that's safe to dereference.
 template <typename T>
 PA_ALWAYS_INLINE T* TagPtr(T* ptr) {
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   return reinterpret_cast<T*>(RemaskPointerInternal(ptr));
 #else
   return ptr;
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 }
 
 // Gets a version of |address| that's safe to dereference, and casts to a
@@ -123,11 +123,11 @@
 
 // Strips the tag bits off |address|.
 PA_ALWAYS_INLINE uintptr_t UntagAddr(uintptr_t address) {
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
   return address & internal::kPtrUntagMask;
 #else
   return address;
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 }
 
 }  // namespace internal
@@ -138,7 +138,7 @@
   return internal::UntagAddr(reinterpret_cast<uintptr_t>(ptr));
 }
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING) && BUILDFLAG(IS_ANDROID)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING) && BUILDFLAG(IS_ANDROID)
 class PA_COMPONENT_EXPORT(PARTITION_ALLOC) PermissiveMte {
  public:
   static void SetEnabled(bool enabled);
@@ -147,7 +147,7 @@
  private:
   static bool enabled_;
 };
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
 }  // namespace partition_alloc
 
diff --git a/base/allocator/partition_allocator/src/partition_alloc/tagging_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/tagging_unittest.cc
index fed08ccb..63295ad 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/tagging_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/tagging_unittest.cc
@@ -145,7 +145,7 @@
 }
 #endif  // defined(ARCH_CPU_64_BITS)
 
-#if BUILDFLAG(HAS_MEMORY_TAGGING)
+#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 #if BUILDFLAG(IS_ANDROID)
 TEST(PartitionAllocMemoryTaggingTest,
      ChangeMemoryTaggingModeForAllThreadsPerProcess) {
@@ -214,6 +214,6 @@
   // Restore mode to original.
   ChangeMemoryTaggingModeForCurrentThread(original_mode);
 }
-#endif  // BUILDFLAG(HAS_MEMORY_TAGGING)
+#endif  // PA_BUILDFLAG(HAS_MEMORY_TAGGING)
 
 }  // namespace partition_alloc::internal
diff --git a/base/allocator/partition_allocator/src/partition_alloc/thread_cache.cc b/base/allocator/partition_allocator/src/partition_alloc/thread_cache.cc
index c99e448..cd16aac 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/thread_cache.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/thread_cache.cc
@@ -33,7 +33,7 @@
 namespace tools {
 uintptr_t kThreadCacheNeedleArray[kThreadCacheNeedleArraySize] = {
     kNeedle1, reinterpret_cast<uintptr_t>(&g_instance),
-#if BUILDFLAG(RECORD_ALLOC_INFO)
+#if PA_BUILDFLAG(RECORD_ALLOC_INFO)
     reinterpret_cast<uintptr_t>(&internal::g_allocs),
 #else
     0,
@@ -179,7 +179,7 @@
   internal::ScopedGuard scoped_locker(GetLock());
   ThreadCache* tcache = list_head_;
   while (tcache) {
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
     // Before fork(), locks are acquired in the parent process. This means that
     // a concurrent allocation in the parent which must be filled by the central
     // allocator (i.e. the thread cache bucket is empty) will block inside the
@@ -704,17 +704,17 @@
     auto* head = bucket.freelist_head;
     size_t items = 1;  // Cannot free the freelist head.
     while (items < limit) {
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
       head = freelist_dispatcher->GetNextForThreadCacheBool(
           head, crash_on_corruption, bucket.slot_size);
 #else
       head = freelist_dispatcher->GetNextForThreadCache<crash_on_corruption>(
           head, bucket.slot_size);
-#endif  // BUILDFLAG(USE_FREELIST_DISPATCHER)
+#endif  // PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
       items++;
     }
 
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
     FreeAfter<crash_on_corruption>(
         freelist_dispatcher->GetNextForThreadCacheBool(
             head, crash_on_corruption, bucket.slot_size),
@@ -724,7 +724,7 @@
         freelist_dispatcher->GetNextForThreadCache<crash_on_corruption>(
             head, bucket.slot_size),
         bucket.slot_size);
-#endif  // BUILDFLAG(USE_FREELIST_DISPATCHER)
+#endif  // PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
     freelist_dispatcher->SetNext(head, nullptr);
   }
   bucket.count = limit;
@@ -747,13 +747,13 @@
     uintptr_t slot_start = internal::SlotStartPtr2Addr(head);
     const internal::PartitionFreelistDispatcher* freelist_dispatcher =
         root_->get_freelist_dispatcher();
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
     head = freelist_dispatcher->GetNextForThreadCacheBool(
         head, crash_on_corruption, slot_size);
 #else
     head = freelist_dispatcher->GetNextForThreadCache<crash_on_corruption>(
         head, slot_size);
-#endif  // BUILDFLAG(USE_FREELIST_DISPATCHER)
+#endif  // PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
     root_->RawFreeLocked(slot_start);
   }
 }
diff --git a/base/allocator/partition_allocator/src/partition_alloc/thread_cache.h b/base/allocator/partition_allocator/src/partition_alloc/thread_cache.h
index 161f806..19baa13a 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/thread_cache.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/thread_cache.h
@@ -28,7 +28,7 @@
 #include "partition_alloc/partition_stats.h"
 #include "partition_alloc/partition_tls.h"
 
-#if defined(ARCH_CPU_X86_64) && BUILDFLAG(HAS_64_BIT_POINTERS)
+#if defined(ARCH_CPU_X86_64) && PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 #include <algorithm>
 #endif
 
@@ -44,13 +44,13 @@
 //
 // These two values were chosen randomly, and in particular neither is a valid
 // pointer on most 64 bit architectures.
-#if BUILDFLAG(HAS_64_BIT_POINTERS)
+#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 constexpr uintptr_t kNeedle1 = 0xe69e32f3ad9ea63;
 constexpr uintptr_t kNeedle2 = 0x9615ee1c5eb14caf;
 #else
 constexpr uintptr_t kNeedle1 = 0xe69e32f3;
 constexpr uintptr_t kNeedle2 = 0x9615ee1c;
-#endif  // BUILDFLAG(HAS_64_BIT_POINTERS)
+#endif  // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
 // This array contains, in order:
 // - kNeedle1
@@ -200,7 +200,7 @@
   } while (0)
 #endif  // PA_CONFIG(THREAD_CACHE_ENABLE_STATISTICS)
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 namespace internal {
 
@@ -224,13 +224,13 @@
     x                               \
   }
 
-#else  // BUILDFLAG(PA_DCHECK_IS_ON)
+#else  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 #define PA_REENTRANCY_GUARD(x) \
   do {                         \
   } while (0)
 
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 // Per-thread cache. *Not* threadsafe, must only be accessed from a single
 // thread.
@@ -469,7 +469,7 @@
   PartitionRoot* const root_;
 
   const internal::base::PlatformThreadId thread_id_;
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   bool is_in_thread_cache_ = false;
 #endif
 
@@ -559,7 +559,7 @@
   internal::PartitionFreelistEntry* entry = bucket.freelist_head;
   // TODO(lizeb): Consider removing once crbug.com/1382658 is fixed.
 #if BUILDFLAG(IS_CHROMEOS) && defined(ARCH_CPU_X86_64) && \
-    BUILDFLAG(HAS_64_BIT_POINTERS)
+    PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   // x86_64 architecture now supports 57 bits of address space, as of Ice Lake
   // for Intel. However Chrome OS systems do not ship with kernel support for
   // it, but with 48 bits, so all canonical addresses have the upper 16 bits
@@ -568,7 +568,7 @@
   constexpr uintptr_t kCanonicalPointerMask = (1ULL << 48) - 1;
   PA_CHECK(!(reinterpret_cast<uintptr_t>(entry) & ~kCanonicalPointerMask));
 #endif  // BUILDFLAG(IS_CHROMEOS) && defined(ARCH_CPU_X86_64) &&
-        // BUILDFLAG(HAS_64_BIT_POINTERS)
+        // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
   // Passes the bucket size to |GetNext()|, so that in case of freelist
   // corruption, we know the bucket size that lead to the crash, helping to
@@ -576,13 +576,13 @@
   // does not introduce another cache miss.
   const internal::PartitionFreelistDispatcher* freelist_dispatcher =
       get_freelist_dispatcher_from_root();
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
   internal::PartitionFreelistEntry* next =
       freelist_dispatcher->GetNextForThreadCacheTrue(entry, bucket.slot_size);
 #else
   internal::PartitionFreelistEntry* next =
       freelist_dispatcher->GetNextForThreadCache<true>(entry, bucket.slot_size);
-#endif  // BUILDFLAG(USE_FREELIST_DISPATCHER)
+#endif  // PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
 
   PA_DCHECK(entry != next);
   bucket.count--;
@@ -599,7 +599,7 @@
 PA_ALWAYS_INLINE void ThreadCache::PutInBucket(Bucket& bucket,
                                                uintptr_t slot_start) {
 #if PA_CONFIG(HAS_FREELIST_SHADOW_ENTRY) && defined(ARCH_CPU_X86_64) && \
-    BUILDFLAG(HAS_64_BIT_POINTERS)
+    PA_BUILDFLAG(HAS_64_BIT_POINTERS)
   // We see freelist corruption crashes happening in the wild.  These are likely
   // due to out-of-bounds accesses in the previous slot, or to a Use-After-Free
   // somewhere in the code.
@@ -646,7 +646,7 @@
     address_aligned += 4;
   }
 #endif  // PA_CONFIG(HAS_FREELIST_SHADOW_ENTRY) && defined(ARCH_CPU_X86_64) &&
-        // BUILDFLAG(HAS_64_BIT_POINTERS)
+        // PA_BUILDFLAG(HAS_64_BIT_POINTERS)
 
   auto* entry =
       get_freelist_dispatcher_from_root()->EmplaceAndInitForThreadCache(
diff --git a/base/allocator/partition_allocator/src/partition_alloc/thread_cache_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/thread_cache_unittest.cc
index 9b83405..9c68364 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/thread_cache_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/thread_cache_unittest.cc
@@ -88,7 +88,7 @@
   PartitionOptions opts;
 #if !BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
   opts.thread_cache = PartitionOptions::kEnabled;
-#endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
   opts.star_scan_quarantine = PartitionOptions::kAllowed;
   opts.use_pool_offset_freelists =
       (encoding == internal::PartitionFreelistEncoding::kPoolOffsetFreeList)
@@ -539,7 +539,7 @@
 
 #if !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) ||   \
       BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)) && \
-    BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+    PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
   // iOS and MacOS 15 create worker threads internally(start_wqthread).
   // So thread caches are created for the worker threads, because the threads
   // allocate memory for initialization (_dispatch_calloc is invoked).
@@ -567,7 +567,7 @@
 
 #if !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) ||   \
       BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)) && \
-    BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+    PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
   internal::ScopedGuard lock(ThreadCacheRegistry::GetLock());
   EXPECT_EQ(parent_thread_tcache->prev_for_testing(), nullptr);
   EXPECT_EQ(parent_thread_tcache->next_for_testing(), nullptr);
@@ -676,7 +676,7 @@
   ThreadCacheStats wqthread_stats{0};
 #if (BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) || \
      BUILDFLAG(IS_LINUX)) &&                                                   \
-    BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+    PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
   {
     // iOS and MacOS 15 create worker threads internally(start_wqthread).
     // So thread caches are created for the worker threads, because the threads
@@ -1202,13 +1202,13 @@
     uint8_t count = 0;
     auto* head = tcache->bucket_for_testing(index).freelist_head;
     while (head) {
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
       head = freelist_dispatcher->GetNextForThreadCacheTrue(
           head, tcache->bucket_for_testing(index).slot_size);
 #else
       head = freelist_dispatcher->GetNextForThreadCache<true>(
           head, tcache->bucket_for_testing(index).slot_size);
-#endif  // BUILDFLAG(USE_FREELIST_DISPATCHER)
+#endif  // PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
       count++;
     }
     return count;
@@ -1313,11 +1313,11 @@
   auto* curr = medium_bucket->active_slot_spans_head->get_freelist_head();
   const internal::PartitionFreelistDispatcher* freelist_dispatcher =
       root()->get_freelist_dispatcher();
-#if BUILDFLAG(USE_FREELIST_DISPATCHER)
+#if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
   curr = freelist_dispatcher->GetNextForThreadCacheTrue(curr, kMediumSize);
 #else
   curr = freelist_dispatcher->GetNextForThreadCache<true>(curr, kMediumSize);
-#endif  // BUILDFLAG(USE_FREELIST_DISPATCHER)
+#endif  // PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
   freelist_dispatcher->CorruptNextForTesting(curr, 0x12345678);
   tcache->TryPurge();
   freelist_dispatcher->SetNext(curr, nullptr);
diff --git a/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/alignment.h b/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/alignment.h
index aa7f23e..9472261 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/alignment.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/alignment.h
@@ -7,7 +7,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 
 #include "partition_alloc/page_allocator_constants.h"
 
@@ -32,13 +32,13 @@
 #define PA_THREAD_ISOLATED_ARRAY_PAD_SZ(Type, count) \
   PA_THREAD_ISOLATED_ARRAY_PAD_SZ_WITH_OFFSET(Type, count, 0)
 
-#else  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#else  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 
 #define PA_THREAD_ISOLATED_ALIGN
 #define PA_THREAD_ISOLATED_FILL_PAGE_SZ(size) 0
 #define PA_THREAD_ISOLATED_ARRAY_PAD_SZ(Type, size) 0
 #define PA_THREAD_ISOLATED_ARRAY_PAD_SZ_WITH_OFFSET(Type, size, offset) 0
 
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 
 #endif  // PARTITION_ALLOC_THREAD_ISOLATION_ALIGNMENT_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey.cc b/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey.cc
index f8b1f798..bba9d1a 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey.cc
@@ -4,7 +4,7 @@
 
 #include "partition_alloc/thread_isolation/pkey.h"
 
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
 
 #include <sys/mman.h>
 #include <sys/syscall.h>
@@ -61,7 +61,7 @@
   asm volatile(".byte 0x0f,0x01,0xef\n" : : "a"(pkru), "c"(0), "d"(0));
 }
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 LiftPkeyRestrictionsScope::LiftPkeyRestrictionsScope()
     : saved_pkey_value_(kDefaultPkeyValue) {
@@ -83,8 +83,8 @@
   }
 }
 
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 }  // namespace partition_alloc::internal
 
-#endif  // BUILDFLAG(ENABLE_PKEYS)
+#endif  // PA_BUILDFLAG(ENABLE_PKEYS)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey.h b/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey.h
index 8edb4ed..b4a7595 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey.h
@@ -7,7 +7,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
 
 #include "partition_alloc/partition_alloc_base/component_export.h"
 #include "partition_alloc/partition_alloc_base/debug/debugging_buildflags.h"
@@ -39,7 +39,7 @@
 // Write the pkru register (the current pkey state).
 void Wrpkru(uint32_t pkru);
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 class PA_COMPONENT_EXPORT(PARTITION_ALLOC) LiftPkeyRestrictionsScope {
  public:
@@ -53,10 +53,10 @@
   uint32_t saved_pkey_value_;
 };
 
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 }  // namespace partition_alloc::internal
 
-#endif  // BUILDFLAG(ENABLE_PKEYS)
+#endif  // PA_BUILDFLAG(ENABLE_PKEYS)
 
 #endif  // PARTITION_ALLOC_THREAD_ISOLATION_PKEY_H_
diff --git a/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey_unittest.cc b/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey_unittest.cc
index 5cd7314..d6ac7f05 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey_unittest.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/pkey_unittest.cc
@@ -8,7 +8,7 @@
 #include "partition_alloc/partition_root.h"
 #include "partition_alloc/thread_isolation/thread_isolation.h"
 
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
 
 #include <link.h>
 #include <sys/mman.h>
@@ -271,4 +271,4 @@
 
 }  // namespace partition_alloc::internal
 
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/thread_isolation.cc b/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/thread_isolation.cc
index 6b83265..09bb583 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/thread_isolation.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/thread_isolation.cc
@@ -4,7 +4,7 @@
 
 #include "partition_alloc/thread_isolation/thread_isolation.h"
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 
 #include "partition_alloc/address_pool_manager.h"
 #include "partition_alloc/page_allocator.h"
@@ -12,13 +12,13 @@
 #include "partition_alloc/partition_alloc_constants.h"
 #include "partition_alloc/reservation_offset_table.h"
 
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
 #include "partition_alloc/thread_isolation/pkey.h"
 #endif
 
 namespace partition_alloc::internal {
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 ThreadIsolationSettings ThreadIsolationSettings::settings;
 #endif
 
@@ -37,7 +37,7 @@
                 : PageAccessibilityConfiguration::Permissions::kReadWrite));
     return;
   }
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
   partition_alloc::internal::TagMemoryWithPkey(
       thread_isolation.enabled ? thread_isolation.pkey : kDefaultPkey, address,
       size);
@@ -59,7 +59,7 @@
                                 size_t len,
                                 int prot,
                                 ThreadIsolationOption thread_isolation) {
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
   return PkeyMprotect(addr, len, prot, thread_isolation.pkey);
 #endif
 }
@@ -80,7 +80,7 @@
       thread_isolation, pkey_reservation_offset_table,
       ReservationOffsetTable::kReservationOffsetTableLength);
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
   WriteProtectThreadIsolatedVariable(thread_isolation,
                                      ThreadIsolationSettings::settings);
 #endif
@@ -92,4 +92,4 @@
 
 }  // namespace partition_alloc::internal
 
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/thread_isolation.h b/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/thread_isolation.h
index 58f7da4..b6b6343 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/thread_isolation.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/thread_isolation/thread_isolation.h
@@ -7,7 +7,7 @@
 
 #include "partition_alloc/partition_alloc_buildflags.h"
 
-#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#if PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 
 #include <cstddef>
 #include <cstdint>
@@ -15,7 +15,7 @@
 #include "partition_alloc/partition_alloc_base/component_export.h"
 #include "partition_alloc/partition_alloc_base/debug/debugging_buildflags.h"
 
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
 #include "partition_alloc/thread_isolation/pkey.h"
 #endif
 
@@ -29,21 +29,21 @@
   constexpr ThreadIsolationOption() = default;
   explicit ThreadIsolationOption(bool enabled) : enabled(enabled) {}
 
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
   explicit ThreadIsolationOption(int pkey) : pkey(pkey) {
     enabled = pkey != internal::kInvalidPkey;
   }
   int pkey = -1;
-#endif  // BUILDFLAG(ENABLE_PKEYS)
+#endif  // PA_BUILDFLAG(ENABLE_PKEYS)
 
   bool enabled = false;
 
   bool operator==(const ThreadIsolationOption& other) const {
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
     if (pkey != other.pkey) {
       return false;
     }
-#endif  // BUILDFLAG(ENABLE_PKEYS)
+#endif  // PA_BUILDFLAG(ENABLE_PKEYS)
     return enabled == other.enabled;
   }
 };
@@ -52,19 +52,19 @@
 
 namespace partition_alloc::internal {
 
-#if BUILDFLAG(PA_DCHECK_IS_ON)
+#if PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 struct PA_THREAD_ISOLATED_ALIGN ThreadIsolationSettings {
   bool enabled = false;
   static ThreadIsolationSettings settings PA_CONSTINIT;
 };
 
-#if BUILDFLAG(ENABLE_PKEYS)
+#if PA_BUILDFLAG(ENABLE_PKEYS)
 
 using LiftThreadIsolationScope = LiftPkeyRestrictionsScope;
 
-#endif  // BUILDFLAG(ENABLE_PKEYS)
-#endif  // BUILDFLAG(PA_DCHECK_IS_ON)
+#endif  // PA_BUILDFLAG(ENABLE_PKEYS)
+#endif  // PA_BUILDFLAG(PA_DCHECK_IS_ON)
 
 void WriteProtectThreadIsolatedGlobals(ThreadIsolationOption thread_isolation);
 void UnprotectThreadIsolatedGlobals();
@@ -76,6 +76,6 @@
 
 }  // namespace partition_alloc::internal
 
-#endif  // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+#endif  // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
 
 #endif  // PARTITION_ALLOC_THREAD_ISOLATION_THREAD_ISOLATION_H_
diff --git a/base/memory/discardable_shared_memory.cc b/base/memory/discardable_shared_memory.cc
index 42617c8..8558c61 100644
--- a/base/memory/discardable_shared_memory.cc
+++ b/base/memory/discardable_shared_memory.cc
@@ -2,11 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef UNSAFE_BUFFERS_BUILD
-// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
-#pragma allow_unsafe_buffers
-#endif
-
 #include "base/memory/discardable_shared_memory.h"
 
 #include <stdint.h>
@@ -145,15 +140,11 @@
 
 }  // namespace
 
-DiscardableSharedMemory::DiscardableSharedMemory()
-    : mapped_size_(0), locked_page_count_(0) {
-}
+DiscardableSharedMemory::DiscardableSharedMemory() = default;
 
 DiscardableSharedMemory::DiscardableSharedMemory(
     UnsafeSharedMemoryRegion shared_memory_region)
-    : shared_memory_region_(std::move(shared_memory_region)),
-      mapped_size_(0),
-      locked_page_count_(0) {}
+    : shared_memory_region_(std::move(shared_memory_region)) {}
 
 DiscardableSharedMemory::~DiscardableSharedMemory() = default;
 
@@ -173,10 +164,8 @@
   if (!shared_memory_mapping_.IsValid())
     return false;
 
-  mapped_size_ = shared_memory_mapping_.mapped_size() -
-                 AlignToPageSize(sizeof(SharedState));
-
-  locked_page_count_ = AlignToPageSize(mapped_size_) / base::GetPageSize();
+  locked_page_count_ =
+      AlignToPageSize(mapped_memory().size()) / base::GetPageSize();
 #if DCHECK_IS_ON()
   for (size_t page = 0; page < locked_page_count_; ++page)
     locked_pages_.insert(page);
@@ -200,10 +189,8 @@
   if (!shared_memory_mapping_.IsValid())
     return false;
 
-  mapped_size_ = shared_memory_mapping_.mapped_size() -
-                 AlignToPageSize(sizeof(SharedState));
-
-  locked_page_count_ = AlignToPageSize(mapped_size_) / base::GetPageSize();
+  locked_page_count_ =
+      AlignToPageSize(mapped_memory().size()) / base::GetPageSize();
 #if DCHECK_IS_ON()
   for (size_t page = 0; page < locked_page_count_; ++page)
     locked_pages_.insert(page);
@@ -221,7 +208,6 @@
 #if DCHECK_IS_ON()
   locked_pages_.clear();
 #endif
-  mapped_size_ = 0;
   return true;
 }
 
@@ -258,12 +244,12 @@
 
   // Zero for length means "everything onward".
   if (!length)
-    length = AlignToPageSize(mapped_size_) - offset;
+    length = AlignToPageSize(mapped_memory().size()) - offset;
 
   size_t start = offset / base::GetPageSize();
   size_t end = start + length / base::GetPageSize();
   DCHECK_LE(start, end);
-  DCHECK_LE(end, AlignToPageSize(mapped_size_) / base::GetPageSize());
+  DCHECK_LE(end, AlignToPageSize(mapped_memory().size()) / base::GetPageSize());
 
   // Add pages to |locked_page_count_|.
   // Note: Locking a page that is already locked is an error.
@@ -299,9 +285,8 @@
   //
   // For more information, see
   // https://bugs.chromium.org/p/chromium/issues/detail?id=823915.
-  madvise(static_cast<char*>(shared_memory_mapping_.memory()) +
-              AlignToPageSize(sizeof(SharedState)),
-          AlignToPageSize(mapped_size_), MADV_FREE_REUSE);
+  base::span<uint8_t> mapped = mapped_memory();
+  madvise(mapped.data(), AlignToPageSize(mapped.size()), MADV_FREE_REUSE);
   return DiscardableSharedMemory::SUCCESS;
 #else
   return DiscardableSharedMemory::SUCCESS;
@@ -316,9 +301,9 @@
   DFAKE_SCOPED_LOCK(thread_collision_warner_);
 
   // Passing zero for |length| means "everything onward". Note that |length| may
-  // still be zero after this calculation, e.g. if |mapped_size_| is zero.
+  // still be zero after this calculation, e.g. if the mapped size is zero.
   if (!length)
-    length = AlignToPageSize(mapped_size_) - offset;
+    length = AlignToPageSize(mapped_memory().size()) - offset;
 
   DCHECK(shared_memory_mapping_.IsValid());
 
@@ -329,7 +314,7 @@
   size_t start = offset / base::GetPageSize();
   size_t end = start + length / base::GetPageSize();
   DCHECK_LE(start, end);
-  DCHECK_LE(end, AlignToPageSize(mapped_size_) / base::GetPageSize());
+  DCHECK_LE(end, AlignToPageSize(mapped_memory().size()) / base::GetPageSize());
 
   // Remove pages from |locked_page_count_|.
   // Note: Unlocking a page that is not locked is an error.
@@ -369,9 +354,14 @@
   last_known_usage_ = current_time;
 }
 
-void* DiscardableSharedMemory::memory() const {
-  return static_cast<uint8_t*>(shared_memory_mapping_.memory()) +
-         AlignToPageSize(sizeof(SharedState));
+span<uint8_t> DiscardableSharedMemory::memory() const {
+  return shared_memory_mapping_.GetMemoryAsSpan<uint8_t>().subspan(
+      AlignToPageSize(sizeof(SharedState)));
+}
+
+span<uint8_t> DiscardableSharedMemory::mapped_memory() const {
+  return shared_memory_mapping_.mapped_memory().subspan(
+      AlignToPageSize(sizeof(SharedState)));
 }
 
 bool DiscardableSharedMemory::Purge(Time current_time) {
@@ -420,17 +410,16 @@
   // Advise the kernel to remove resources associated with purged pages.
   // Subsequent accesses of memory pages will succeed, but might result in
   // zero-fill-on-demand pages.
-  if (madvise(static_cast<char*>(shared_memory_mapping_.memory()) +
-                  AlignToPageSize(sizeof(SharedState)),
-              AlignToPageSize(mapped_size_), MADV_PURGE_ARGUMENT)) {
+  base::span<uint8_t> map = mapped_memory();
+  if (madvise(map.data(), AlignToPageSize(map.size()), MADV_PURGE_ARGUMENT)) {
     DPLOG(ERROR) << "madvise() failed";
   }
 #elif BUILDFLAG(IS_WIN)
   // On Windows, discarded pages are not returned to the system immediately and
   // not guaranteed to be zeroed when returned to the application.
-  char* address = static_cast<char*>(shared_memory_mapping_.memory()) +
-                  AlignToPageSize(sizeof(SharedState));
-  size_t length = AlignToPageSize(mapped_size_);
+  base::span<uint8_t> mapped = mapped_memory();
+  uint8_t* address = mapped.data();
+  size_t length = AlignToPageSize(mapped.size());
 
   DWORD ret = DiscardVirtualMemory(address, length);
   // DiscardVirtualMemory is buggy in Win10 SP0, so fall back to MEM_RESET on
@@ -442,11 +431,10 @@
 #elif BUILDFLAG(IS_FUCHSIA)
   // De-commit via our VMAR, rather than relying on the VMO handle, since the
   // handle may have been closed after the memory was mapped into this process.
-  uint64_t address_int = reinterpret_cast<uint64_t>(
-      static_cast<char*>(shared_memory_mapping_.memory()) +
-      AlignToPageSize(sizeof(SharedState)));
+  base::span<uint8_t> mapped = mapped_memory();
+  uint64_t address_int = reinterpret_cast<uint64_t>(mapped.data());
   zx_status_t status = zx::vmar::root_self()->op_range(
-      ZX_VMO_OP_DECOMMIT, address_int, AlignToPageSize(mapped_size_), nullptr,
+      ZX_VMO_OP_DECOMMIT, address_int, AlignToPageSize(mapped.size()), nullptr,
       0);
   ZX_DCHECK(status == ZX_OK, status) << "zx_vmo_op_range(ZX_VMO_OP_DECOMMIT)";
 #endif  // BUILDFLAG(IS_FUCHSIA)
@@ -475,13 +463,13 @@
   // Advise the kernel to remove resources associated with purged pages.
   // Subsequent accesses of memory pages will succeed, but might result in
   // zero-fill-on-demand pages.
-  if (madvise(static_cast<char*>(shared_memory_mapping_.memory()) + offset,
-              length, MADV_PURGE_ARGUMENT)) {
+  base::span<uint8_t> span = memory().subspan(offset, length);
+  if (madvise(span.data(), span.size(), MADV_PURGE_ARGUMENT)) {
     DPLOG(ERROR) << "madvise() failed";
   }
 #else   // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_NACL)
-  partition_alloc::DiscardSystemPages(
-      static_cast<char*>(shared_memory_mapping_.memory()) + offset, length);
+  base::span<uint8_t> span = memory().subspan(offset, length);
+  partition_alloc::DiscardSystemPages(span.data(), span.size());
 #endif  // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_NACL)
 }
 
diff --git a/base/memory/discardable_shared_memory.h b/base/memory/discardable_shared_memory.h
index 73ae10b..cbe20596 100644
--- a/base/memory/discardable_shared_memory.h
+++ b/base/memory/discardable_shared_memory.h
@@ -8,6 +8,7 @@
 #include <stddef.h>
 
 #include "base/base_export.h"
+#include "base/containers/span.h"
 #include "base/dcheck_is_on.h"
 #include "base/memory/shared_memory_mapping.h"
 #include "base/memory/unsafe_shared_memory_region.h"
@@ -71,8 +72,15 @@
   // not mapped.
   bool Unmap();
 
-  // The actual size of the mapped memory (may be larger than requested).
-  size_t mapped_size() const { return mapped_size_; }
+  // The actual size of the mapped memory (may be larger than requested). It is
+  // 0 when the memory has not been mapped via `Map()`.
+  size_t mapped_size() const {
+    if (shared_memory_mapping_.IsValid()) {
+      return mapped_memory().size();
+    } else {
+      return 0u;
+    }
+  }
 
   // Returns a duplicated shared memory region for this DiscardableSharedMemory
   // object.
@@ -109,9 +117,14 @@
   // Passing 0 for |length| means "everything onward".
   void Unlock(size_t offset, size_t length);
 
-  // Gets a pointer to the opened discardable memory space. Discardable memory
+  // Gets a span over the opened discardable memory space. Discardable memory
   // must have been mapped via Map().
-  void* memory() const;
+  //
+  // This gives the logical memory region, matching the size of what was
+  // requested. The actual mapped memory may be larger due to system alignment
+  // requirements. See `SharedMemoryMapping::size()` vs
+  // `SharedMemoryMapping::mapped_size()`.
+  span<uint8_t> memory() const;
 
   // Returns the last known usage time for DiscardableSharedMemory object. This
   // may be earlier than the "true" usage time when memory has been used by a
@@ -166,6 +179,12 @@
 #endif
 
  private:
+  // Returns the full mapped memory region after the internal bookkeeping
+  // header. This may be larger than the region exposed through `memory()` due
+  // to platform alignment requirements. Discardable memory must have been
+  // mapped via Map().
+  span<uint8_t> mapped_memory() const;
+
   // LockPages/UnlockPages are platform-native discardable page management
   // helper functions. Both expect |offset| to be specified relative to the
   // base address at which |memory| is mapped, and that |offset| and |length|
@@ -184,8 +203,7 @@
 
   UnsafeSharedMemoryRegion shared_memory_region_;
   WritableSharedMemoryMapping shared_memory_mapping_;
-  size_t mapped_size_;
-  size_t locked_page_count_;
+  size_t locked_page_count_ = 0u;
 #if DCHECK_IS_ON()
   std::set<size_t> locked_pages_;
 #endif
diff --git a/base/memory/discardable_shared_memory_unittest.cc b/base/memory/discardable_shared_memory_unittest.cc
index 9c7d495..0853cf8a 100644
--- a/base/memory/discardable_shared_memory_unittest.cc
+++ b/base/memory/discardable_shared_memory_unittest.cc
@@ -2,11 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "base/memory/discardable_shared_memory.h"
+
 #include <fcntl.h>
 #include <stdint.h>
 
+#include <algorithm>
+
 #include "base/files/scoped_file.h"
-#include "base/memory/discardable_shared_memory.h"
 #include "base/memory/page_size.h"
 #include "base/memory/shared_memory_tracker.h"
 #include "base/tracing_buildflags.h"
@@ -434,7 +437,7 @@
   ASSERT_TRUE(rv);
 
   // Initialize all memory to '0xaa'.
-  memset(memory2.memory(), 0xaa, kDataSize);
+  std::ranges::fill(memory2.memory(), 0xaa);
 
   // Unlock memory.
   memory2.SetNow(Time::FromSecondsSinceUnixEpoch(1));
@@ -450,7 +453,7 @@
   // Check that reading memory after it has been purged is returning
   // zero-filled pages.
   uint8_t expected_data[kDataSize] = {};
-  EXPECT_EQ(memcmp(memory2.memory(), expected_data, kDataSize), 0);
+  EXPECT_EQ(base::span(expected_data), memory2.memory());
 }
 #endif
 
diff --git a/base/memory/shared_memory_mapping.h b/base/memory/shared_memory_mapping.h
index d546deb..42d53a1 100644
--- a/base/memory/shared_memory_mapping.h
+++ b/base/memory/shared_memory_mapping.h
@@ -242,6 +242,18 @@
                               size_t size,
                               const UnguessableToken& guid,
                               SharedMemoryMapper* mapper);
+
+  friend class DiscardableSharedMemory;
+  // Returns a span over the entire mapped memory, which may be more than the
+  // logical requested memory. Bytes outside of the logical size should not be
+  // used.
+  span<uint8_t> mapped_memory() const {
+    if (!IsValid()) {
+      return span<uint8_t>();
+    }
+    return UNSAFE_BUFFERS(
+        span(static_cast<uint8_t*>(raw_memory_ptr()), mapped_size()));
+  }
 };
 
 }  // namespace base
diff --git a/base/os_compat_android.cc b/base/os_compat_android.cc
index d0f920b..8bdd84a 100644
--- a/base/os_compat_android.cc
+++ b/base/os_compat_android.cc
@@ -35,7 +35,8 @@
   ts[0].tv_nsec = tv[0].tv_usec * 1000;
   ts[1].tv_sec = tv[1].tv_sec;
   ts[1].tv_nsec = tv[1].tv_usec * 1000;
-  return base::checked_cast<int>(syscall(__NR_utimensat, fd, NULL, ts, 0));
+  return base::checked_cast<int>(
+      syscall(__NR_utimensat, fd, NULL, ts.data(), 0));
 }
 #endif
 
diff --git a/build/config/ios/rules.gni b/build/config/ios/rules.gni
index c70f131..39d25e03 100644
--- a/build/config/ios/rules.gni
+++ b/build/config/ios/rules.gni
@@ -1390,9 +1390,11 @@
       # less error prone that having the developer duplicate the list of all
       # headers in addition to "sources".
       sources = []
-      foreach(_source, invoker.sources) {
-        if (get_path_info(_source, "extension") == "h") {
-          sources += [ _source ]
+      if (defined(invoker.sources)) {
+        foreach(_source, invoker.sources) {
+          if (get_path_info(_source, "extension") == "h") {
+            sources += [ _source ]
+          }
         }
       }
 
diff --git a/build/config/unsafe_buffers_paths.txt b/build/config/unsafe_buffers_paths.txt
index 0c576c7..120f084 100644
--- a/build/config/unsafe_buffers_paths.txt
+++ b/build/config/unsafe_buffers_paths.txt
@@ -65,6 +65,7 @@
 -clank/
 -codelabs/
 -components/
++components/discardable_memory
 -content/
 -courgette/
 -crypto/
diff --git a/chrome/VERSION b/chrome/VERSION
index ceb590d..f1ad6d3 100644
--- a/chrome/VERSION
+++ b/chrome/VERSION
@@ -1,4 +1,4 @@
 MAJOR=126
 MINOR=0
-BUILD=6463
+BUILD=6464
 PATCH=0
diff --git a/chrome/android/chrome_test_java_sources.gni b/chrome/android/chrome_test_java_sources.gni
index 255f8c3f..9a3a25e 100644
--- a/chrome/android/chrome_test_java_sources.gni
+++ b/chrome/android/chrome_test_java_sources.gni
@@ -315,6 +315,7 @@
   "javatests/src/org/chromium/chrome/browser/password_manager/PasswordMigrationWarningExportFlowTest.java",
   "javatests/src/org/chromium/chrome/browser/password_manager/PasswordSavingIntegrationTest.java",
   "javatests/src/org/chromium/chrome/browser/password_manager/TouchToFillMainFlowIntegrationTest.java",
+  "javatests/src/org/chromium/chrome/browser/password_manager/settings/CredentialManagerIntegrationTest.java",
   "javatests/src/org/chromium/chrome/browser/password_manager/settings/FakePasswordManagerHandler.java",
   "javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettingsExportTest.java",
   "javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettingsSearchTest.java",
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogTest.java
index 756f6543..70071c7 100644
--- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogTest.java
+++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogTest.java
@@ -816,6 +816,7 @@
 
     @Test
     @MediumTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338998202
     public void testDialogSelectionEditor_PostLongPressClickNoSelectionEditor()
             throws ExecutionException {
         TabUiFeatureUtilities.setTabListEditorLongPressEntryEnabledForTesting(true);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgentImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgentImpl.java
index 8efc35aa..37b2b2c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgentImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgentImpl.java
@@ -30,6 +30,7 @@
 import org.chromium.chrome.browser.flags.ChromeFeatureList;
 import org.chromium.chrome.browser.init.AsyncInitTaskRunner;
 import org.chromium.chrome.browser.init.ChromeBrowserInitializer;
+import org.chromium.chrome.browser.metrics.UmaSessionStats;
 import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
 import org.chromium.chrome.browser.profiles.Profile;
 import org.chromium.chrome.browser.profiles.ProfileManager;
@@ -546,6 +547,14 @@
             }
         }
 
+        // TODO(crbug.com/40075135): Restore the metrics related preferences and update the upload
+        // states as early as possible, i.e. before the native prefs restoration/getting accounts.
+        // Refresh the metrics service state after related preferences are restored, to allow the
+        // experiment metrics to be sent if there's any.
+        if (SigninFeatureMap.isEnabled(SigninFeatures.UPDATE_METRICS_SERVICES_STATE_IN_RESTORE)) {
+            UmaSessionStats.updateMetricsServiceState();
+        }
+
         if (syncAccountInfo != null) {
             // Both accounts are recorded at the same time. Since only one account is in signed-in
             // state at a given time, they should be identical if both are valid.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManagerImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManagerImpl.java
index 021f52e6..ee634fcb 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManagerImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManagerImpl.java
@@ -241,16 +241,22 @@
      * by the native component. Sets the email of the primary account stored in shared preferences
      * to null in case the user is signed out.
      */
-    private void maybeUpdateLegacySyncAccountEmail() {
-        // TODO(crbug.com/40066882): Use ConsentLevel.SIGNIN instead.
-        CoreAccountInfo accountInfo = mIdentityManager.getPrimaryAccountInfo(ConsentLevel.SYNC);
+    private void maybeUpdateLegacyPrimaryAccountEmail() {
+        @ConsentLevel
+        int consentLevel =
+                SigninFeatureMap.isEnabled(
+                                SigninFeatures
+                                        .USE_CONSENT_LEVEL_SIGNIN_FOR_LEGACY_ACCOUNT_EMAIL_PREF)
+                        ? ConsentLevel.SIGNIN
+                        : ConsentLevel.SYNC;
+        CoreAccountInfo accountInfo = mIdentityManager.getPrimaryAccountInfo(consentLevel);
         if (Objects.equals(
                 CoreAccountInfo.getEmailFrom(accountInfo),
-                SigninPreferencesManager.getInstance().getLegacySyncAccountEmail())) {
+                SigninPreferencesManager.getInstance().getLegacyPrimaryAccountEmail())) {
             return;
         }
         SigninPreferencesManager.getInstance()
-                .setLegacySyncAccountEmail(CoreAccountInfo.getEmailFrom(accountInfo));
+                .setLegacyPrimaryAccountEmail(CoreAccountInfo.getEmailFrom(accountInfo));
     }
 
     /** Extracts the domain name of a given account's email. */
@@ -500,10 +506,10 @@
             return;
         }
 
-        if (mSignInState.shouldTurnSyncOn()) {
-            // Should be called after re-seeding accounts to make sure that we get the new email.
-            maybeUpdateLegacySyncAccountEmail();
+        // Should be called after setting the primary account.
+        maybeUpdateLegacyPrimaryAccountEmail();
 
+        if (mSignInState.shouldTurnSyncOn()) {
             mSyncService.setSyncRequested();
 
             RecordUserAction.record("Signin_Signin_Succeed");
@@ -761,7 +767,7 @@
         mIdentityManager.refreshAccountInfoIfStale(
                 mAccountManagerFacade.getCoreAccountInfos().getResult());
         // Should be called after re-seeding accounts to make sure that we get the new email.
-        maybeUpdateLegacySyncAccountEmail();
+        maybeUpdateLegacyPrimaryAccountEmail();
     }
 
     /**
@@ -870,7 +876,7 @@
                 "Native signout complete, wiping data (user callback: %s)",
                 mSignOutState.mDataWipeAction);
 
-        maybeUpdateLegacySyncAccountEmail();
+        maybeUpdateLegacyPrimaryAccountEmail();
 
         if (mSignOutState.mSignOutCallback != null) {
             mSignOutState.mSignOutCallback.preWipeData();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/overlays/strip/TabStripTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/overlays/strip/TabStripTest.java
index 37a8a107..675d5c7 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/overlays/strip/TabStripTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/overlays/strip/TabStripTest.java
@@ -23,6 +23,7 @@
 import org.chromium.base.test.util.CommandLineFlags;
 import org.chromium.base.test.util.Criteria;
 import org.chromium.base.test.util.CriteriaHelper;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.DisabledTest;
 import org.chromium.base.test.util.Feature;
 import org.chromium.base.test.util.Restriction;
@@ -42,6 +43,7 @@
 import org.chromium.content_public.browser.test.util.TestThreadUtils;
 import org.chromium.ui.base.LocalizationUtils;
 import org.chromium.ui.test.util.DeviceRestriction;
+import org.chromium.ui.test.util.UiDisableIf;
 import org.chromium.ui.test.util.UiRestriction;
 
 import java.util.concurrent.Callable;
@@ -764,6 +766,7 @@
      */
     @Test
     @LargeTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338966108
     @Restriction(UiRestriction.RESTRICTION_TYPE_TABLET)
     @Feature({"TabStrip"})
     public void testScrollingStripStackerFadeOpacity() throws Exception {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java
index af8a06dc..8b59d3a 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java
@@ -45,6 +45,7 @@
 import org.chromium.base.test.util.CommandLineFlags;
 import org.chromium.base.test.util.Criteria;
 import org.chromium.base.test.util.CriteriaHelper;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.Feature;
 import org.chromium.base.test.util.Features.DisableFeatures;
 import org.chromium.base.test.util.Features.EnableFeatures;
@@ -78,6 +79,7 @@
 import org.chromium.net.test.EmbeddedTestServer;
 import org.chromium.ui.base.Clipboard;
 import org.chromium.ui.base.MenuSourceType;
+import org.chromium.ui.test.util.UiDisableIf;
 import org.chromium.url.GURL;
 
 import java.io.IOException;
@@ -638,6 +640,7 @@
 
     @Test
     @SmallTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338969612
     @Feature({"Browser", "ContextMenu"})
     public void testContextMenuRetrievesLinkOptions() throws TimeoutException {
         Tab tab = mDownloadTestRule.getActivity().getActivityTab();
@@ -734,6 +737,7 @@
 
     @Test
     @SmallTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338969612
     @Feature({"Browser", "ContextMenu"})
     public void testContextMenuRetrievesImageLinkOptions() throws TimeoutException {
         LensUtils.setFakePassableLensEnvironmentForTesting(true);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/download/OMADownloadHandlerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/download/OMADownloadHandlerTest.java
index 41ee5ac..f1fedd45 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/download/OMADownloadHandlerTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/download/OMADownloadHandlerTest.java
@@ -27,6 +27,7 @@
 import org.chromium.base.test.util.Batch;
 import org.chromium.base.test.util.Criteria;
 import org.chromium.base.test.util.CriteriaHelper;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.Feature;
 import org.chromium.base.test.util.UrlUtils;
 import org.chromium.chrome.browser.download.DownloadManagerBridge.DownloadQueryResult;
@@ -41,6 +42,7 @@
 import org.chromium.components.offline_items_collection.UpdateDelta;
 import org.chromium.content_public.browser.test.util.TestThreadUtils;
 import org.chromium.net.test.EmbeddedTestServer;
+import org.chromium.ui.test.util.UiDisableIf;
 import org.chromium.url.GURL;
 
 import java.io.ByteArrayInputStream;
@@ -310,6 +312,7 @@
      */
     @Test
     @MediumTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338971643
     @Feature({"Download"})
     public void testQueryDownloadResult() {
         Context context = getTestContext();
@@ -343,6 +346,7 @@
      */
     @Test
     @MediumTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338971643
     @Feature({"Download"})
     public void testClearPendingOMADownloads() {
         Context context = getTestContext();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/gesturenav/NavigationHandlerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/gesturenav/NavigationHandlerTest.java
index 4fa0e03..6cd6393 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/gesturenav/NavigationHandlerTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/gesturenav/NavigationHandlerTest.java
@@ -24,6 +24,7 @@
 import org.chromium.base.test.util.CommandLineFlags;
 import org.chromium.base.test.util.Criteria;
 import org.chromium.base.test.util.CriteriaHelper;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.DisabledTest;
 import org.chromium.base.test.util.HistogramWatcher;
 import org.chromium.base.test.util.Restriction;
@@ -46,6 +47,7 @@
 import org.chromium.content_public.common.ContentUrlConstants;
 import org.chromium.net.test.EmbeddedTestServer;
 import org.chromium.ui.base.PageTransition;
+import org.chromium.ui.test.util.UiDisableIf;
 import org.chromium.ui.test.util.UiRestriction;
 
 import java.util.Map;
@@ -126,6 +128,7 @@
 
     @Test
     @SmallTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338972492
     public void testCloseChromeAtHistoryStackHead() {
         loadNewTabPage();
         AsyncInitializationActivity.interceptMoveTaskToBackForTesting();
@@ -172,6 +175,7 @@
 
     @Test
     @SmallTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338972492
     public void testSwipeNavigateOnNativePage() {
         HistogramWatcher histogramWatcher =
                 HistogramWatcher.newBuilder()
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/metrics/MainIntentBehaviorMetricsIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/metrics/MainIntentBehaviorMetricsIntegrationTest.java
index b4a56803..27d6333 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/metrics/MainIntentBehaviorMetricsIntegrationTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/metrics/MainIntentBehaviorMetricsIntegrationTest.java
@@ -28,6 +28,7 @@
 import org.chromium.base.metrics.RecordHistogram;
 import org.chromium.base.shared_preferences.SharedPreferencesManager;
 import org.chromium.base.test.util.CommandLineFlags;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.UserActionTester;
 import org.chromium.chrome.browser.ChromeTabbedActivity;
 import org.chromium.chrome.browser.app.bookmarks.BookmarkActivity;
@@ -46,6 +47,7 @@
 import org.chromium.chrome.test.util.MenuUtils;
 import org.chromium.components.browser_ui.settings.PlaceholderSettingsForTest;
 import org.chromium.content_public.browser.test.util.TestThreadUtils;
+import org.chromium.ui.test.util.UiDisableIf;
 
 /** Tests the metrics recording for main intent behaviours. */
 @RunWith(ChromeJUnit4ClassRunner.class)
@@ -151,6 +153,7 @@
 
     @MediumTest
     @Test
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338974184
     public void testLaunch_From_InAppActivities() {
         try {
             MainIntentBehaviorMetrics.setTimeoutDurationMsForTesting(0);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/multiwindow/MultiWindowIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/multiwindow/MultiWindowIntegrationTest.java
index 1f4a6b3..7add670 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/multiwindow/MultiWindowIntegrationTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/multiwindow/MultiWindowIntegrationTest.java
@@ -22,6 +22,7 @@
 import org.chromium.base.test.util.CommandLineFlags;
 import org.chromium.base.test.util.Criteria;
 import org.chromium.base.test.util.CriteriaHelper;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.DisabledTest;
 import org.chromium.base.test.util.Feature;
 import org.chromium.base.test.util.Restriction;
@@ -39,6 +40,7 @@
 import org.chromium.chrome.test.util.MenuUtils;
 import org.chromium.content_public.browser.test.util.TestThreadUtils;
 import org.chromium.net.test.EmbeddedTestServer;
+import org.chromium.ui.test.util.UiDisableIf;
 import org.chromium.ui.test.util.UiRestriction;
 
 /** Integration testing for Android's N+ MultiWindow. */
@@ -102,6 +104,7 @@
 
     @Test
     @MediumTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338976206
     @Feature("MultiWindow")
     @CommandLineFlags.Add({
         ChromeSwitches.DISABLE_TAB_MERGING_FOR_TESTING,
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/multiwindow/MultiWindowUtilsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/multiwindow/MultiWindowUtilsTest.java
index bd22103c..3c913e77 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/multiwindow/MultiWindowUtilsTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/multiwindow/MultiWindowUtilsTest.java
@@ -45,6 +45,7 @@
 import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
 import org.chromium.chrome.test.R;
 import org.chromium.content_public.browser.test.util.TestThreadUtils;
+import org.chromium.ui.test.util.UiDisableIf;
 
 import java.util.concurrent.TimeoutException;
 
@@ -75,6 +76,7 @@
     /** Tests that ChromeTabbedActivity2 is used for intents when EXTRA_WINDOW_ID is set to 2. */
     @Test
     @SmallTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338976206
     @Feature("MultiWindow")
     public void testTabbedActivityForIntentWithExtraWindowId() {
         ChromeTabbedActivity activity1 = mActivityTestRule.getActivity();
@@ -95,6 +97,7 @@
      */
     @Test
     @SmallTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338976206
     @Feature("MultiWindow")
     public void testTabbedActivityForIntentLastResumedActivity() {
         ChromeTabbedActivity activity1 = mActivityTestRule.getActivity();
@@ -155,6 +158,7 @@
      */
     @Test
     @SmallTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338976206
     @Feature("MultiWindow")
     public void testTabbedActivityForIntentOnlyActivity2IsRunning() {
         ChromeTabbedActivity activity1 = mActivityTestRule.getActivity();
@@ -211,6 +215,7 @@
      */
     @Test
     @SmallTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338976206
     @Feature("MultiWindow")
     public void testAreMultipleChromeInstancesRunningSecondInstanceKilledFirst()
             throws TimeoutException {
@@ -307,6 +312,7 @@
     @DisableIf.Build(
             sdk_is_less_than = Build.VERSION_CODES.O,
             message = "https://crbug.com/1077249")
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338976206
     public void testAreMultipleChromeInstancesRunningFirstInstanceKilledFirst()
             throws TimeoutException {
         ChromeTabbedActivity activity1 = mActivityTestRule.getActivity();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java
index 70efdf4..3d3b0a9 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java
@@ -24,6 +24,7 @@
 import org.chromium.base.task.TaskTraits;
 import org.chromium.base.test.util.Batch;
 import org.chromium.base.test.util.CommandLineFlags;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.DisabledTest;
 import org.chromium.chrome.browser.flags.ChromeSwitches;
 import org.chromium.chrome.browser.offlinepages.OfflinePageBridge.OfflinePageModelObserver;
@@ -42,6 +43,7 @@
 import org.chromium.content_public.browser.test.util.TestThreadUtils;
 import org.chromium.net.NetworkChangeNotifier;
 import org.chromium.net.test.EmbeddedTestServer;
+import org.chromium.ui.test.util.UiDisableIf;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -458,6 +460,7 @@
 
     @Test
     @MediumTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338976971
     public void testGetLoadUrlParamsForOpeningMhtmlFileUrl() throws Exception {
         sActivityTestRule.loadUrl(mTestPage);
         savePage(SavePageResult.SUCCESS, mTestPage);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxPedalsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxPedalsTest.java
index ac55e97..0e4f833a 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxPedalsTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxPedalsTest.java
@@ -41,6 +41,7 @@
 import org.chromium.base.test.util.CommandLineFlags;
 import org.chromium.base.test.util.Criteria;
 import org.chromium.base.test.util.CriteriaHelper;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.Features;
 import org.chromium.base.test.util.Features.DisableFeatures;
 import org.chromium.base.test.util.Features.EnableFeatures;
@@ -80,6 +81,7 @@
 import org.chromium.ui.modaldialog.DialogDismissalCause;
 import org.chromium.ui.test.util.DisableAnimationsTestRule;
 import org.chromium.ui.test.util.GmsCoreVersionRestriction;
+import org.chromium.ui.test.util.UiDisableIf;
 
 import java.util.Arrays;
 import java.util.List;
@@ -217,6 +219,7 @@
 
     @Test
     @MediumTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338976917
     @Restriction(GmsCoreVersionRestriction.RESTRICTION_TYPE_VERSION_GE_22W30)
     public void testManagePasswordsNoUpmFlow() throws InterruptedException {
         TestThreadUtils.runOnUiThreadBlocking(
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewDarkModeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewDarkModeTest.java
index 82c3db1..4c09de196 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewDarkModeTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewDarkModeTest.java
@@ -23,6 +23,7 @@
 import org.junit.runner.RunWith;
 
 import org.chromium.base.test.util.CommandLineFlags;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.DisabledTest;
 import org.chromium.base.test.util.Feature;
 import org.chromium.base.test.util.Features.DisableFeatures;
@@ -40,6 +41,7 @@
 import org.chromium.content_public.common.ContentSwitches;
 import org.chromium.net.test.EmbeddedTestServerRule;
 import org.chromium.ui.test.util.RenderTestRule;
+import org.chromium.ui.test.util.UiDisableIf;
 
 import java.io.IOException;
 
@@ -141,6 +143,7 @@
     /** Tests PageInfo on internal page. */
     @Test
     @MediumTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338978357
     @Feature({"RenderTest"})
     public void testChromePage() throws IOException {
         loadUrlAndOpenPageInfo("chrome://version/");
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/CredentialManagerIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/CredentialManagerIntegrationTest.java
new file mode 100644
index 0000000..9208e29
--- /dev/null
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/CredentialManagerIntegrationTest.java
@@ -0,0 +1,95 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.password_manager.settings;
+
+import static androidx.test.espresso.Espresso.onView;
+import static androidx.test.espresso.action.ViewActions.click;
+import static androidx.test.espresso.matcher.ViewMatchers.withText;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.filters.MediumTest;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.MockitoAnnotations;
+
+import org.chromium.base.test.util.Batch;
+import org.chromium.base.test.util.CommandLineFlags;
+import org.chromium.base.test.util.PayloadCallbackHelper;
+import org.chromium.base.test.util.Restriction;
+import org.chromium.chrome.browser.flags.ChromeSwitches;
+import org.chromium.chrome.browser.password_manager.CredentialManagerLauncherFactory;
+import org.chromium.chrome.browser.password_manager.FakeCredentialManagerLauncherFactoryImpl;
+import org.chromium.chrome.browser.settings.MainSettings;
+import org.chromium.chrome.browser.settings.SettingsActivityTestRule;
+import org.chromium.chrome.browser.sync.SyncTestRule;
+import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
+import org.chromium.chrome.test.R;
+import org.chromium.ui.test.util.DeviceRestriction;
+import org.chromium.ui.test.util.GmsCoreVersionRestriction;
+
+/** Integration test for accessing credential manager. */
+@RunWith(ChromeJUnit4ClassRunner.class)
+@Batch(Batch.PER_CLASS)
+@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "show-autofill-signatures"})
+public class CredentialManagerIntegrationTest {
+    @Rule public SyncTestRule mSyncTestRule = new SyncTestRule();
+
+    @Rule
+    public SettingsActivityTestRule<MainSettings> mSettingsActivityTestRule =
+            new SettingsActivityTestRule<>(MainSettings.class);
+
+    private FakeCredentialManagerLauncherFactoryImpl mFakeLauncherFactory =
+            new FakeCredentialManagerLauncherFactoryImpl();
+
+    final PayloadCallbackHelper<PendingIntent> mSuccessCallbackHelper =
+            new PayloadCallbackHelper<>();
+    final PayloadCallbackHelper<Exception> mFailureCallbackHelper = new PayloadCallbackHelper<>();
+
+    @Before
+    public void setup() throws Exception {
+        MockitoAnnotations.initMocks(this);
+        CredentialManagerLauncherFactory.setFactoryForTesting(mFakeLauncherFactory);
+        mFakeLauncherFactory.setSuccessCallback(mSuccessCallbackHelper::notifyCalled);
+        mFakeLauncherFactory.setFailureCallback(mFailureCallbackHelper::notifyCalled);
+
+        Context context = ApplicationProvider.getApplicationContext();
+        // The Intent for testing leads to MainSettings because it needed the Activity.
+        // The production code would show the passwords in GMSCore.
+        mFakeLauncherFactory.setIntent(
+                PendingIntent.getActivity(
+                        context,
+                        123,
+                        new Intent(context, MainSettings.class),
+                        PendingIntent.FLAG_IMMUTABLE));
+
+        mSyncTestRule.setUpAccountAndEnableSyncForTesting();
+    }
+
+    @Test
+    @MediumTest
+    @Restriction({
+        DeviceRestriction.RESTRICTION_TYPE_NON_AUTO,
+        GmsCoreVersionRestriction.RESTRICTION_TYPE_VERSION_GE_22W30
+    })
+    public void testUseCredentialManagerFromChromeSettings() {
+        mSettingsActivityTestRule.startSettingsActivity();
+        onView(withText(R.string.password_manager_settings_title)).perform(click());
+
+        // Verify that success callback was called.
+        assertNotNull(mSuccessCallbackHelper.getOnlyPayloadBlocking());
+        // Verify that failure callback was not called.
+        assertEquals(0, mFailureCallbackHelper.getCallCount());
+    }
+}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/segmentation_platform/ContextualPageActionControllerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/segmentation_platform/ContextualPageActionControllerTest.java
index 12f7376..34910a4 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/segmentation_platform/ContextualPageActionControllerTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/segmentation_platform/ContextualPageActionControllerTest.java
@@ -15,6 +15,7 @@
 import org.chromium.base.test.BaseJUnit4ClassRunner;
 import org.chromium.base.test.util.Batch;
 import org.chromium.base.test.util.CommandLineFlags;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.Features;
 import org.chromium.base.test.util.Features.EnableFeatures;
 import org.chromium.base.test.util.HistogramWatcher;
@@ -23,6 +24,7 @@
 import org.chromium.chrome.browser.toolbar.adaptive.AdaptiveToolbarButtonVariant;
 import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
 import org.chromium.net.test.EmbeddedTestServer;
+import org.chromium.ui.test.util.UiDisableIf;
 
 @RunWith(BaseJUnit4ClassRunner.class)
 @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
@@ -71,6 +73,7 @@
 
     @Test
     @MediumTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338979594
     @EnableFeatures({
         ChromeFeatureList.CONTEXTUAL_PAGE_ACTIONS,
         ChromeFeatureList.CONTEXTUAL_PAGE_ACTION_READER_MODE
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/settings/SettingsActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/settings/SettingsActivityTest.java
index 29fe3fa1f..0bb17a8 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/settings/SettingsActivityTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/settings/SettingsActivityTest.java
@@ -22,6 +22,7 @@
 import org.junit.runner.RunWith;
 
 import org.chromium.base.test.util.CriteriaHelper;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.DoNotBatch;
 import org.chromium.base.test.util.Feature;
 import org.chromium.base.test.util.Features.DisableFeatures;
@@ -37,6 +38,7 @@
 import org.chromium.content_public.browser.test.util.TestThreadUtils;
 import org.chromium.ui.test.util.DeviceRestriction;
 import org.chromium.ui.test.util.GmsCoreVersionRestriction;
+import org.chromium.ui.test.util.UiDisableIf;
 
 /** Tests for the Settings menu. */
 @RunWith(ChromeJUnit4ClassRunner.class)
@@ -53,6 +55,7 @@
 
     @Test
     @SmallTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338990739
     // Setting BrowserSignin suppresses the sync promo so the password settings preference
     // is visible without scrolling.
     @Policies.Add({
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SigninManagerIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SigninManagerIntegrationTest.java
index 00a5bda..5b59f80 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SigninManagerIntegrationTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SigninManagerIntegrationTest.java
@@ -336,6 +336,7 @@
     @Test
     @MediumTest
     @EnableFeatures(SigninFeatures.SEED_ACCOUNTS_REVAMP)
+    @DisableFeatures(SigninFeatures.USE_CONSENT_LEVEL_SIGNIN_FOR_LEGACY_ACCOUNT_EMAIL_PREF)
     public void testPrimaryAccountRemoval_signsOut() {
         mSigninTestRule.addAccount(TEST_ACCOUNT1);
         SigninTestUtil.signinAndEnableSync(mTestAccount1, null);
@@ -343,7 +344,7 @@
         TestThreadUtils.runOnUiThreadBlocking(
                 () -> {
                     assertEquals(
-                            SigninPreferencesManager.getInstance().getLegacySyncAccountEmail(),
+                            SigninPreferencesManager.getInstance().getLegacyPrimaryAccountEmail(),
                             mTestAccount1.getEmail());
                 });
 
@@ -352,13 +353,15 @@
         TestThreadUtils.runOnUiThreadBlocking(
                 () -> {
                     assertNull(mIdentityManager.getPrimaryAccountInfo(ConsentLevel.SIGNIN));
-                    assertNull(SigninPreferencesManager.getInstance().getLegacySyncAccountEmail());
+                    assertNull(
+                            SigninPreferencesManager.getInstance().getLegacyPrimaryAccountEmail());
                 });
     }
 
     @Test
     @MediumTest
     @EnableFeatures(SigninFeatures.SEED_ACCOUNTS_REVAMP)
+    @DisableFeatures(SigninFeatures.USE_CONSENT_LEVEL_SIGNIN_FOR_LEGACY_ACCOUNT_EMAIL_PREF)
     public void testPrimaryAccountRenaming_updatesLegacySyncAccountEmail() {
         mSigninTestRule.addAccount(TEST_ACCOUNT1);
         SigninTestUtil.signinAndEnableSync(mTestAccount1, null);
@@ -366,7 +369,7 @@
         TestThreadUtils.runOnUiThreadBlocking(
                 () -> {
                     assertEquals(
-                            SigninPreferencesManager.getInstance().getLegacySyncAccountEmail(),
+                            SigninPreferencesManager.getInstance().getLegacyPrimaryAccountEmail(),
                             mTestAccount1.getEmail());
                 });
 
@@ -383,7 +386,68 @@
                             mIdentityManager.getPrimaryAccountInfo(ConsentLevel.SYNC).getEmail(),
                             renamedAccount.getEmail());
                     assertEquals(
-                            SigninPreferencesManager.getInstance().getLegacySyncAccountEmail(),
+                            SigninPreferencesManager.getInstance().getLegacyPrimaryAccountEmail(),
+                            renamedAccount.getEmail());
+                });
+    }
+
+    @Test
+    @MediumTest
+    @EnableFeatures({
+        SigninFeatures.SEED_ACCOUNTS_REVAMP,
+        SigninFeatures.USE_CONSENT_LEVEL_SIGNIN_FOR_LEGACY_ACCOUNT_EMAIL_PREF
+    })
+    public void testSignInAndSignOut_updateLegacySyncAccountEmail() {
+        mSigninTestRule.addAccountThenSignin(SigninTestRule.TEST_ACCOUNT_1);
+
+        TestThreadUtils.runOnUiThreadBlocking(
+                () -> {
+                    assertEquals(
+                            SigninPreferencesManager.getInstance().getLegacyPrimaryAccountEmail(),
+                            SigninTestRule.TEST_ACCOUNT_1.getEmail());
+                });
+
+        mSigninTestRule.signOut();
+
+        TestThreadUtils.runOnUiThreadBlocking(
+                () -> {
+                    assertNull(
+                            SigninPreferencesManager.getInstance().getLegacyPrimaryAccountEmail());
+                });
+    }
+
+    @Test
+    @MediumTest
+    @EnableFeatures({
+        SigninFeatures.SEED_ACCOUNTS_REVAMP,
+        SigninFeatures.USE_CONSENT_LEVEL_SIGNIN_FOR_LEGACY_ACCOUNT_EMAIL_PREF
+    })
+    public void testPrimaryAccountRenaming_updatesLegacySyncAccountEmail_whenSignedIn() {
+        mSigninTestRule.addAccountThenSignin(SigninTestRule.TEST_ACCOUNT_1);
+
+        TestThreadUtils.runOnUiThreadBlocking(
+                () -> {
+                    assertEquals(
+                            SigninPreferencesManager.getInstance().getLegacyPrimaryAccountEmail(),
+                            SigninTestRule.TEST_ACCOUNT_1.getEmail());
+                });
+
+        mSigninTestRule.blockGetCoreAccountInfosUpdate(true);
+        mSigninTestRule.removeAccount(SigninTestRule.TEST_ACCOUNT_1.getId());
+        AccountInfo renamedAccount =
+                new AccountInfo.Builder(
+                                "renamed@gmail.com", SigninTestRule.TEST_ACCOUNT_1.getGaiaId())
+                        .build();
+        mSigninTestRule.addAccount(renamedAccount);
+        mSigninTestRule.unblockGetCoreAccountInfos();
+
+        TestThreadUtils.runOnUiThreadBlocking(
+                () -> {
+                    assertEquals(
+                            mIdentityManager.getPrimaryAccountInfo(ConsentLevel.SIGNIN).getEmail(),
+                            renamedAccount.getEmail());
+                    assertEquals(
+                            SigninPreferencesManager.getInstance().getLegacyPrimaryAccountEmail(),
                             renamedAccount.getEmail());
                 });
     }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SingleWebsiteSettingsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SingleWebsiteSettingsTest.java
index 134e5ef..85820b6 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SingleWebsiteSettingsTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SingleWebsiteSettingsTest.java
@@ -51,6 +51,7 @@
 import org.chromium.components.browser_ui.site_settings.WebsitePreferenceBridge;
 import org.chromium.components.content_settings.ContentSettingValues;
 import org.chromium.components.content_settings.ContentSettingsType;
+import org.chromium.components.content_settings.ProviderType;
 import org.chromium.content_public.browser.test.util.TestThreadUtils;
 import org.chromium.url.GURL;
 
@@ -331,7 +332,7 @@
                         type,
                         website.getAddress().getOrigin(),
                         value,
-                        "preference",
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
 
         return website;
@@ -347,7 +348,7 @@
                         origin,
                         embedder,
                         ContentSettingValues.ASK,
-                        /* source= */ "",
+                        ProviderType.NONE,
                         /* expiration= */ 0,
                         /* isEmbargoed= */ false);
         // Set setting explicitly to write it to prefs.
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java
index 20fef139a..7b03195b 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java
@@ -130,6 +130,7 @@
 import org.chromium.components.content_settings.ContentSettingValues;
 import org.chromium.components.content_settings.ContentSettingsType;
 import org.chromium.components.content_settings.CookieControlsMode;
+import org.chromium.components.content_settings.ProviderType;
 import org.chromium.components.embedder_support.util.Origin;
 import org.chromium.components.location.LocationUtils;
 import org.chromium.components.permissions.nfc.NfcSystemLevelSetting;
@@ -381,7 +382,7 @@
                         "primary.com",
                         "secondary1.com",
                         ContentSettingValues.ALLOW,
-                        "preference",
+                        ProviderType.PREF_PROVIDER,
                         30,
                         false));
         site.addEmbeddedPermission(
@@ -390,7 +391,7 @@
                         "primary.com",
                         "secondary3.com",
                         ContentSettingValues.ALLOW,
-                        "preference",
+                        ProviderType.PREF_PROVIDER,
                         30,
                         false));
 
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/WebsitePermissionsFetcherTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/WebsitePermissionsFetcherTest.java
index f11353e..e08ac1c 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/WebsitePermissionsFetcherTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/WebsitePermissionsFetcherTest.java
@@ -63,6 +63,7 @@
 import org.chromium.components.browsing_data.content.BrowsingDataModel;
 import org.chromium.components.content_settings.ContentSettingValues;
 import org.chromium.components.content_settings.ContentSettingsType;
+import org.chromium.components.content_settings.ProviderType;
 import org.chromium.components.content_settings.SessionModel;
 import org.chromium.content_public.browser.BrowserContextHandle;
 import org.chromium.content_public.browser.test.util.TestThreadUtils;
@@ -318,7 +319,6 @@
 
     private static final String ORIGIN = "https://google.com:443";
     private static final String EMBEDDER = "https://embedder.com";
-    private static final String PREFERENCE_SOURCE = "preference";
     private static final int EXPIRATION_IN_DAYS = 30;
 
     public static class EmbargoedParams implements ParameterProvider {
@@ -706,98 +706,98 @@
                         ContentSettingsType.COOKIES,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
                 new ContentSettingException(
                         ContentSettingsType.POPUPS,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
                 new ContentSettingException(
                         ContentSettingsType.ADS,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
                 new ContentSettingException(
                         ContentSettingsType.JAVASCRIPT,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
                 new ContentSettingException(
                         ContentSettingsType.SOUND,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
                 new ContentSettingException(
                         ContentSettingsType.BACKGROUND_SYNC,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
                 new ContentSettingException(
                         ContentSettingsType.AUTOMATIC_DOWNLOADS,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
                 new ContentSettingException(
                         ContentSettingsType.INSECURE_PRIVATE_NETWORK,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
                 new ContentSettingException(
                         ContentSettingsType.JAVASCRIPT_JIT,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
                 new ContentSettingException(
                         ContentSettingsType.AUTO_DARK_WEB_CONTENT,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
                 new ContentSettingException(
                         ContentSettingsType.REQUEST_DESKTOP_SITE,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
                 new ContentSettingException(
                         ContentSettingsType.FEDERATED_IDENTITY_API,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
                 new ContentSettingException(
                         ContentSettingsType.FEDERATED_IDENTITY_AUTO_REAUTHN_PERMISSION,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
                 new ContentSettingException(
                         ContentSettingsType.ANTI_ABUSE,
                         ORIGIN,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         /* isEmbargoed= */ false));
 
         int storageSize = 256;
@@ -1140,7 +1140,7 @@
                                 type,
                                 ORIGIN,
                                 ContentSettingValues.DEFAULT,
-                                PREFERENCE_SOURCE,
+                                ProviderType.PREF_PROVIDER,
                                 isEmbargoed);
                 websitePreferenceBridge.addContentSettingException(fakeContentSettingException);
 
@@ -1164,7 +1164,7 @@
                                 type,
                                 ORIGIN,
                                 ContentSettingValues.BLOCK,
-                                PREFERENCE_SOURCE,
+                                ProviderType.PREF_PROVIDER,
                                 isEmbargoed);
                 websitePreferenceBridge.addContentSettingException(fakeContentSettingException);
 
@@ -1215,7 +1215,7 @@
                                 pair.first,
                                 pair.second,
                                 ContentSettingValues.DEFAULT,
-                                PREFERENCE_SOURCE,
+                                ProviderType.PREF_PROVIDER,
                                 EXPIRATION_IN_DAYS,
                                 isEmbargoed);
                 websitePreferenceBridge.addContentSettingException(fakeContentSettingException);
@@ -1241,7 +1241,7 @@
                                 pair.first,
                                 pair.second,
                                 ContentSettingValues.BLOCK,
-                                PREFERENCE_SOURCE,
+                                ProviderType.PREF_PROVIDER,
                                 EXPIRATION_IN_DAYS,
                                 isEmbargoed);
                 websitePreferenceBridge.addContentSettingException(fakeContentSettingException);
@@ -1466,7 +1466,7 @@
                             ContentSettingsType.COOKIES,
                             origin,
                             ContentSettingValues.ALLOW,
-                            PREFERENCE_SOURCE,
+                            ProviderType.PREF_PROVIDER,
                             /* isEmbargoed= */ false));
         }
 
@@ -1528,7 +1528,7 @@
                         origin,
                         origin,
                         ContentSettingValues.ALLOW,
-                        "source",
+                        ProviderType.NONE,
                         null,
                         false));
         websitePreferenceBridge.addContentSettingException(
@@ -1537,7 +1537,7 @@
                         origin,
                         origin,
                         ContentSettingValues.ASK,
-                        "source",
+                        ProviderType.NONE,
                         null,
                         false));
         fetcher.fetchAllPreferences(waiter);
@@ -1578,7 +1578,7 @@
                         ORIGIN,
                         EMBEDDER,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         EXPIRATION_IN_DAYS,
                         /* isEmbargoed= */ false));
         websitePreferenceBridge.addContentSettingException(
@@ -1587,7 +1587,7 @@
                         ORIGIN,
                         null,
                         ContentSettingValues.DEFAULT,
-                        PREFERENCE_SOURCE,
+                        ProviderType.PREF_PROVIDER,
                         EXPIRATION_IN_DAYS,
                         /* isEmbargoed= */ true));
 
@@ -1665,7 +1665,7 @@
                             ORIGIN,
                             embedder,
                             ContentSettingValues.DEFAULT,
-                            PREFERENCE_SOURCE,
+                            ProviderType.PREF_PROVIDER,
                             EXPIRATION_IN_DAYS,
                             isEmbargoed);
             websitePreferenceBridge.addContentSettingException(fakeContentSetting);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabModelMergingTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabModelMergingTest.java
index 0a44486..b0c5717 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabModelMergingTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabModelMergingTest.java
@@ -51,6 +51,7 @@
 import org.chromium.chrome.test.util.ChromeTabUtils;
 import org.chromium.content_public.browser.LoadUrlParams;
 import org.chromium.content_public.browser.test.util.TestThreadUtils;
+import org.chromium.ui.test.util.UiDisableIf;
 import org.chromium.ui.test.util.UiRestriction;
 
 import java.util.Collections;
@@ -613,6 +614,7 @@
     @Test
     @LargeTest
     @DisableIf.Build(sdk_is_less_than = VERSION_CODES.P)
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338997261
     public void testMergeOnMultiDisplay_CTA_Resumed_CTA2_Not_Resumed() throws TimeoutException {
         TestThreadUtils.runOnUiThreadBlocking(
                 () -> {
@@ -664,6 +666,7 @@
     @Test
     @LargeTest
     @DisableIf.Build(sdk_is_less_than = VERSION_CODES.P)
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338997261
     public void testMergeOnMultiDisplay_OnDisplayChanged() throws TimeoutException {
         TestThreadUtils.runOnUiThreadBlocking(
                 () -> {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/UndoTabModelTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/UndoTabModelTest.java
index 81b5c3e..d6a26e5 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/UndoTabModelTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/UndoTabModelTest.java
@@ -21,6 +21,7 @@
 import org.chromium.base.test.util.CommandLineFlags;
 import org.chromium.base.test.util.Criteria;
 import org.chromium.base.test.util.CriteriaHelper;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.MinAndroidSdkLevel;
 import org.chromium.base.test.util.Restriction;
 import org.chromium.base.test.util.UrlUtils;
@@ -36,6 +37,7 @@
 import org.chromium.chrome.test.util.ChromeTabUtils;
 import org.chromium.content_public.browser.LoadUrlParams;
 import org.chromium.content_public.browser.test.util.TestThreadUtils;
+import org.chromium.ui.test.util.UiDisableIf;
 import org.chromium.ui.test.util.UiRestriction;
 
 import java.util.concurrent.ExecutionException;
@@ -274,6 +276,7 @@
      */
     @Test
     @MediumTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338997949
     @CommandLineFlags.Add(ChromeSwitches.DISABLE_TAB_MERGING_FOR_TESTING)
     public void testOpenRecentlyClosedTabMultiWindow() throws TimeoutException {
         final ChromeTabbedActivity2 secondActivity =
@@ -353,6 +356,7 @@
      */
     @Test
     @MediumTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338997949
     @MinAndroidSdkLevel(24)
     @CommandLineFlags.Add(ChromeSwitches.DISABLE_TAB_MERGING_FOR_TESTING)
     public void testOpenRecentlyClosedTabMultiWindowFallback() throws TimeoutException {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappDisplayModeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappDisplayModeTest.java
index 558996d..b943fb1 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappDisplayModeTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappDisplayModeTest.java
@@ -20,6 +20,7 @@
 import org.chromium.base.test.util.Batch;
 import org.chromium.base.test.util.CommandLineFlags;
 import org.chromium.base.test.util.CriteriaHelper;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.Feature;
 import org.chromium.base.test.util.Restriction;
 import org.chromium.blink.mojom.DisplayMode;
@@ -32,6 +33,7 @@
 import org.chromium.content_public.browser.WebContents;
 import org.chromium.content_public.browser.test.util.JavaScriptUtils;
 import org.chromium.content_public.browser.test.util.TouchCommon;
+import org.chromium.ui.test.util.UiDisableIf;
 import org.chromium.ui.test.util.UiRestriction;
 
 import java.util.concurrent.TimeoutException;
@@ -59,6 +61,7 @@
 
     @Test
     @SmallTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/339000434
     @Feature({"Webapps"})
     public void testFullScreen() {
         WebappActivity activity = startActivity(DisplayMode.FULLSCREEN, "");
@@ -69,6 +72,7 @@
 
     @Test
     @MediumTest
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/339000434
     @Feature({"Webapps"})
     public void testFullScreenInFullscreen() {
         WebappActivity activity = startActivity(DisplayMode.FULLSCREEN, "fullscreen_on_click");
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ChromeBackupAgentTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ChromeBackupAgentTest.java
index 4627505..6a339ab 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/ChromeBackupAgentTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/ChromeBackupAgentTest.java
@@ -65,6 +65,7 @@
 import org.chromium.chrome.browser.flags.ChromeFeatureList;
 import org.chromium.chrome.browser.init.AsyncInitTaskRunner;
 import org.chromium.chrome.browser.init.ChromeBrowserInitializer;
+import org.chromium.chrome.browser.metrics.UmaSessionStats;
 import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
 import org.chromium.chrome.browser.profiles.Profile;
 import org.chromium.chrome.browser.profiles.ProfileManager;
@@ -102,8 +103,12 @@
 @RunWith(BaseRobolectricTestRunner.class)
 @Config(
         manifest = Config.NONE,
-        shadows = {ChromeBackupAgentTest.BackupManagerShadow.class})
+        shadows = {
+            ChromeBackupAgentTest.BackupManagerShadow.class,
+            ChromeBackupAgentTest.UmaSessionStatsShadow.class
+        })
 @DisableFeatures(SigninFeatures.ENTERPRISE_POLICY_ON_SIGNIN)
+@EnableFeatures(SigninFeatures.UPDATE_METRICS_SERVICES_STATE_IN_RESTORE)
 public class ChromeBackupAgentTest {
     @Rule public TemporaryFolder mTempDir = new TemporaryFolder();
     @Rule public JUnitProcessor mFeaturesProcessor = new JUnitProcessor();
@@ -127,6 +132,15 @@
         }
     }
 
+    /** Shadow to allow call to update metrics services states during the restore flow. */
+    @Implements(UmaSessionStats.class)
+    public static class UmaSessionStatsShadow {
+
+        // TODO(crbug.com/40075135): Test that this method is called during restoration.
+        @Implementation
+        public static void updateMetricsServiceState() {}
+    }
+
     @Rule public JniMocker mocker = new JniMocker();
 
     @Rule
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/signin/SigninManagerImplTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/signin/SigninManagerImplTest.java
index 38c4803..fea061c2 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/signin/SigninManagerImplTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/signin/SigninManagerImplTest.java
@@ -94,6 +94,7 @@
 /** Tests for {@link SigninManagerImpl}. */
 @RunWith(BaseRobolectricTestRunner.class)
 @LooperMode(LooperMode.Mode.LEGACY)
+@EnableFeatures(SigninFeatures.USE_CONSENT_LEVEL_SIGNIN_FOR_LEGACY_ACCOUNT_EMAIL_PREF)
 @DisableFeatures(SigninFeatures.ENTERPRISE_POLICY_ON_SIGNIN)
 public class SigninManagerImplTest {
     private static final long NATIVE_SIGNIN_MANAGER = 10001L;
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp
index ba8c341b..971ad02 100644
--- a/chrome/app/chromeos_strings.grdp
+++ b/chrome/app/chromeos_strings.grdp
@@ -280,9 +280,6 @@
   <message name="IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_RETRY" desc="Label for button informing user to retry rescan of QR Codes.">
     Try again
   </message>
-  <message name="IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_LOADING" desc="Label informing the user that the activation code is currently being verified.">
-    Verifying activation code...
-  </message>
   <message name="IDS_CELLULAR_SETUP_ESIM_PROFILE_INSTALLING_MESSAGE" desc="Label informing the user that an eSIM profile is being added, and that it may take a couple of minutes before it is complete.">
     Adding eSIM profile. This may take a few minutes.
   </message>
diff --git a/chrome/app/chromeos_strings_grdp/IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_LOADING.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_LOADING.png.sha1
deleted file mode 100644
index fbda174..0000000
--- a/chrome/app/chromeos_strings_grdp/IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_LOADING.png.sha1
+++ /dev/null
@@ -1 +0,0 @@
-d4eacbb65f2bb3f8dfd0fe98bba9dcbe43584db7
\ No newline at end of file
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd
index fd1dff1f..b6e73e59 100644
--- a/chrome/app/chromium_strings.grd
+++ b/chrome/app/chromium_strings.grd
@@ -852,6 +852,9 @@
       <message name="IDS_EXTENSIONS_SAFETY_CHECK_OFFSTORE_OFF" desc="Alerts the user that the extension is not from the Chrome web store.">
         Off • Chromium can't verify where this extension comes from
       </message>
+      <message name="IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES" desc="Alerts the user that the extension has not disclosed its privacy practices.">
+        This extension hasn't published privacy practices, such as how it collects and uses data. Chromium recommends that you remove it.
+      </message>
 
       <!-- chrome://settings/extensions page -->
   <message name="IDS_EXTENSIONS_SC_DESCRIPTION" desc="Detailed message displayed in the Safety Check description section.">
@@ -1069,10 +1072,10 @@
         <message name="IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNIN_SUBTITLE" desc="Subtitle of the Chromium Signin Bubble intercept that is shown when a signed out user signs in on the web with it's first account.">
           To save and use your passwords and more on all your devices, sign in to Chromium
         </message>
-        <message name="IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_VERIFY_BODY" translateable="false"  desc="This is the subtitle of an error message dialog that appears when the user opens the Chrome Profile Menu and chooses 'Sign out of Chrome'. The error message appears when the user has saved some data (like a password or payment method) to Chrome, but Chrome wasn't able to save the data to the user's Google Account due to a sign-in error; but, the data has been saved locally to Chrome. This subtitle is after the 'Some data isn’t saved yet' string. The tone should be cautionary, because we want to explain to the user that their data is not saved to their Google Account. This string provides a path to resolution because it explains how the user can properly save their data before they sign out of Chrome.">
+        <message name="IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_VERIFY_BODY" desc="This is the subtitle of an error message dialog that appears when the user opens the Chromium Profile Menu and chooses 'Sign out of Chromium'. The error message appears when the user has saved some data (like a password or payment method) to Chromium, but Chromium wasn't able to save the data to the user's Google Account due to a sign-in error; but, the data has been saved locally to Chromium. This subtitle is after the 'Some data isn’t saved yet' string. The tone should be cautionary, because we want to explain to the user that their data is not saved to their Google Account. This string provides a path to resolution because it explains how the user can properly save their data before they sign out of Chromium.">
           Chromium needs to verify it’s you before some data can be saved in your Google Account and used on all your devices. If you sign out, this data will stay on this device.
         </message>
-        <message name="IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_UNSYNCED_BODY" translateable="false"  desc="This is the subtitle of an error message dialog that appears when the user opens the Chrome Profile Menu and chooses 'Sign out of Chrome'. The error message appears when the user has saved some data (like a password or payment method) to Chrome, but Chrome wasn't able to save the data to the user's Google Account due to a sign-in error; but, the data has been saved locally to Chrome. This subtitle is after the 'Some data isn’t saved yet' string. The tone should be cautionary, because we want to explain to the user that their data is not saved to their Google Account. This string provides a path to resolution because it explains how the user can properly save their data before they sign out of Chrome.">
+        <message name="IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_UNSYNCED_BODY"  desc="This is the subtitle of an error message dialog that appears when the user opens the Chromium Profile Menu and chooses 'Sign out of Chromium'. The error message appears when the user tries to sign out immediately after having saved saved some data (like a password or payment method) to Chromium and Chromium hasn't had time to save that data to the user's Google Account yet. This subtitle is after the 'Some data isn't saved yet' string. The tone should be cautionary, because we want to explain to the user that their data is not saved to their Google Account. This string asks the user to wait a few minutes before trying to sign out again.">
           Some of your Chromium data hasn't been saved in your Google Account yet. Try waiting a few minutes before signing out.
         </message>
         <message name="IDS_CLOSE_WARNING_FOR_CLEAR_COOKIES_ON_EXIT_TEXT" desc="Body of a notice displayed when closing the last Chrome window, to inform the user about a change in the way the 'Clear cookie on exit' setting works.">
@@ -1147,6 +1150,10 @@
         <message name="IDS_PROFILE_MENU_MANAGE_PROFILES" desc="The text label of the Manage Chromium Profiles item in the Profile Menu.">
           Manage Chromium profiles
         </message>
+        <message name="IDS_PROFILE_MENU_SIGN_OUT"
+          desc="The text label of the Sign out of Chromium button in the Profile Menu.">
+          Sign out of Chromium
+        </message>
       </if>
       <if expr="use_titlecase">
         <message name="IDS_PROFILE_MENU_CUSTOMIZE_PROFILE_BUTTON" desc="The text label of the Customize Chromium button in the Profile Menu.">
@@ -1158,6 +1165,10 @@
         <message name="IDS_PROFILE_MENU_MANAGE_PROFILES" desc="The text label of the Manage Chromium Profiles item in the Profile Menu.">
           Manage Chromium Profiles
         </message>
+        <message name="IDS_PROFILE_MENU_SIGN_OUT"
+          desc="The text label of the Sign out of Chromium button in the Profile Menu.">
+          Sign Out of Chromium
+        </message>
       </if>
 
       <!-- App list -->
@@ -1751,10 +1762,10 @@
         </message>
 
         <!-- Web Signout Intercept IPH -->
-        <message name="IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT" translateable="false" desc="This confirmation message is intended to help users to understand that signing out of a Google service (like Gmail) will not sign them out of Chrome. It appears in a blue in-product help bubble, which points to the Chrome Profile Menu; it appears after the user signs out of a Google service (like Gmail). The user can open the Profile Menu and sign out of Chrome, if they wish to do so.">
+        <message name="IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT" desc="This confirmation message is intended to help users to understand that signing out of a Google service (like Gmail) will not sign them out of Chromium. It appears in a blue in-product help bubble, which points to the Chromium Profile Menu; it appears after the user signs out of a Google service (like Gmail). The user can open the Profile Menu and sign out of Chromium, if they wish to do so.">
           To remove your Google Account from Chromium, sign out
         </message>
-        <message name="IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT_SCREENREADER" translateable="false" desc="Text announced by screenreaders related to the confirmation message is intended to help users to understand that signing out of a Google service (like Gmail) will not sign them out of Chrome. It appears in a blue in-product help bubble, which points to the Chrome Profile Menu; it appears after the user signs out of a Google service (like Gmail). The user can open the Profile Menu and sign out of Chrome, if they wish to do so.">
+        <message name="IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT_SCREENREADER" desc="Text announced by screenreaders related to the confirmation message is intended to help users to understand that signing out of a Google service (like Gmail) will not sign them out of Chromium. It appears in a blue in-product help bubble, which points to the Chromium Profile Menu; it appears after the user signs out of a Google service (like Gmail). The user can open the Profile Menu and sign out of Chromium, if they wish to do so.">
           To remove your Google Account from Chromium, sign out of Chromium in the Settings page
         </message>
       </if>
diff --git a/chrome/app/chromium_strings_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_UNSYNCED_BODY.png.sha1 b/chrome/app/chromium_strings_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_UNSYNCED_BODY.png.sha1
new file mode 100644
index 0000000..013e61c
--- /dev/null
+++ b/chrome/app/chromium_strings_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_UNSYNCED_BODY.png.sha1
@@ -0,0 +1 @@
+17b5112138b59dbcb0e37680a6a9fbb6bb535f54
\ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_VERIFY_BODY.png.sha1 b/chrome/app/chromium_strings_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_VERIFY_BODY.png.sha1
new file mode 100644
index 0000000..1193608
--- /dev/null
+++ b/chrome/app/chromium_strings_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_VERIFY_BODY.png.sha1
@@ -0,0 +1 @@
+aa6e5510da0ea2606313ea1b00e41aef7117bfe6
\ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES.png.sha1 b/chrome/app/chromium_strings_grd/IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES.png.sha1
new file mode 100644
index 0000000..f0960bb
--- /dev/null
+++ b/chrome/app/chromium_strings_grd/IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES.png.sha1
@@ -0,0 +1 @@
+b932fa6c0acbe0744522a29c0da7e3098864b511
\ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_PROFILE_MENU_SIGN_OUT.png.sha1 b/chrome/app/chromium_strings_grd/IDS_PROFILE_MENU_SIGN_OUT.png.sha1
new file mode 100644
index 0000000..2d9c0b9
--- /dev/null
+++ b/chrome/app/chromium_strings_grd/IDS_PROFILE_MENU_SIGN_OUT.png.sha1
@@ -0,0 +1 @@
+58753221d8513721593dd6964bd8399ecaec10d1
\ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT.png.sha1 b/chrome/app/chromium_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT.png.sha1
index 4feca07..0cd2860 100644
--- a/chrome/app/chromium_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT.png.sha1
+++ b/chrome/app/chromium_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT.png.sha1
@@ -1 +1 @@
-afa33f5ffc7ac4ba0b1995590030fbc7c1776f9e
\ No newline at end of file
+4362a33d0ef7ac6af3a7a1c211bd12ee47675909
\ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT_SCREENREADER.png.sha1 b/chrome/app/chromium_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT_SCREENREADER.png.sha1
index 4feca07..0cd2860 100644
--- a/chrome/app/chromium_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT_SCREENREADER.png.sha1
+++ b/chrome/app/chromium_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT_SCREENREADER.png.sha1
@@ -1 +1 @@
-afa33f5ffc7ac4ba0b1995590030fbc7c1776f9e
\ No newline at end of file
+4362a33d0ef7ac6af3a7a1c211bd12ee47675909
\ No newline at end of file
diff --git a/chrome/app/extensions_strings.grdp b/chrome/app/extensions_strings.grdp
index cff745e..a341eb7d 100644
--- a/chrome/app/extensions_strings.grdp
+++ b/chrome/app/extensions_strings.grdp
@@ -566,6 +566,12 @@
   <message name="IDS_EXTENSIONS_SC_UNPUBLISHED_ON" desc="The text explaining the reason for extension being potentially unsafe. The extension was unpublished by its developer and is turned on.">
     On • This extension was unpublished by its developer
   </message>
+  <message name="IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES_ON" desc="The text explaining that an enabled extension has not disclosed its privacy practices.">
+    On • This extension hasn't published privacy practices, such as how it collects and uses data
+  </message>
+  <message name="IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES_OFF" desc="The text explaining that a disabled extension has not disclosed its privacy practices.">
+    Off • This extension hasn't published privacy practices, such as how it collects and uses data
+  </message>
   <message name="IDS_EXTENSIONS_SC_TITLE" desc="Header text displayed in the Safety Check title.">
     {NUM_EXTENSIONS, plural,
      =1 {Review 1 extension that may be unsafe}
diff --git a/chrome/app/extensions_strings_grdp/IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES_OFF.png.sha1 b/chrome/app/extensions_strings_grdp/IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES_OFF.png.sha1
new file mode 100644
index 0000000..bba2381
--- /dev/null
+++ b/chrome/app/extensions_strings_grdp/IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES_OFF.png.sha1
@@ -0,0 +1 @@
+580e032931b6317a2a0d761e0341fb6825be500f
\ No newline at end of file
diff --git a/chrome/app/extensions_strings_grdp/IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES_ON.png.sha1 b/chrome/app/extensions_strings_grdp/IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES_ON.png.sha1
new file mode 100644
index 0000000..dc97c20
--- /dev/null
+++ b/chrome/app/extensions_strings_grdp/IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES_ON.png.sha1
@@ -0,0 +1 @@
+b7180f38d95069d192c3c88a3c78b1bbb6b9e3b7
\ No newline at end of file
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index cb2722c..2646d72 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -12845,13 +12845,13 @@
         </message>
 
         <!-- Chrome Signout Confirmation Prompt -->
-        <message name="IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_TITLE" translateable="false"  desc="This is the title of an error message dialog that appears when the user opens the Chrome Profile Menu and chooses 'Sign out of Chrome'. The error message appears when the user has saved some data (like a password or payment method) to Chrome, but Chrome wasn't able to save the data to the user's Google Account due to a sign-in error; but, the data has been saved locally to Chrome. This title is before the 'Chrome needs to verify it’s you before some data can be saved in your Google Account and used on all your devices. If you sign out, this data will stay on this device.' string. The tone should be cautionary.">
-          Some data isn’t saved yet
+        <message name="IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_TITLE"  desc="This is the title of an error message dialog that appears when the user opens the Chrome Profile Menu and chooses 'Sign out of Chrome'. The error message appears when the user has saved some data (like a password or payment method) to Chrome, but Chrome wasn't able to save the data to the user's Google Account due to a sign-in error; but, the data has been saved locally to Chrome. This title is before the 'Chrome needs to verify it’s you before some data can be saved in your Google Account and used on all your devices. If you sign out, this data will stay on this device.' string. The tone should be cautionary.">
+          Some data isn’t saved in your account yet
         </message>
         <message name="IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_VERIFY_BUTTON" translateable="false"  desc="Text displayed the default button of the Chrome signout confirmation prompt. The user will then be asked to reauthenticate.">
           Verify it’s you
         </message>
-        <message name="IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_SIGNOUT_BUTTON" translateable="false"  desc="This string is found on a button that lets the user sign out of Chrome when the user taps it. It is on an error message dialog that appears when the user opens the Chrome Profile Menu and chooses 'Sign out of Chrome'. The error message appears when the user has saved some data (like a password or payment method) to Chrome, but Chrome wasn't able to save the data to the user's Google Account due to a sign-in error; but, the data has been saved locally to Chrome. This text is a verb and is short for the longer phrase 'Sign out of Chrome anyway.'">
+        <message name="IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_SIGNOUT_BUTTON" desc="This string is found on a button that lets the user sign out of Chrome when the user taps it. It is on an error message dialog that appears when the user opens the Chrome Profile Menu and chooses 'Sign out of Chrome'. The error message appears when the user has saved some data (like a password or payment method) to Chrome, but Chrome wasn't able to save the data to the user's Google Account due to a sign-in error; but, the data has been saved locally to Chrome. This text is a verb and is short for the longer phrase 'Sign out of Chrome anyway.'">
           Sign out anyway
         </message>
 
@@ -13209,7 +13209,7 @@
       <message name="IDS_SYNC_ERROR_USER_MENU_CONFIRM_SYNC_SETTINGS_BUTTON" desc="Button in the header of desktop user menu prompting users to confirm their sync settings.">
         Open settings
       </message>
-      <message name="IDS_SIGNIN_PAUSED_USER_MENU_VERIFY_MESSAGE" translateable="false" desc="This is the text of a card that means the user needs to sign back in to Chrome in order to continue saving and using data (like passwords or payment methods) in their Google Account. This is an error message that appears when the user's sign-in credential has expired; to fix the issue, the user needs to sign back in. The tone should be straightforward and motivating.">
+      <message name="IDS_SIGNIN_PAUSED_USER_MENU_VERIFY_MESSAGE" desc="This is the text of a card that means the user needs to sign back in to Chrome in order to continue saving and using data (like passwords or payment methods) in their Google Account. This is an error message that appears when the user's sign-in credential has expired; to fix the issue, the user needs to sign back in. The tone should be straightforward and motivating.">
         To keep using the passwords and more in your Google Account, verify it's you
       </message>
 
diff --git a/chrome/app/generated_resources_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_SIGNOUT_BUTTON.png.sha1 b/chrome/app/generated_resources_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_SIGNOUT_BUTTON.png.sha1
new file mode 100644
index 0000000..707c548
--- /dev/null
+++ b/chrome/app/generated_resources_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_SIGNOUT_BUTTON.png.sha1
@@ -0,0 +1 @@
+22fc6290b96c91e4764716a26a9afa336dd6292f
\ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_TITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_TITLE.png.sha1
new file mode 100644
index 0000000..3acfef9d
--- /dev/null
+++ b/chrome/app/generated_resources_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_TITLE.png.sha1
@@ -0,0 +1 @@
+3a773f61d2cd00a4d18d910ee62e3437844aaa8e
\ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_SIGNIN_PAUSED_USER_MENU_VERIFY_MESSAGE.png.sha1 b/chrome/app/generated_resources_grd/IDS_SIGNIN_PAUSED_USER_MENU_VERIFY_MESSAGE.png.sha1
index 52caff09..ea98095 100644
--- a/chrome/app/generated_resources_grd/IDS_SIGNIN_PAUSED_USER_MENU_VERIFY_MESSAGE.png.sha1
+++ b/chrome/app/generated_resources_grd/IDS_SIGNIN_PAUSED_USER_MENU_VERIFY_MESSAGE.png.sha1
@@ -1 +1 @@
-06ff81ec7e8927b1fd272d0156010d85210d27a1
\ No newline at end of file
+830644d1e47a1cbf3b22aeefe9efde35ec1161ec
\ No newline at end of file
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd
index c4e5a38..2ed1833 100644
--- a/chrome/app/google_chrome_strings.grd
+++ b/chrome/app/google_chrome_strings.grd
@@ -830,6 +830,9 @@
       <message name="IDS_EXTENSIONS_SAFETY_CHECK_OFFSTORE_OFF" desc="Alerts the user that the extension is not from the Chrome web store.">
         Off • Chrome can't verify where this extension comes from
       </message>
+      <message name="IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES" desc="Alerts the user that the extension has not disclosed its privacy practices.">
+        This extension hasn't published privacy practices, such as how it collects and uses data. Chrome recommends that you remove it.
+      </message>
 
       <!-- chrome://settings/extensions page -->
     <message name="IDS_EXTENSIONS_SC_DESCRIPTION" desc="Detailed message displayed in the Safety Check description section.">
@@ -1027,10 +1030,10 @@
         <message name="IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNIN_SUBTITLE" desc="Subtitle of the Chrome Signin Bubble intercept that is shown when a signed out user signs in on the web with it's first account.">
           To save and use your passwords and more on all your devices, sign in to Chrome
         </message>
-        <message name="IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_VERIFY_BODY" translateable="false"  desc="This is the subtitle of an error message dialog that appears when the user opens the Chrome Profile Menu and chooses 'Sign out of Chrome'. The error message appears when the user has saved some data (like a password or payment method) to Chrome, but Chrome wasn't able to save the data to the user's Google Account due to a sign-in error; but, the data has been saved locally to Chrome. This subtitle is after the 'Some data isn’t saved yet' string. The tone should be cautionary, because we want to explain to the user that their data is not saved to their Google Account. This string provides a path to resolution because it explains how the user can properly save their data before they sign out of Chrome.">
+        <message name="IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_VERIFY_BODY" desc="This is the subtitle of an error message dialog that appears when the user opens the Chrome Profile Menu and chooses 'Sign out of Chrome'. The error message appears when the user has saved some data (like a password or payment method) to Chrome, but Chrome wasn't able to save the data to the user's Google Account due to a sign-in error; but, the data has been saved locally to Chrome. This subtitle is after the 'Some data isn’t saved yet' string. The tone should be cautionary, because we want to explain to the user that their data is not saved to their Google Account. This string provides a path to resolution because it explains how the user can properly save their data before they sign out of Chrome.">
           Chrome needs to verify it’s you before some data can be saved in your Google Account and used on all your devices. If you sign out, this data will stay on this device.
         </message>
-        <message name="IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_UNSYNCED_BODY" translateable="false"  desc="This is the subtitle of an error message dialog that appears when the user opens the Chrome Profile Menu and chooses 'Sign out of Chrome'. The error message appears when the user has saved some data (like a password or payment method) to Chrome, but Chrome wasn't able to save the data to the user's Google Account due to a sign-in error; but, the data has been saved locally to Chrome. This subtitle is after the 'Some data isn’t saved yet' string. The tone should be cautionary, because we want to explain to the user that their data is not saved to their Google Account. This string provides a path to resolution because it explains how the user can properly save their data before they sign out of Chrome.">
+        <message name="IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_UNSYNCED_BODY" desc="This is the subtitle of an error message dialog that appears when the user opens the Chrome Profile Menu and chooses 'Sign out of Chrome'. The error message appears when the user tries to sign out immediately after having saved saved some data (like a password or payment method) to Chrome and Chrome hasn't had time to save that data to the user's Google Account yet. This subtitle is after the 'Some data isn't saved yet' string. The tone should be cautionary, because we want to explain to the user that their data is not saved to their Google Account. This string asks the user to wait a few minutes before trying to sign out again.">
           Some of your Chrome data hasn't been saved in your Google Account yet. Try waiting a few minutes before signing out.
         </message>
         <message name="IDS_CLOSE_WARNING_FOR_CLEAR_COOKIES_ON_EXIT_TEXT" desc="Body of a notice displayed when closing the last Chrome window, to inform the user about a change in the way the 'Clear cookie on exit' setting works.">
@@ -1117,6 +1120,9 @@
         <message name="IDS_PROFILE_MENU_MANAGE_PROFILES" desc="The text label of the Manage Chrome Profiles item in the Profile Menu.">
           Manage Chrome profiles
         </message>
+        <message name="IDS_PROFILE_MENU_SIGN_OUT" desc="The text label of the Sign out of Chrome button in the Profile Menu.">
+          Sign out of Chrome
+        </message>
       </if>
       <if expr="use_titlecase">
         <message name="IDS_PROFILE_MENU_CUSTOMIZE_PROFILE_BUTTON" desc="The text label of the Customize Chrome button in the Profile Menu.">
@@ -1128,6 +1134,9 @@
         <message name="IDS_PROFILE_MENU_MANAGE_PROFILES" desc="The text label of the Manage Chrome Profiles item in the Profile Menu.">
           Manage Chrome Profiles
         </message>
+        <message name="IDS_PROFILE_MENU_SIGN_OUT" desc="The text label of the Sign out of Chrome button in the Profile Menu.">
+          Sign Out of Chrome
+        </message>
       </if>
 
       <!-- App list -->
@@ -1762,10 +1771,10 @@
         </message>
 
         <!-- Web Signout Intercept IPH -->
-        <message name="IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT" translateable="false" desc="This confirmation message is intended to help users to understand that signing out of a Google service (like Gmail) will not sign them out of Chrome. It appears in a blue in-product help bubble, which points to the Chrome Profile Menu; it appears after the user signs out of a Google service (like Gmail). The user can open the Profile Menu and sign out of Chrome, if they wish to do so.">
+        <message name="IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT" desc="This confirmation message is intended to help users to understand that signing out of a Google service (like Gmail) will not sign them out of Chrome. It appears in a blue in-product help bubble, which points to the Chrome Profile Menu; it appears after the user signs out of a Google service (like Gmail). The user can open the Profile Menu and sign out of Chrome, if they wish to do so.">
           To remove your Google Account from Chrome, sign out
         </message>
-        <message name="IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT_SCREENREADER" translateable="false" desc="Text announced by screenreaders related to the confirmation message is intended to help users to understand that signing out of a Google service (like Gmail) will not sign them out of Chrome. It appears in a blue in-product help bubble, which points to the Chrome Profile Menu; it appears after the user signs out of a Google service (like Gmail). The user can open the Profile Menu and sign out of Chrome, if they wish to do so.">
+        <message name="IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT_SCREENREADER" desc="Text announced by screenreaders related to the confirmation message is intended to help users to understand that signing out of a Google service (like Gmail) will not sign them out of Chrome. It appears in a blue in-product help bubble, which points to the Chrome Profile Menu; it appears after the user signs out of a Google service (like Gmail). The user can open the Profile Menu and sign out of Chrome, if they wish to do so.">
           To remove your Google Account from Chrome, sign out of Chrome in the Settings page
         </message>
       </if>
diff --git a/chrome/app/google_chrome_strings_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_UNSYNCED_BODY.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_UNSYNCED_BODY.png.sha1
new file mode 100644
index 0000000..6b2c8e7
--- /dev/null
+++ b/chrome/app/google_chrome_strings_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_UNSYNCED_BODY.png.sha1
@@ -0,0 +1 @@
+fff5bcbb06f27e9837aecd70c2267964c28060e2
\ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_VERIFY_BODY.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_VERIFY_BODY.png.sha1
new file mode 100644
index 0000000..f8fe6a6
--- /dev/null
+++ b/chrome/app/google_chrome_strings_grd/IDS_CHROME_SIGNOUT_CONFIRMATION_PROMPT_VERIFY_BODY.png.sha1
@@ -0,0 +1 @@
+4a27bed30a5057760ddea3761e9c7d7638236df5
\ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES.png.sha1
new file mode 100644
index 0000000..f0960bb
--- /dev/null
+++ b/chrome/app/google_chrome_strings_grd/IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES.png.sha1
@@ -0,0 +1 @@
+b932fa6c0acbe0744522a29c0da7e3098864b511
\ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_PROFILE_MENU_SIGN_OUT.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_PROFILE_MENU_SIGN_OUT.png.sha1
new file mode 100644
index 0000000..49abb5f
--- /dev/null
+++ b/chrome/app/google_chrome_strings_grd/IDS_PROFILE_MENU_SIGN_OUT.png.sha1
@@ -0,0 +1 @@
+25f4a66e0b1bda84be4cd1d5d7bf7a6e29d93b19
\ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT.png.sha1
index 4bd211e..9d91bab 100644
--- a/chrome/app/google_chrome_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT.png.sha1
+++ b/chrome/app/google_chrome_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT.png.sha1
@@ -1 +1 @@
-1146d91b47edf649cea7fd5d4bbd978fddc58875
\ No newline at end of file
+2af0c7887ea9e01000032484c862b0f3fb44439f
\ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT_SCREENREADER.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT_SCREENREADER.png.sha1
index 4bd211e..9d91bab 100644
--- a/chrome/app/google_chrome_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT_SCREENREADER.png.sha1
+++ b/chrome/app/google_chrome_strings_grd/IDS_SIGNOUT_DICE_WEB_INTERCEPT_BUBBLE_CHROME_SIGNOUT_IPH_TEXT_SCREENREADER.png.sha1
@@ -1 +1 @@
-1146d91b47edf649cea7fd5d4bbd978fddc58875
\ No newline at end of file
+2af0c7887ea9e01000032484c862b0f3fb44439f
\ No newline at end of file
diff --git a/chrome/app/profiles_strings.grdp b/chrome/app/profiles_strings.grdp
index 4fed1a9..bfad910 100644
--- a/chrome/app/profiles_strings.grdp
+++ b/chrome/app/profiles_strings.grdp
@@ -83,9 +83,6 @@
   <message name="IDS_PROFILES_SYNC_COMPLETE_TITLE" desc="Title of the profile card when sync is complete.">
     Syncing to
   </message>
-  <message name="IDS_PROFILES_OPEN_SYNC_SETTINGS_BUTTON" desc="Button in the profile menu to open sync settings when sync is on.">
-    Sync is on
-  </message>
   <message name="IDS_PROFILES_DICE_SIGNIN_BUTTON" desc="Button in the profile user menu to sign in and turn on Sync.">
     Turn on sync...
   </message>
@@ -147,6 +144,9 @@
     <message name="IDS_PROFILE_MENU_ADD_NEW_PROFILE" desc="The text label of the add new profile item in the profile menu.">
       Add new profile
     </message>
+    <message name="IDS_PROFILES_OPEN_SYNC_SETTINGS_BUTTON" desc="Button in the profile menu to open sync settings when sync is on.">
+      Sync is on
+    </message>
   </if>
   <if expr="use_titlecase">
     <message name="IDS_PROFILES_LIST_PROFILES_TITLE" desc="Title in the profile menu for the list of 'other profiles'.">
@@ -170,6 +170,9 @@
     <message name="IDS_PROFILE_MENU_ADD_NEW_PROFILE" desc="The text label of the add new profile item in the profile menu.">
       Add New Profile
     </message>
+    <message name="IDS_PROFILES_OPEN_SYNC_SETTINGS_BUTTON" desc="Button in the profile menu to open sync settings when sync is on.">
+      Sync Is On
+    </message>
   </if>
   <message name="IDS_PROFILES_MANAGED_BY" desc="Label shown under the avatar in the avatar menu bubble view stating that the account is managed.">
     managed by <ph name="VALUE">$1<ex>1</ex></ph>
diff --git a/chrome/app/profiles_strings_grdp/IDS_PROFILES_OPEN_SYNC_SETTINGS_BUTTON.png.sha1 b/chrome/app/profiles_strings_grdp/IDS_PROFILES_OPEN_SYNC_SETTINGS_BUTTON.png.sha1
new file mode 100644
index 0000000..a80b31b
--- /dev/null
+++ b/chrome/app/profiles_strings_grdp/IDS_PROFILES_OPEN_SYNC_SETTINGS_BUTTON.png.sha1
@@ -0,0 +1 @@
+da2ce2723ca9770c561d57326e408bae86a29c86
\ No newline at end of file
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp
index f24147a..895e4e0 100644
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -3914,9 +3914,6 @@
   <message name="IDS_SETTINGS_SYNC_WILL_START" desc="The message to tell users that sync will start once they leave the sync setup page.">
     Sync will start once you leave sync settings
   </message>
-  <message name="IDS_SETTINGS_MANAGE_GOOGLE_ACCOUNT" desc="Label for the button that takes the user to the Google Account website.">
-    Manage your Google Account
-  </message>
   <message name="IDS_SETTINGS_USER_EVENTS_CHECKBOX_LABEL" desc="Label for the checkbox which enables or disables recording user events.">
     Activity and interactions
   </message>
@@ -3954,6 +3951,17 @@
     Ask me every time
   </message>
 
+  <if expr="not use_titlecase">
+    <message name="IDS_SETTINGS_MANAGE_GOOGLE_ACCOUNT" desc="Label for the button that takes the user to the Google Account website.">
+      Manage your Google Account
+    </message>
+  </if>
+  <if expr="use_titlecase">
+    <message name="IDS_SETTINGS_MANAGE_GOOGLE_ACCOUNT" desc="Label for the button that takes the user to the Google Account website.">
+      Manage Your Google Account
+    </message>
+  </if>
+
   <if expr="not is_chromeos">
     <!-- Import Settings Dialog -->
     <message name="IDS_SETTINGS_IMPORT_SETTINGS_TITLE" desc="Dialog title for import dialog.">
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_MANAGE_GOOGLE_ACCOUNT.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_MANAGE_GOOGLE_ACCOUNT.png.sha1
new file mode 100644
index 0000000..f58ff5b
--- /dev/null
+++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_MANAGE_GOOGLE_ACCOUNT.png.sha1
@@ -0,0 +1 @@
+a4cdd0531a28da628bdf50d3b1d66f1eaf7eaa29
\ No newline at end of file
diff --git a/chrome/app/theme/chrome_unscaled_resources.grd b/chrome/app/theme/chrome_unscaled_resources.grd
index 85514f21..2b2b7bf8 100644
--- a/chrome/app/theme/chrome_unscaled_resources.grd
+++ b/chrome/app/theme/chrome_unscaled_resources.grd
@@ -87,6 +87,12 @@
             <then>
               <include name="IDR_PRODUCT_LOGO_SVG" file="chromium/product_logo.svg" type="BINDATA" />
               <include name="IDR_PRODUCT_LOGO_ANIMATION_SVG" file="chromium/product_logo_animation.svg" type="BINDATA" />
+              <include name="IDR_PRODUCT_LOGO_16_CFT_SHORTCUTS" file="google_chrome/google_chrome_for_testing/product_logo_16.png" type="BINDATA" />
+              <include name="IDR_PRODUCT_LOGO_24_CFT_SHORTCUTS" file="google_chrome/google_chrome_for_testing/product_logo_24.png" type="BINDATA" />
+              <include name="IDR_PRODUCT_LOGO_32_CFT_SHORTCUTS" file="google_chrome/google_chrome_for_testing/product_logo_32.png" type="BINDATA" />
+              <include name="IDR_PRODUCT_LOGO_48_CFT_SHORTCUTS" file="google_chrome/google_chrome_for_testing/product_logo_48.png" type="BINDATA" />
+              <include name="IDR_PRODUCT_LOGO_64_CFT_SHORTCUTS" file="google_chrome/google_chrome_for_testing/product_logo_64.png" type="BINDATA" />
+              <include name="IDR_PRODUCT_LOGO_128_CFT_SHORTCUTS" file="google_chrome/google_chrome_for_testing/product_logo_128.png" type="BINDATA" />
             </then>
             <else> <!-- not _is_chrome_for_testing_branded -->
               <include name="IDR_PRODUCT_LOGO_SVG" file="${branding_path_component}/product_logo.svg" type="BINDATA" />
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index f59f2e2..7b3a490 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -420,16 +420,6 @@
      blink::switches::kTouchTextSelectionStrategy,
      blink::switches::kTouchTextSelectionStrategy_Direction}};
 
-const FeatureEntry::Choice kEnablePasswordSharingChoices[] = {
-    {"Default", "", ""},
-    {"Bootstraping Only", switches::kEnableFeatures,
-     "SharingOfferKeyPairBootstrap"},
-    {"Enabled", switches::kEnableFeatures,
-     "SharingOfferKeyPairBootstrap,SendPasswords,"
-     "PasswordManagerEnableSenderService,"
-     "PasswordManagerEnableReceiverService,SharedPasswordNotificationUI"},
-};
-
 const FeatureEntry::Choice kEnableSearchEngineChoice[] = {
     {"Default", "", ""},
     {"Enabled", switches::kEnableFeatures,
@@ -4112,6 +4102,9 @@
      flag_descriptions::kCrasProcessorDedicatedThreadName,
      flag_descriptions::kCrasProcessorDedicatedThreadDescription, kOsCrOS,
      PLATFORM_FEATURE_NAME_TYPE("CrOSLateBootCrasProcessorDedicatedThread")},
+    {"cras-processor-wav-dump", flag_descriptions::kCrasProcessorWavDumpName,
+     flag_descriptions::kCrasProcessorWavDumpDescription, kOsCrOS,
+     PLATFORM_FEATURE_NAME_TYPE("CrOSLateBootCrasProcessorWavDump")},
     {"cras-split-alsa-usb-internal",
      flag_descriptions::kCrasSplitAlsaUsbInternalName,
      flag_descriptions::kCrasSplitAlsaUsbInternalDescription, kOsCrOS,
@@ -5058,11 +5051,11 @@
      flag_descriptions::kCastEnableStreamingWithHiDPIName,
      flag_descriptions::kCastEnableStreamingWithHiDPIDescription, kOsDesktop,
      FEATURE_VALUE_TYPE(mirroring::features::kCastEnableStreamingWithHiDPI)},
-#endif  // !BUILDFLAG(IS_ANDROID)
 
     {"password-sharing", flag_descriptions::kEnablePasswordSharingName,
-     flag_descriptions::kEnablePasswordSharingDescription, kOsAll,
-     MULTI_VALUE_TYPE(kEnablePasswordSharingChoices)},
+     flag_descriptions::kEnablePasswordSharingDescription, kOsDesktop,
+     FEATURE_VALUE_TYPE(password_manager::features::kSendPasswords)},
+#endif  // !BUILDFLAG(IS_ANDROID)
 
     {"enable-search-engine-choice",
      flag_descriptions::kEnableSearchEngineChoiceName,
diff --git a/chrome/browser/android/preferences/autofill/autofill_payment_methods_delegate.cc b/chrome/browser/android/preferences/autofill/autofill_payment_methods_delegate.cc
index 24d1877..5c677a73 100644
--- a/chrome/browser/android/preferences/autofill/autofill_payment_methods_delegate.cc
+++ b/chrome/browser/android/preferences/autofill/autofill_payment_methods_delegate.cc
@@ -18,6 +18,7 @@
 #include "components/autofill/core/browser/payments/payments_network_interface.h"
 #include "components/autofill/core/browser/payments/virtual_card_enrollment_flow.h"
 #include "components/autofill/core/browser/payments/virtual_card_enrollment_manager.h"
+#include "components/autofill/core/browser/payments_data_manager.h"
 #include "components/autofill/core/browser/personal_data_manager.h"
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 #include "url/android/gurl_android.h"
@@ -72,8 +73,8 @@
     JNIEnv* env,
     int64_t instrument_id,
     const JavaParamRef<jobject>& jcallback) {
-  CreditCard* credit_card =
-      personal_data_manager_->GetCreditCardByInstrumentId(instrument_id);
+  CreditCard* credit_card = personal_data_manager_->payments_data_manager()
+                                .GetCreditCardByInstrumentId(instrument_id);
   virtual_card_enrollment_manager_->InitVirtualCardEnroll(
       *credit_card, VirtualCardEnrollmentSource::kSettingsPage, std::nullopt,
       profile_->GetPrefs(), base::BindOnce(&risk_util::LoadRiskDataHelper),
diff --git a/chrome/browser/android/signin/OWNERS b/chrome/browser/android/signin/OWNERS
index 08233e8..5c043ac 100644
--- a/chrome/browser/android/signin/OWNERS
+++ b/chrome/browser/android/signin/OWNERS
@@ -9,5 +9,6 @@
 # chrome-signin-android-reviews@google.com!
 
 bsazonov@chromium.org       #{LAST_RESORT_SUGGESTION}
+myuu@google.com             #{LAST_RESORT_SUGGESTION}
 samarchehade@google.com     #{LAST_RESORT_SUGGESTION}
 triploblastic@chromium.org  #{LAST_RESORT_SUGGESTION}
diff --git a/chrome/browser/autofill/android/personal_data_manager_android.cc b/chrome/browser/autofill/android/personal_data_manager_android.cc
index 40bf4fb2..1da74d3 100644
--- a/chrome/browser/autofill/android/personal_data_manager_android.cc
+++ b/chrome/browser/autofill/android/personal_data_manager_android.cc
@@ -24,6 +24,7 @@
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/common/pref_names.h"
+#include "components/autofill/core/browser/address_data_manager.h"
 #include "components/autofill/core/browser/autofill_data_util.h"
 #include "components/autofill/core/browser/autofill_experiments.h"
 #include "components/autofill/core/browser/autofill_type.h"
@@ -250,9 +251,9 @@
       g_browser_process->GetApplicationLocale());
 
   if (guid.empty()) {
-    personal_data_manager_->AddProfile(profile);
+    personal_data_manager_->address_data_manager().AddProfile(profile);
   } else {
-    personal_data_manager_->UpdateProfile(profile);
+    personal_data_manager_->address_data_manager().UpdateProfile(profile);
   }
 
   return ConvertUTF8ToJavaString(env, profile.guid());
@@ -269,9 +270,9 @@
       jprofile, target_profile, g_browser_process->GetApplicationLocale());
 
   if (target_profile != nullptr) {
-    personal_data_manager_->UpdateProfile(profile);
+    personal_data_manager_->address_data_manager().UpdateProfile(profile);
   } else {
-    personal_data_manager_->AddProfile(profile);
+    personal_data_manager_->address_data_manager().AddProfile(profile);
   }
 
   return ConvertUTF8ToJavaString(env, profile.guid());
@@ -331,20 +332,22 @@
 
 base::android::ScopedJavaLocalRef<jobjectArray>
 PersonalDataManagerAndroid::GetCreditCardGUIDsForSettings(JNIEnv* env) {
-  return GetCreditCardGUIDs(env, personal_data_manager_->GetCreditCards());
+  return GetCreditCardGUIDs(
+      env, personal_data_manager_->payments_data_manager().GetCreditCards());
 }
 
 base::android::ScopedJavaLocalRef<jobjectArray>
 PersonalDataManagerAndroid::GetCreditCardGUIDsToSuggest(JNIEnv* env) {
-  return GetCreditCardGUIDs(env,
-                            personal_data_manager_->GetCreditCardsToSuggest());
+  return GetCreditCardGUIDs(env, personal_data_manager_->payments_data_manager()
+                                     .GetCreditCardsToSuggest());
 }
 
 ScopedJavaLocalRef<jobject> PersonalDataManagerAndroid::GetCreditCardByGUID(
     JNIEnv* env,
     const JavaParamRef<jstring>& jguid) {
-  CreditCard* card = personal_data_manager_->GetCreditCardByGUID(
-      ConvertJavaStringToUTF8(env, jguid));
+  CreditCard* card =
+      personal_data_manager_->payments_data_manager().GetCreditCardByGUID(
+          ConvertJavaStringToUTF8(env, jguid));
   if (!card)
     return ScopedJavaLocalRef<jobject>();
 
@@ -370,10 +373,10 @@
   PopulateNativeCreditCardFromJava(jcard, env, &card);
 
   if (guid.empty()) {
-    personal_data_manager_->AddCreditCard(card);
+    personal_data_manager_->payments_data_manager().AddCreditCard(card);
   } else {
     card.set_guid(guid);
-    personal_data_manager_->UpdateCreditCard(card);
+    personal_data_manager_->payments_data_manager().UpdateCreditCard(card);
   }
   return ConvertUTF8ToJavaString(env, card.guid());
 }
@@ -394,7 +397,8 @@
   std::unique_ptr<CreditCard> card = std::make_unique<CreditCard>();
   PopulateNativeCreditCardFromJava(jcard, env, card.get());
   card->set_record_type(CreditCard::RecordType::kMaskedServerCard);
-  personal_data_manager_->AddServerCreditCardForTest(std::move(card));
+  personal_data_manager_->payments_data_manager().AddServerCreditCardForTest(
+      std::move(card));
   personal_data_manager_->NotifyPersonalDataObserver();
 }
 
@@ -408,7 +412,8 @@
   card->set_record_type(CreditCard::RecordType::kMaskedServerCard);
   card->SetNickname(ConvertJavaStringToUTF16(jnickname));
   card->set_card_issuer(static_cast<CreditCard::Issuer>(jcard_issuer));
-  personal_data_manager_->AddServerCreditCardForTest(std::move(card));
+  personal_data_manager_->payments_data_manager().AddServerCreditCardForTest(
+      std::move(card));
   personal_data_manager_->NotifyPersonalDataObserver();
 }
 
@@ -480,8 +485,9 @@
 void PersonalDataManagerAndroid::RecordAndLogCreditCardUse(
     JNIEnv* env,
     const JavaParamRef<jstring>& jguid) {
-  CreditCard* card = personal_data_manager_->GetCreditCardByGUID(
-      ConvertJavaStringToUTF8(env, jguid));
+  CreditCard* card =
+      personal_data_manager_->payments_data_manager().GetCreditCardByGUID(
+          ConvertJavaStringToUTF8(env, jguid));
   if (card) {
     personal_data_manager_->payments_data_manager().RecordUseOfCard(card);
   }
@@ -494,8 +500,9 @@
     jint days_since_last_used) {
   DCHECK(count >= 0 && days_since_last_used >= 0);
 
-  CreditCard* card = personal_data_manager_->GetCreditCardByGUID(
-      ConvertJavaStringToUTF8(env, jguid));
+  CreditCard* card =
+      personal_data_manager_->payments_data_manager().GetCreditCardByGUID(
+          ConvertJavaStringToUTF8(env, jguid));
   card->set_use_count(static_cast<size_t>(count));
   card->set_use_date(AutofillClock::Now() - base::Days(days_since_last_used));
 
@@ -505,16 +512,18 @@
 jint PersonalDataManagerAndroid::GetCreditCardUseCountForTesting(
     JNIEnv* env,
     const base::android::JavaParamRef<jstring>& jguid) {
-  CreditCard* card = personal_data_manager_->GetCreditCardByGUID(
-      ConvertJavaStringToUTF8(env, jguid));
+  CreditCard* card =
+      personal_data_manager_->payments_data_manager().GetCreditCardByGUID(
+          ConvertJavaStringToUTF8(env, jguid));
   return card->use_count();
 }
 
 jlong PersonalDataManagerAndroid::GetCreditCardUseDateForTesting(
     JNIEnv* env,
     const base::android::JavaParamRef<jstring>& jguid) {
-  CreditCard* card = personal_data_manager_->GetCreditCardByGUID(
-      ConvertJavaStringToUTF8(env, jguid));
+  CreditCard* card =
+      personal_data_manager_->payments_data_manager().GetCreditCardByGUID(
+          ConvertJavaStringToUTF8(env, jguid));
   return card->use_date().ToTimeT();
 }
 
@@ -530,16 +539,19 @@
 }
 
 void PersonalDataManagerAndroid::ClearServerDataForTesting(JNIEnv* env) {
-  personal_data_manager_->ClearAllServerDataForTesting();  // IN-TEST
+  personal_data_manager_->payments_data_manager()
+      .ClearAllServerDataForTesting();  // IN-TEST
   personal_data_manager_->NotifyPersonalDataObserver();
 }
 
 jboolean PersonalDataManagerAndroid::HasProfiles(JNIEnv* env) {
-  return !personal_data_manager_->GetProfiles().empty();
+  return !personal_data_manager_->address_data_manager().GetProfiles().empty();
 }
 
 jboolean PersonalDataManagerAndroid::HasCreditCards(JNIEnv* env) {
-  return !personal_data_manager_->GetCreditCards().empty();
+  return !personal_data_manager_->payments_data_manager()
+              .GetCreditCards()
+              .empty();
 }
 
 jboolean PersonalDataManagerAndroid::IsFidoAuthenticationAvailable(
diff --git a/chrome/browser/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc b/chrome/browser/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc
index 4cec106a..a2cc8ce 100644
--- a/chrome/browser/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc
+++ b/chrome/browser/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc
@@ -18,6 +18,7 @@
 #include "chrome/test/base/testing_profile.h"
 #include "components/autofill/core/browser/autofill_test_utils.h"
 #include "components/autofill/core/browser/metrics/payments/credit_card_save_metrics.h"
+#include "components/autofill/core/browser/payments_data_manager.h"
 #include "components/autofill/core/browser/personal_data_manager.h"
 #include "components/autofill/core/browser/test_personal_data_manager.h"
 #include "components/browser_ui/device_lock/android/device_lock_bridge.h"
@@ -262,7 +263,8 @@
     base::HistogramTester histogram_tester;
 
     CheckInfobarAcceptReturnValue(infobar.get());
-    ASSERT_EQ(1U, personal_data_->GetCreditCards().size());
+    ASSERT_EQ(1U,
+              personal_data_->payments_data_manager().GetCreditCards().size());
     histogram_tester.ExpectUniqueSample("Autofill.CreditCardInfoBar.Local",
                                         AutofillMetrics::INFOBAR_ACCEPTED, 1);
     histogram_tester.ExpectUniqueSample(
@@ -339,7 +341,8 @@
 
     base::HistogramTester histogram_tester;
     CheckInfobarAcceptReturnValue(infobar.get());
-    ASSERT_EQ(1U, personal_data_->GetCreditCards().size());
+    ASSERT_EQ(1U,
+              personal_data_->payments_data_manager().GetCreditCards().size());
     histogram_tester.ExpectUniqueSample("Autofill.CreditCardInfoBar.Server",
                                         AutofillMetrics::INFOBAR_ACCEPTED, 1);
     histogram_tester.ExpectUniqueSample(
@@ -358,7 +361,8 @@
 
     base::HistogramTester histogram_tester;
     CheckInfobarAcceptReturnValue(infobar.get());
-    ASSERT_EQ(1U, personal_data_->GetCreditCards().size());
+    ASSERT_EQ(1U,
+              personal_data_->payments_data_manager().GetCreditCards().size());
     histogram_tester.ExpectUniqueSample("Autofill.CreditCardInfoBar.Server",
                                         AutofillMetrics::INFOBAR_ACCEPTED, 1);
     histogram_tester.ExpectUniqueSample(
@@ -385,7 +389,8 @@
 
     base::HistogramTester histogram_tester;
     CheckInfobarAcceptReturnValue(infobar.get());
-    ASSERT_EQ(1U, personal_data_->GetCreditCards().size());
+    ASSERT_EQ(1U,
+              personal_data_->payments_data_manager().GetCreditCards().size());
     histogram_tester.ExpectUniqueSample("Autofill.CreditCardInfoBar.Server",
                                         AutofillMetrics::INFOBAR_ACCEPTED, 1);
     histogram_tester.ExpectUniqueSample(
@@ -550,7 +555,8 @@
     base::HistogramTester histogram_tester;
 
     CheckInfobarAcceptReturnValue(infobar.get());
-    ASSERT_EQ(1U, personal_data_->GetCreditCards().size());
+    ASSERT_EQ(1U,
+              personal_data_->payments_data_manager().GetCreditCards().size());
     histogram_tester.ExpectUniqueSample("Autofill.CvcInfoBar.Local",
                                         AutofillMetrics::INFOBAR_ACCEPTED, 1);
   }
@@ -609,7 +615,8 @@
 
     base::HistogramTester histogram_tester;
     CheckInfobarAcceptReturnValue(infobar.get());
-    ASSERT_EQ(1U, personal_data_->GetCreditCards().size());
+    ASSERT_EQ(1U,
+              personal_data_->payments_data_manager().GetCreditCards().size());
     histogram_tester.ExpectUniqueSample("Autofill.CvcInfoBar.Upload",
                                         AutofillMetrics::INFOBAR_ACCEPTED, 1);
   }
diff --git a/chrome/browser/extensions/api/developer_private/extension_info_generator.cc b/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
index 20208f3..6707e27 100644
--- a/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
+++ b/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
@@ -903,11 +903,11 @@
                           ? IDS_EXTENSIONS_SC_UNPUBLISHED_ON
                           : IDS_EXTENSIONS_SC_UNPUBLISHED_OFF;
   } else if (no_privacy_practice) {
-    // TODO(crbug.com/335430214): Update strings to real values once finalized.
-    detail_string_id = IDS_EXTENSIONS_SAFETY_CHECK_OFFSTORE;
-    panel_string_id = state == developer::ExtensionState::kEnabled
-                          ? IDS_EXTENSIONS_SAFETY_CHECK_OFFSTORE_ON
-                          : IDS_EXTENSIONS_SAFETY_CHECK_OFFSTORE_OFF;
+    detail_string_id = IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES;
+    panel_string_id =
+        state == developer::ExtensionState::kEnabled
+            ? IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES_ON
+            : IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES_OFF;
   } else if (warn_for_offstore_extension) {
     detail_string_id = IDS_EXTENSIONS_SAFETY_CHECK_OFFSTORE;
     panel_string_id = state == developer::ExtensionState::kEnabled
diff --git a/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc b/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
index 4e93f367..1b8bca6 100644
--- a/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
+++ b/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
@@ -251,12 +251,11 @@
                                        : IDS_EXTENSIONS_SC_POLICY_VIOLATION_OFF;
         break;
       case SafetyCheckWarningReason::kNoPrivacyPractice:
-        // TODO(crbug.com/335430214): Update strings to real values
-        // once finalized.
-        detail_page_string = IDS_EXTENSIONS_SAFETY_CHECK_OFFSTORE;
-        panel_string = extension_state
-                           ? IDS_EXTENSIONS_SAFETY_CHECK_OFFSTORE_ON
-                           : IDS_EXTENSIONS_SAFETY_CHECK_OFFSTORE_OFF;
+        detail_page_string = IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES;
+        panel_string =
+            extension_state
+                ? IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES_ON
+                : IDS_EXTENSIONS_SAFETY_CHECK_NO_PRIVACY_PRACTICES_OFF;
         break;
       case SafetyCheckWarningReason::kNone:
         EXPECT_FALSE(info->safety_check_text->detail_string.has_value());
diff --git a/chrome/browser/fast_checkout/fast_checkout_client_impl.cc b/chrome/browser/fast_checkout/fast_checkout_client_impl.cc
index 500e197..b3d1917 100644
--- a/chrome/browser/fast_checkout/fast_checkout_client_impl.cc
+++ b/chrome/browser/fast_checkout/fast_checkout_client_impl.cc
@@ -23,6 +23,7 @@
 #include "components/autofill/core/browser/data_model/credit_card.h"
 #include "components/autofill/core/browser/payments/credit_card_cvc_authenticator.h"
 #include "components/autofill/core/browser/payments/payments_autofill_client.h"
+#include "components/autofill/core/browser/payments_data_manager.h"
 #include "components/autofill/core/browser/ui/fast_checkout_enums.h"
 #include "components/autofill/core/common/dense_set.h"
 #include "components/autofill/core/common/mojom/autofill_types.mojom-shared.h"
@@ -483,13 +484,14 @@
 autofill::CreditCard* FastCheckoutClientImpl::GetSelectedCreditCard() {
   autofill::CreditCard* credit_card = nullptr;
   if (selected_credit_card_is_local_) {
-    credit_card =
-        personal_data_helper_->GetPersonalDataManager()->GetCreditCardByGUID(
-            selected_credit_card_id_.value());
+    credit_card = personal_data_helper_->GetPersonalDataManager()
+                      ->payments_data_manager()
+                      .GetCreditCardByGUID(selected_credit_card_id_.value());
   } else {
     credit_card =
         personal_data_helper_->GetPersonalDataManager()
-            ->GetCreditCardByServerId(selected_credit_card_id_.value());
+            ->payments_data_manager()
+            .GetCreditCardByServerId(selected_credit_card_id_.value());
   }
   if (!credit_card) {
     OnRunComplete(FastCheckoutRunOutcome::kCreditCardDeleted);
diff --git a/chrome/browser/fast_checkout/fast_checkout_client_impl_unittest.cc b/chrome/browser/fast_checkout/fast_checkout_client_impl_unittest.cc
index dbfe5c8..7c9c285e 100644
--- a/chrome/browser/fast_checkout/fast_checkout_client_impl_unittest.cc
+++ b/chrome/browser/fast_checkout/fast_checkout_client_impl_unittest.cc
@@ -24,6 +24,7 @@
 #include "components/autofill/content/browser/test_autofill_manager_injector.h"
 #include "components/autofill/content/browser/test_content_autofill_client.h"
 #include "components/autofill/content/browser/test_content_autofill_driver.h"
+#include "components/autofill/core/browser/address_data_manager.h"
 #include "components/autofill/core/browser/autofill_driver.h"
 #include "components/autofill/core/browser/autofill_test_utils.h"
 #include "components/autofill/core/browser/data_model/autofill_profile.h"
@@ -31,6 +32,7 @@
 #include "components/autofill/core/browser/heuristic_source.h"
 #include "components/autofill/core/browser/payments/credit_card_cvc_authenticator.h"
 #include "components/autofill/core/browser/payments/payments_autofill_client.h"
+#include "components/autofill/core/browser/payments_data_manager.h"
 #include "components/autofill/core/browser/test_autofill_client.h"
 #include "components/autofill/core/browser/test_autofill_driver.h"
 #include "components/autofill/core/browser/test_browser_autofill_manager.h"
@@ -110,14 +112,15 @@
   personal_data_manager->SetAutofillProfileEnabled(true);
   personal_data_manager->SetAutofillPaymentMethodsEnabled(true);
   personal_data_manager->SetAutofillWalletImportEnabled(true);
-  personal_data_manager->AddProfile(kProfile1);
-  personal_data_manager->AddProfile(kProfile2);
+  personal_data_manager->address_data_manager().AddProfile(kProfile1);
+  personal_data_manager->address_data_manager().AddProfile(kProfile2);
   // Add incomplete autofill profile, should not be shown on the sheet.
-  personal_data_manager->AddProfile(kIncompleteProfile);
-  personal_data_manager->AddCreditCard(kCreditCard1);
-  personal_data_manager->AddCreditCard(kCreditCard2);
+  personal_data_manager->address_data_manager().AddProfile(kIncompleteProfile);
+  personal_data_manager->payments_data_manager().AddCreditCard(kCreditCard1);
+  personal_data_manager->payments_data_manager().AddCreditCard(kCreditCard2);
   // Add empty credit card, should not be shown on the sheet.
-  personal_data_manager->AddCreditCard(kEmptyCreditCard);
+  personal_data_manager->payments_data_manager().AddCreditCard(
+      kEmptyCreditCard);
   return personal_data_manager;
 }
 
@@ -348,13 +351,15 @@
             autofill::test::GetFullProfile());
     autofill_profile_unique_ptr->set_profile_label(
         base::UTF16ToUTF8(kAutofillProfileLabel));
-    personal_data_manager()->AddProfile(*autofill_profile_unique_ptr);
+    personal_data_manager()->address_data_manager().AddProfile(
+        *autofill_profile_unique_ptr);
     auto credit_card_unique_ptr = std::make_unique<autofill::CreditCard>(
         local_card ? autofill::test::GetCreditCard()
                    : autofill::test::GetMaskedServerCard());
     credit_card_unique_ptr->SetNickname(kCreditCardNickname);
     if (local_card) {
-      personal_data_manager()->AddCreditCard(*credit_card_unique_ptr);
+      personal_data_manager()->payments_data_manager().AddCreditCard(
+          *credit_card_unique_ptr);
     } else {
       personal_data_manager()->AddServerCreditCard(*credit_card_unique_ptr);
     }
@@ -378,10 +383,15 @@
         personal_data_manager()->address_data_manager().GetProfileByGUID(
             fast_checkout_client()->selected_autofill_profile_guid_.value()),
         (local_card
-             ? personal_data_manager()->GetCreditCardByGUID(
-                   fast_checkout_client()->selected_credit_card_id_.value())
-             : personal_data_manager()->GetCreditCardByServerId(
-                   fast_checkout_client()->selected_credit_card_id_.value()))};
+             ? personal_data_manager()
+                   ->payments_data_manager()
+                   .GetCreditCardByGUID(
+                       fast_checkout_client()->selected_credit_card_id_.value())
+             : personal_data_manager()
+                   ->payments_data_manager()
+                   .GetCreditCardByServerId(
+                       fast_checkout_client()
+                           ->selected_credit_card_id_.value()))};
   }
 
   std::unique_ptr<autofill::FormStructure> SetUpCreditCardForm() {
@@ -586,7 +596,8 @@
   // User removes all the profiles.
   personal_data_manager()->ClearProfiles();
   // User adds an incomplete profile only.
-  personal_data_manager()->AddProfile(autofill::test::GetIncompleteProfile1());
+  personal_data_manager()->address_data_manager().AddProfile(
+      autofill::test::GetIncompleteProfile1());
 
   // `FastCheckoutClient` is not running anymore.
   EXPECT_FALSE(fast_checkout_client()->IsRunning());
@@ -626,7 +637,7 @@
 
   // User removes all valid credit cards and adds a valid card.
   personal_data_manager()->test_payments_data_manager().ClearCreditCards();
-  personal_data_manager()->AddCreditCard(kCreditCard1);
+  personal_data_manager()->payments_data_manager().AddCreditCard(kCreditCard1);
 
   // `FastCheckoutClient` is still running.
   EXPECT_TRUE(fast_checkout_client()->IsRunning());
diff --git a/chrome/browser/fast_checkout/fast_checkout_personal_data_helper_impl.cc b/chrome/browser/fast_checkout/fast_checkout_personal_data_helper_impl.cc
index dcea833..6e81aa196 100644
--- a/chrome/browser/fast_checkout/fast_checkout_personal_data_helper_impl.cc
+++ b/chrome/browser/fast_checkout/fast_checkout_personal_data_helper_impl.cc
@@ -11,6 +11,7 @@
 #include "chrome/browser/autofill/personal_data_manager_factory.h"
 #include "chrome/browser/profiles/profile.h"
 #include "components/autofill/core/browser/geo/autofill_country.h"
+#include "components/autofill/core/browser/payments_data_manager.h"
 
 FastCheckoutPersonalDataHelperImpl::FastCheckoutPersonalDataHelperImpl(
     content::WebContents* web_contents)
@@ -36,7 +37,9 @@
 std::vector<autofill::CreditCard*>
 FastCheckoutPersonalDataHelperImpl::GetCreditCardsToSuggest() const {
   std::vector<autofill::CreditCard*> cards_to_suggest =
-      GetPersonalDataManager()->GetCreditCardsToSuggest();
+      GetPersonalDataManager()
+          ->payments_data_manager()
+          .GetCreditCardsToSuggest();
   // Do not offer cards with empty number.
   std::erase_if(cards_to_suggest, [](const autofill::CreditCard* card) {
     return !card->HasRawInfo(autofill::CREDIT_CARD_NUMBER);
@@ -64,8 +67,9 @@
 
 std::vector<autofill::CreditCard*>
 FastCheckoutPersonalDataHelperImpl::GetValidCreditCards() const {
-  std::vector<autofill::CreditCard*> cards =
-      GetPersonalDataManager()->GetCreditCardsToSuggest();
+  std::vector<autofill::CreditCard*> cards = GetPersonalDataManager()
+                                                 ->payments_data_manager()
+                                                 .GetCreditCardsToSuggest();
   std::erase_if(cards, std::not_fn(&autofill::CreditCard::IsCompleteValidCard));
   return cards;
 }
diff --git a/chrome/browser/fast_checkout/fast_checkout_personal_data_helper_impl_unittest.cc b/chrome/browser/fast_checkout/fast_checkout_personal_data_helper_impl_unittest.cc
index 5ea21e4d..fb4a37f 100644
--- a/chrome/browser/fast_checkout/fast_checkout_personal_data_helper_impl_unittest.cc
+++ b/chrome/browser/fast_checkout/fast_checkout_personal_data_helper_impl_unittest.cc
@@ -7,7 +7,9 @@
 #include "base/uuid.h"
 #include "chrome/browser/autofill/personal_data_manager_factory.h"
 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
+#include "components/autofill/core/browser/address_data_manager.h"
 #include "components/autofill/core/browser/autofill_test_utils.h"
+#include "components/autofill/core/browser/payments_data_manager.h"
 #include "components/autofill/core/browser/test_personal_data_manager.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -73,57 +75,82 @@
 
 TEST_F(FastCheckoutPersonalDataHelperTest,
        NoValidAddressProfiles_HasValidProfiles_ReturnsFalse) {
-  personal_data_helper()->GetPersonalDataManager()->AddProfile(kProfile);
+  personal_data_helper()
+      ->GetPersonalDataManager()
+      ->address_data_manager()
+      .AddProfile(kProfile);
 
   EXPECT_FALSE(personal_data_helper()->GetValidAddressProfiles().empty());
 }
 
 TEST_F(FastCheckoutPersonalDataHelperTest,
        NoValidAddressProfiles_HasOnlyInvalidProfiles_ReturnsTrue) {
-  personal_data_helper()->GetPersonalDataManager()->AddProfile(
-      kIncompleteProfile);
+  personal_data_helper()
+      ->GetPersonalDataManager()
+      ->address_data_manager()
+      .AddProfile(kIncompleteProfile);
 
   EXPECT_TRUE(personal_data_helper()->GetValidAddressProfiles().empty());
 }
 
 TEST_F(FastCheckoutPersonalDataHelperTest,
        NoValidAddressProfiles_HasValidAndInvalidProfiles_ReturnsFalse) {
-  personal_data_helper()->GetPersonalDataManager()->AddProfile(kProfile);
-  personal_data_helper()->GetPersonalDataManager()->AddProfile(
-      kIncompleteProfile);
+  personal_data_helper()
+      ->GetPersonalDataManager()
+      ->address_data_manager()
+      .AddProfile(kProfile);
+  personal_data_helper()
+      ->GetPersonalDataManager()
+      ->address_data_manager()
+      .AddProfile(kIncompleteProfile);
 
   EXPECT_FALSE(personal_data_helper()->GetValidAddressProfiles().empty());
 }
 
 TEST_F(FastCheckoutPersonalDataHelperTest,
        NoValidCreditCards_HasValidCreditCards_ReturnsFalse) {
-  personal_data_helper()->GetPersonalDataManager()->AddCreditCard(kCreditCard);
+  personal_data_helper()
+      ->GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(kCreditCard);
 
   EXPECT_FALSE(personal_data_helper()->GetValidCreditCards().empty());
 }
 
 TEST_F(FastCheckoutPersonalDataHelperTest,
        NoValidCreditCards_HasOnlyInvalidCreditCards_ReturnsTrue) {
-  personal_data_helper()->GetPersonalDataManager()->AddCreditCard(
-      kEmptyCreditCard);
+  personal_data_helper()
+      ->GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(kEmptyCreditCard);
 
   EXPECT_TRUE(personal_data_helper()->GetValidCreditCards().empty());
 }
 
 TEST_F(FastCheckoutPersonalDataHelperTest,
        NoValidCreditCards_HasValidAndInvalidCreditCards_ReturnsFalse) {
-  personal_data_helper()->GetPersonalDataManager()->AddCreditCard(kCreditCard);
-  personal_data_helper()->GetPersonalDataManager()->AddCreditCard(
-      kEmptyCreditCard);
+  personal_data_helper()
+      ->GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(kCreditCard);
+  personal_data_helper()
+      ->GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(kEmptyCreditCard);
 
   EXPECT_FALSE(personal_data_helper()->GetValidCreditCards().empty());
 }
 
 TEST_F(FastCheckoutPersonalDataHelperTest,
        GetCreditCardsToSuggest_ReturnsOnlyCardsWithNumber) {
-  personal_data_helper()->GetPersonalDataManager()->AddCreditCard(kCreditCard);
-  personal_data_helper()->GetPersonalDataManager()->AddCreditCard(
-      kEmptyCreditCard);
+  personal_data_helper()
+      ->GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(kCreditCard);
+  personal_data_helper()
+      ->GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(kEmptyCreditCard);
 
   std::vector<autofill::CreditCard*> cards =
       personal_data_helper()->GetCreditCardsToSuggest();
@@ -134,9 +161,14 @@
 
 TEST_F(FastCheckoutPersonalDataHelperTest,
        GetProfilesToSuggest_ReturnsAllProfiles) {
-  personal_data_helper()->GetPersonalDataManager()->AddProfile(kProfile);
-  personal_data_helper()->GetPersonalDataManager()->AddProfile(
-      kIncompleteProfile);
+  personal_data_helper()
+      ->GetPersonalDataManager()
+      ->address_data_manager()
+      .AddProfile(kProfile);
+  personal_data_helper()
+      ->GetPersonalDataManager()
+      ->address_data_manager()
+      .AddProfile(kIncompleteProfile);
 
   std::vector<autofill::AutofillProfile*> profiles =
       personal_data_helper()->GetProfilesToSuggest();
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index 4b7a885..7cd3e34 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -1543,6 +1543,11 @@
     "expiry_milestone": 130
   },
   {
+    "name": "cras-processor-wav-dump",
+    "owners": ["aaronyu@google.com", "chromeos-audio@google.com" ],
+    "expiry_milestone": 130
+  },
+  {
     "name": "cras-split-alsa-usb-internal",
     "owners": [ "whalechang@google.com", "chromeos-audio-sw@google.com" ],
     "expiry_milestone": 125
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index cd7539b..db0eb1281 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -2010,6 +2010,11 @@
 const char kCrasProcessorDedicatedThreadDescription[] =
     "Run CrasProcessor in a separate thread out of the audio thread";
 
+const char kCrasProcessorWavDumpName[] = "Enable CrasProcessor WAVE file dumps";
+const char kCrasProcessorWavDumpDescription[] =
+    "Make CrasProcessor produce WAVE file dumps for the audio processing "
+    "pipeline";
+
 const char kCrasSplitAlsaUsbInternalName[] =
     "CRAS Split USB/Internal refactor control";
 const char kCrasSplitAlsaUsbInternalDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 53eb9ab..6d9a34e 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -1145,6 +1145,9 @@
 extern const char kCrasProcessorDedicatedThreadName[];
 extern const char kCrasProcessorDedicatedThreadDescription[];
 
+extern const char kCrasProcessorWavDumpName[];
+extern const char kCrasProcessorWavDumpDescription[];
+
 extern const char kCrasSplitAlsaUsbInternalName[];
 extern const char kCrasSplitAlsaUsbInternalDescription[];
 
diff --git a/chrome/browser/incognito/android/javatests/src/org/chromium/chrome/browser/incognito/reauth/TabSwitcherIncognitoReauthViewTest.java b/chrome/browser/incognito/android/javatests/src/org/chromium/chrome/browser/incognito/reauth/TabSwitcherIncognitoReauthViewTest.java
index 4532ef1..6e79253e 100644
--- a/chrome/browser/incognito/android/javatests/src/org/chromium/chrome/browser/incognito/reauth/TabSwitcherIncognitoReauthViewTest.java
+++ b/chrome/browser/incognito/android/javatests/src/org/chromium/chrome/browser/incognito/reauth/TabSwitcherIncognitoReauthViewTest.java
@@ -31,6 +31,7 @@
 import org.chromium.base.test.util.Batch;
 import org.chromium.base.test.util.CommandLineFlags;
 import org.chromium.base.test.util.CriteriaHelper;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.DisabledTest;
 import org.chromium.base.test.util.Feature;
 import org.chromium.base.test.util.Features.DisableFeatures;
@@ -48,6 +49,7 @@
 import org.chromium.chrome.test.util.ChromeRenderTestRule;
 import org.chromium.components.user_prefs.UserPrefs;
 import org.chromium.content_public.browser.test.util.TestThreadUtils;
+import org.chromium.ui.test.util.UiDisableIf;
 
 import java.io.IOException;
 
@@ -135,6 +137,7 @@
     @Test
     @MediumTest
     @Feature("RenderTest")
+    @DisableIf.Device(type = {UiDisableIf.TABLET}) // https://crbug.com/338972172
     @DisableFeatures(ChromeFeatureList.ANDROID_HUB)
     public void testIncognitoReauthView_TabSwitcherRenderTest() throws IOException {
         final ChromeTabbedActivity cta = mActivityTestRule.getActivity();
diff --git a/chrome/browser/ip_protection/ip_protection_config_provider_browsertest.cc b/chrome/browser/ip_protection/ip_protection_config_provider_browsertest.cc
index 802491cc..c8adcea 100644
--- a/chrome/browser/ip_protection/ip_protection_config_provider_browsertest.cc
+++ b/chrome/browser/ip_protection/ip_protection_config_provider_browsertest.cc
@@ -83,11 +83,12 @@
                         network::mojom::IpProtectionProxyLayer proxy_layer,
                         TryGetAuthTokensCallback callback) override {
     if (should_intercept_) {
-      // NOTE: We'll ignore batch size and just return one token.
       std::vector<network::mojom::BlindSignedAuthTokenPtr> tokens;
-      auto token =
-          network::mojom::BlindSignedAuthToken::New(token_, expiration_);
-      tokens.push_back(std::move(token));
+      for (uint32_t i = 0; i < batch_size; i++) {
+        auto token =
+            network::mojom::BlindSignedAuthToken::New(token_, expiration_);
+        tokens.push_back(std::move(token));
+      }
       std::move(callback).Run(std::move(tokens), base::Time());
       return;
     }
diff --git a/chrome/browser/keyboard_accessory/OWNERS b/chrome/browser/keyboard_accessory/OWNERS
index beb2c2f..6cbf35b 100644
--- a/chrome/browser/keyboard_accessory/OWNERS
+++ b/chrome/browser/keyboard_accessory/OWNERS
@@ -2,19 +2,5 @@
 ioanap@chromium.org
 derinel@google.com
 
-# Autofill & Password specialists for C++ code:
-per-file *.h,*.cc,*.gn,*.grd,DEPS=mamir@chromium.org
-per-file *.h,*.cc,*.gn,*.grd,DEPS=schwering@google.com
-
 # Everyone can fix our docs:
 per-file *.md=*
-
-#Legacy autofill owners (because annotations are only supported per user):
-per-file *.h,*.cc,*.gn,*.grd,DEPS=battre@chromium.org #[LAST_RESORT_SUGGESTION}
-per-file *.h,*.cc,*.gn,*.grd,DEPS=koerber@google.com #[LAST_RESORT_SUGGESTION}
-per-file *.h,*.cc,*.gn,*.grd,DEPS=fleimgruber@google.com #[LAST_RESORT_SUGGESTION}
-per-file *.h,*.cc,*.gn,*.grd,DEPS=pkotwicz@chromium.org #[LAST_RESORT_SUGGESTION}
-per-file *.h,*.cc,*.gn,*.grd,DEPS=smcgruer@chromium.org #[LAST_RESORT_SUGGESTION}
-
-#Legacy password_manager owners (because annotations are only supported per user):
-per-file *.h,*.cc,*.gn,*.grd,DEPS=vasilii@chromium.org #[LAST_RESORT_SUGGESTION}
diff --git a/chrome/browser/keyboard_accessory/android/OWNERS b/chrome/browser/keyboard_accessory/android/OWNERS
new file mode 100644
index 0000000..724ef1f
--- /dev/null
+++ b/chrome/browser/keyboard_accessory/android/OWNERS
@@ -0,0 +1,15 @@
+# Prefer top level keyboard accessory owners over the per-file owners below.
+
+# Autofill & Password specialists for C++ code:
+per-file *.h,*.cc,*.gn,*.grd,DEPS=mamir@chromium.org
+per-file *.h,*.cc,*.gn,*.grd,DEPS=schwering@google.com
+
+#Legacy autofill owners (because annotations are only supported per user):
+per-file *.h,*.cc,*.gn,*.grd,DEPS=battre@chromium.org #[LAST_RESORT_SUGGESTION}
+per-file *.h,*.cc,*.gn,*.grd,DEPS=koerber@google.com #[LAST_RESORT_SUGGESTION}
+per-file *.h,*.cc,*.gn,*.grd,DEPS=fleimgruber@google.com #[LAST_RESORT_SUGGESTION}
+per-file *.h,*.cc,*.gn,*.grd,DEPS=pkotwicz@chromium.org #[LAST_RESORT_SUGGESTION}
+per-file *.h,*.cc,*.gn,*.grd,DEPS=smcgruer@chromium.org #[LAST_RESORT_SUGGESTION}
+
+#Legacy password_manager owners (because annotations are only supported per user):
+per-file *.h,*.cc,*.gn,*.grd,DEPS=vasilii@chromium.org #[LAST_RESORT_SUGGESTION}
diff --git a/chrome/browser/keyboard_accessory/android/address_accessory_controller_impl_unittest.cc b/chrome/browser/keyboard_accessory/android/address_accessory_controller_impl_unittest.cc
index 615270a..16d1de9 100644
--- a/chrome/browser/keyboard_accessory/android/address_accessory_controller_impl_unittest.cc
+++ b/chrome/browser/keyboard_accessory/android/address_accessory_controller_impl_unittest.cc
@@ -9,14 +9,16 @@
 #include <ostream>
 #include <string>
 #include <vector>
+
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/mock_callback.h"
+#include "chrome/browser/autofill/personal_data_manager_factory.h"
 #include "chrome/browser/keyboard_accessory/android/accessory_controller.h"
 #include "chrome/browser/keyboard_accessory/test_utils/android/mock_manual_filling_controller.h"
-#include "chrome/browser/autofill/personal_data_manager_factory.h"
 #include "chrome/grit/generated_resources.h"
 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
 #include "chrome/test/base/testing_profile.h"
+#include "components/autofill/core/browser/address_data_manager.h"
 #include "components/autofill/core/browser/autofill_test_utils.h"
 #include "components/autofill/core/browser/test_personal_data_manager.h"
 #include "components/strings/grit/components_strings.h"
@@ -108,7 +110,7 @@
 
 TEST_F(AddressAccessoryControllerTest, ProvidesNoSheetBeforeInitialRefresh) {
   AutofillProfile canadian = test::GetFullValidProfileForCanada();
-  personal_data_manager()->AddProfile(canadian);
+  personal_data_manager()->address_data_manager().AddProfile(canadian);
   controller()->RegisterFillingSourceObserver(filling_source_observer_.Get());
 
   EXPECT_FALSE(controller()->GetSheetData().has_value());
@@ -122,7 +124,7 @@
 
 TEST_F(AddressAccessoryControllerTest, RefreshSuggestionsCallsUI) {
   AutofillProfile canadian = test::GetFullValidProfileForCanada();
-  personal_data_manager()->AddProfile(canadian);
+  personal_data_manager()->address_data_manager().AddProfile(canadian);
 
   AccessorySheetData result(AccessoryTabType::PASSWORDS, std::u16string());
   EXPECT_CALL(mock_manual_filling_controller_, RefreshSuggestions(_))
@@ -176,7 +178,7 @@
 
   // When new data is added, a refresh is automatically triggered.
   AutofillProfile email = test::GetIncompleteProfile2();
-  personal_data_manager()->AddProfile(email);
+  personal_data_manager()->address_data_manager().AddProfile(email);
   EXPECT_EQ(result, controller()->GetSheetData());
   EXPECT_EQ(result,
             AddressAccessorySheetDataBuilder(std::u16string())
diff --git a/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.cc b/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.cc
index 8a64860e..a4d4972 100644
--- a/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.cc
+++ b/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.cc
@@ -26,6 +26,7 @@
 #include "components/autofill/core/browser/browser_autofill_manager.h"
 #include "components/autofill/core/browser/data_model/credit_card.h"
 #include "components/autofill/core/browser/payments/constants.h"
+#include "components/autofill/core/browser/payments_data_manager.h"
 #include "components/autofill/core/common/autofill_features.h"
 #include "components/autofill/core/common/autofill_payments_features.h"
 #include "components/strings/grit/components_strings.h"
@@ -376,8 +377,8 @@
     return std::vector<CardOrVirtualCard>();
 
   std::vector<CardOrVirtualCard> cards;
-  for (const CreditCard* card :
-       personal_data_manager_->GetCreditCardsToSuggest()) {
+  for (const CreditCard* card : personal_data_manager_->payments_data_manager()
+                                    .GetCreditCardsToSuggest()) {
     // If any of cards is enrolled for virtual cards and the feature is active,
     // then insert a virtual card suggestion right before the actual card.
     if (ShouldCreateVirtualCard(card)) {
@@ -415,10 +416,11 @@
   if (!personal_data_manager_ || !autofill_manager)
     return std::vector<const AutofillOfferData*>();
 
-  return personal_data_manager_->GetActiveAutofillPromoCodeOffersForOrigin(
-      autofill_manager->client()
-          .GetLastCommittedPrimaryMainFrameURL()
-          .DeprecatedGetOriginAsURL());
+  return personal_data_manager_->payments_data_manager()
+      .GetActiveAutofillPromoCodeOffersForOrigin(
+          autofill_manager->client()
+              .GetLastCommittedPrimaryMainFrameURL()
+              .DeprecatedGetOriginAsURL());
 }
 
 base::WeakPtr<ManualFillingController>
diff --git a/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl_unittest.cc b/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl_unittest.cc
index 805329a..f8d6fad 100644
--- a/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl_unittest.cc
+++ b/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl_unittest.cc
@@ -24,6 +24,7 @@
 #include "components/autofill/core/browser/test_autofill_client.h"
 #include "components/autofill/core/browser/test_autofill_driver.h"
 #include "components/autofill/core/browser/test_browser_autofill_manager.h"
+#include "components/autofill/core/browser/test_payments_data_manager.h"
 #include "components/autofill/core/browser/test_personal_data_manager.h"
 #include "components/autofill/core/common/autofill_features.h"
 #include "components/autofill/core/common/autofill_payments_features.h"
@@ -164,7 +165,7 @@
 
 TEST_F(PaymentMethodAccessoryControllerTest, RefreshSuggestions) {
   CreditCard card = test::GetCreditCard();
-  data_manager_.AddCreditCard(card);
+  data_manager_.payments_data_manager().AddCreditCard(card);
   AccessorySheetData result(AccessoryTabType::CREDIT_CARDS, std::u16string());
 
   EXPECT_CALL(mock_mf_controller_, RefreshSuggestions(_))
@@ -191,7 +192,7 @@
 
 TEST_F(PaymentMethodAccessoryControllerTest, PreventsFillingInsecureContexts) {
   CreditCard card = test::GetCreditCard();
-  data_manager_.AddCreditCard(card);
+  data_manager_.payments_data_manager().AddCreditCard(card);
   AccessorySheetData result(autofill::AccessoryTabType::CREDIT_CARDS,
                             std::u16string());
   SetFormOrigin(GURL("http://insecure.http-site.com"));
@@ -268,7 +269,7 @@
   controller()->RegisterFillingSourceObserver(filling_source_observer_.Get());
 
   CreditCard card = GetCreditCard();
-  data_manager_.AddCreditCard(card);
+  data_manager_.payments_data_manager().AddCreditCard(card);
   EXPECT_CALL(filling_source_observer_,
               Run(controller(), IsFillingSourceAvailable(true)));
   ASSERT_TRUE(controller());
@@ -310,7 +311,7 @@
   // unmasked_cards_cache.
   CreditCard card = test::GetCreditCard();
   card.set_record_type(CreditCard::RecordType::kFullServerCard);
-  data_manager_.AddCreditCard(card);
+  data_manager_.payments_data_manager().AddCreditCard(card);
   std::u16string cvc = u"123";
   autofill_manager().GetCreditCardAccessManager().CacheUnmaskedCardInfo(card,
                                                                         cvc);
@@ -345,7 +346,7 @@
        RefreshSuggestionsAddsCachedVirtualCards) {
   // Add a masked card to PersonalDataManager.
   CreditCard unmasked_card = test::GetCreditCard();
-  data_manager_.AddCreditCard(unmasked_card);
+  data_manager_.payments_data_manager().AddCreditCard(unmasked_card);
   // Update the record type to kVirtualCard and add it to the unmasked cards
   // cache.
   unmasked_card.set_record_type(CreditCard::RecordType::kVirtualCard);
@@ -402,7 +403,7 @@
   CreditCard masked_card = test::GetMaskedServerCard();
   masked_card.set_virtual_card_enrollment_state(
       CreditCard::VirtualCardEnrollmentState::kEnrolled);
-  data_manager_.AddCreditCard(masked_card);
+  data_manager_.payments_data_manager().AddCreditCard(masked_card);
 
   AccessorySheetData result(autofill::AccessoryTabType::CREDIT_CARDS,
                             std::u16string());
@@ -453,7 +454,7 @@
   masked_card.set_card_art_url(GURL("http://www.example.com/image.png"));
   masked_card.set_virtual_card_enrollment_state(
       CreditCard::VirtualCardEnrollmentState::kEnrolled);
-  data_manager_.AddCreditCard(masked_card);
+  data_manager_.payments_data_manager().AddCreditCard(masked_card);
 
   AccessorySheetData result(autofill::AccessoryTabType::CREDIT_CARDS,
                             std::u16string());
@@ -485,7 +486,7 @@
   masked_card.set_card_art_url(GURL(kCapitalOneCardArtUrl));
   masked_card.set_virtual_card_enrollment_state(
       CreditCard::VirtualCardEnrollmentState::kEnrolled);
-  data_manager_.AddCreditCard(masked_card);
+  data_manager_.payments_data_manager().AddCreditCard(masked_card);
 
   AccessorySheetData result(autofill::AccessoryTabType::CREDIT_CARDS,
                             std::u16string());
@@ -509,7 +510,7 @@
 TEST_F(PaymentMethodAccessoryControllerTestSupportingPromoCodeOffers,
        RefreshSuggestionsWithPromoCodeOffers) {
   CreditCard card = test::GetCreditCard();
-  data_manager_.AddCreditCard(card);
+  data_manager_.payments_data_manager().AddCreditCard(card);
   // Getting a promo code whose |merchant_origins| contains AutofillClient's
   // |last_committed_url_|.
   AutofillOfferData promo_code_valid = test::GetPromoCodeOfferData(
@@ -521,9 +522,12 @@
   AutofillOfferData promo_code_expired = test::GetPromoCodeOfferData(
       /*merchant_origin=*/GURL(kExampleSite),
       /*is_expired=*/true);
-  data_manager_.AddAutofillOfferData(promo_code_valid);
-  data_manager_.AddAutofillOfferData(promo_code_origin_mismatch);
-  data_manager_.AddAutofillOfferData(promo_code_expired);
+  data_manager_.test_payments_data_manager().AddAutofillOfferData(
+      promo_code_valid);
+  data_manager_.test_payments_data_manager().AddAutofillOfferData(
+      promo_code_origin_mismatch);
+  data_manager_.test_payments_data_manager().AddAutofillOfferData(
+      promo_code_expired);
   AccessorySheetData result(autofill::AccessoryTabType::CREDIT_CARDS,
                             std::u16string());
 
diff --git a/chrome/browser/keyboard_accessory/test_utils/android/OWNERS b/chrome/browser/keyboard_accessory/test_utils/android/OWNERS
new file mode 100644
index 0000000..68581b1
--- /dev/null
+++ b/chrome/browser/keyboard_accessory/test_utils/android/OWNERS
@@ -0,0 +1 @@
+file://chrome/browser/keyboard_accessory/android/OWNERS
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc
index 367e256..cc1d2c83 100644
--- a/chrome/browser/metrics/chrome_metrics_service_client.cc
+++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
@@ -85,6 +85,7 @@
 #include "components/metrics/demographics/demographic_metrics_provider.h"
 #include "components/metrics/drive_metrics_provider.h"
 #include "components/metrics/entropy_state_provider.h"
+#include "components/metrics/install_date_provider.h"
 #include "components/metrics/metrics_log_uploader.h"
 #include "components/metrics/metrics_pref_names.h"
 #include "components/metrics/metrics_reporting_default_state.h"
@@ -970,6 +971,10 @@
       std::make_unique<LacrosMetricsProvider>());
 #endif  // BUILDFLAG(IS_CHROMEOS_LACROS)
 
+  PrefService* local_state = g_browser_process->local_state();
+  ukm_service_->RegisterMetricsProvider(
+      std::make_unique<metrics::InstallDateProvider>(local_state));
+
   ukm_service_->RegisterMetricsProvider(
       std::make_unique<metrics::GPUMetricsProvider>());
 
diff --git a/chrome/browser/metrics/chrome_metrics_service_client_unittest.cc b/chrome/browser/metrics/chrome_metrics_service_client_unittest.cc
index 50778121..0b6ce170 100644
--- a/chrome/browser/metrics/chrome_metrics_service_client_unittest.cc
+++ b/chrome/browser/metrics/chrome_metrics_service_client_unittest.cc
@@ -168,11 +168,12 @@
 
 TEST_F(ChromeMetricsServiceClientTest, TestRegisterUKMProviders) {
   // Test that UKM service has initialized its metrics providers. Currently
-  // there are 8 providers for all platform except ChromeOS.
-  // NetworkMetricsProvider, GPUMetricsProvider, CPUMetricsProvider
-  // ScreenInfoMetricsProvider, FormFactorMetricsProvider, FieldTrialsProvider,
-  // PrivacyBudgetMetricsProvider, and ComponentMetricsProvider.
-  size_t expected_providers = 8;
+  // there are 9 providers for all platform except ChromeOS.
+  // NetworkMetricsProvider, InstallDateProvider, GPUMetricsProvider,
+  // CPUMetricsProvider ScreenInfoMetricsProvider, FormFactorMetricsProvider,
+  // FieldTrialsProvider, PrivacyBudgetMetricsProvider, and
+  // ComponentMetricsProvider.
+  size_t expected_providers = 9;
 #if BUILDFLAG(IS_CHROMEOS_ASH)
   // ChromeOSMetricsProvider
   expected_providers++;
diff --git a/chrome/browser/metrics/ukm_browsertest.cc b/chrome/browser/metrics/ukm_browsertest.cc
index f6462ec..070897d 100644
--- a/chrome/browser/metrics/ukm_browsertest.cc
+++ b/chrome/browser/metrics/ukm_browsertest.cc
@@ -34,6 +34,7 @@
 #include "chrome/browser/unified_consent/unified_consent_service_factory.h"
 #include "components/metrics/demographics/demographic_metrics_provider.h"
 #include "components/metrics/demographics/demographic_metrics_test_utils.h"
+#include "components/metrics/metrics_pref_names.h"
 #include "components/metrics_services_manager/metrics_services_manager.h"
 #include "components/signin/public/base/signin_buildflags.h"
 #include "components/signin/public/identity_manager/identity_manager.h"
@@ -821,6 +822,37 @@
 }
 #endif  // !BUILDFLAG(IS_ANDROID)
 
+// Verifies that install date is attached.
+IN_PROC_BROWSER_TEST_F(UkmBrowserTest,
+                       InstallDateProviderPopulatesSystemProfile) {
+  PrefService* local_state = g_browser_process->local_state();
+  local_state->SetInt64(prefs::kInstallDate, 123456);
+
+  ukm::UkmTestHelper ukm_test_helper(GetUkmService());
+
+  MetricsConsentOverride metrics_consent(true);
+
+  Profile* profile = ProfileManager::GetLastUsedProfileIfLoaded();
+  std::unique_ptr<SyncServiceImplHarness> harness =
+      EnableSyncForProfile(profile);
+
+  PlatformBrowser browser = CreatePlatformBrowser(profile);
+  EXPECT_TRUE(ukm_test_helper.IsRecordingEnabled());
+  uint64_t original_client_id = ukm_test_helper.GetClientId();
+  EXPECT_NE(0U, original_client_id);
+
+  // Make sure there is a persistent log.
+  ukm_test_helper.BuildAndStoreLog();
+  EXPECT_TRUE(ukm_test_helper.HasUnsentLogs());
+  // Check log contents.
+  std::unique_ptr<ukm::Report> report = ukm_test_helper.GetUkmReport();
+
+  // Rounded from the 123456 we set earlier, to nearest hour.
+  EXPECT_EQ(122400, report->system_profile().install_date());
+
+  ClosePlatformBrowser(browser);
+}
+
 // Make sure that providing consent doesn't enable UKM when sync is disabled.
 // Keep in sync with testConsentAddedButNoSync in ios/chrome/browser/metrics/
 // ukm_egtest.mm and consentAddedButNoSyncCheck in chrome/android/javatests/src/
diff --git a/chrome/browser/password_manager/android/test_support/java/src/org/chromium/chrome/browser/password_manager/FakeCredentialManagerLauncher.java b/chrome/browser/password_manager/android/test_support/java/src/org/chromium/chrome/browser/password_manager/FakeCredentialManagerLauncher.java
index fce9f708..2f99aa0 100644
--- a/chrome/browser/password_manager/android/test_support/java/src/org/chromium/chrome/browser/password_manager/FakeCredentialManagerLauncher.java
+++ b/chrome/browser/password_manager/android/test_support/java/src/org/chromium/chrome/browser/password_manager/FakeCredentialManagerLauncher.java
@@ -13,6 +13,8 @@
 public class FakeCredentialManagerLauncher implements CredentialManagerLauncher {
     private PendingIntent mPendingIntent;
     private Exception mException;
+    private Callback<PendingIntent> mSuccessCallback;
+    private Callback<Exception> mFailureCallback;
 
     public void setIntent(PendingIntent pendingIntent) {
         mPendingIntent = pendingIntent;
@@ -22,6 +24,14 @@
         mException = exception;
     }
 
+    public void setSuccessCallback(Callback<PendingIntent> successCallback) {
+        mSuccessCallback = successCallback;
+    }
+
+    public void setFailureCallback(Callback<Exception> failureCallback) {
+        mFailureCallback = failureCallback;
+    }
+
     @Override
     public void getAccountCredentialManagerIntent(
             @ManagePasswordsReferrer int referrer,
@@ -29,9 +39,17 @@
             Callback<PendingIntent> successCallback,
             Callback<Exception> failureCallback) {
         if (accountName == null) {
-            failureCallback.onResult(
-                    new CredentialManagerBackendException(
-                            "Called without an account", CredentialManagerError.NO_ACCOUNT_NAME));
+            if (mFailureCallback != null) {
+                mFailureCallback.onResult(
+                        new CredentialManagerBackendException(
+                                "Called without an account",
+                                CredentialManagerError.NO_ACCOUNT_NAME));
+            } else {
+                failureCallback.onResult(
+                        new CredentialManagerBackendException(
+                                "Called without an account",
+                                CredentialManagerError.NO_ACCOUNT_NAME));
+            }
             return;
         }
         getCredentialManagerLaunchIntent(successCallback, failureCallback);
@@ -48,10 +66,18 @@
     private void getCredentialManagerLaunchIntent(
             Callback<PendingIntent> successCallback, Callback<Exception> failureCallback) {
         if (mException != null) {
-            failureCallback.onResult(mException);
+            if (mFailureCallback != null) {
+                mFailureCallback.onResult(mException);
+            } else {
+                failureCallback.onResult(mException);
+            }
             return;
         }
-        successCallback.onResult(mPendingIntent);
+        if (mSuccessCallback != null) {
+            mSuccessCallback.onResult(mPendingIntent);
+        } else {
+            successCallback.onResult(mPendingIntent);
+        }
     }
 
     @Override
diff --git a/chrome/browser/password_manager/android/test_support/java/src/org/chromium/chrome/browser/password_manager/FakeCredentialManagerLauncherFactoryImpl.java b/chrome/browser/password_manager/android/test_support/java/src/org/chromium/chrome/browser/password_manager/FakeCredentialManagerLauncherFactoryImpl.java
index 747338e..ed00f8e 100644
--- a/chrome/browser/password_manager/android/test_support/java/src/org/chromium/chrome/browser/password_manager/FakeCredentialManagerLauncherFactoryImpl.java
+++ b/chrome/browser/password_manager/android/test_support/java/src/org/chromium/chrome/browser/password_manager/FakeCredentialManagerLauncherFactoryImpl.java
@@ -4,18 +4,40 @@
 
 package org.chromium.chrome.browser.password_manager;
 
+import android.app.PendingIntent;
+
+import org.chromium.base.Callback;
+
 /**
  * The factory for creating a fake {@link CredentialManagerLauncher} to be used in integration
  * tests.
  */
 public class FakeCredentialManagerLauncherFactoryImpl extends CredentialManagerLauncherFactory {
-    private CredentialManagerLauncher mLauncher;
+    private FakeCredentialManagerLauncher mLauncher;
+    private PendingIntent mPendingIntent;
+    private Callback<PendingIntent> mSuccessCallback;
+    private Callback<Exception> mFailureCallback;
+
+    public void setSuccessCallback(Callback<PendingIntent> successCallback) {
+        mSuccessCallback = successCallback;
+    }
+
+    public void setFailureCallback(Callback<Exception> failureCallback) {
+        mFailureCallback = failureCallback;
+    }
+
+    public void setIntent(PendingIntent pendingIntent) {
+        mPendingIntent = pendingIntent;
+    }
 
     /** Returns the fake implementation of {@link CredentialManagerLauncher} used for tests. */
     @Override
     public CredentialManagerLauncher createLauncher() {
         if (mLauncher == null) {
             mLauncher = new FakeCredentialManagerLauncher();
+            mLauncher.setSuccessCallback(mSuccessCallback);
+            mLauncher.setFailureCallback(mFailureCallback);
+            mLauncher.setIntent(mPendingIntent);
         }
         return mLauncher;
     }
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
index e7c31b3..91bce37 100644
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
@@ -772,8 +772,8 @@
             "settings_personalized_signin_promo_dismissed";
 
     // TODO(crbug.com/40697988): Remove this after migrating the legacy code that uses
-    //                                  the sync account before the native is loaded.
-    public static final String SIGNIN_LEGACY_SYNC_ACCOUNT_EMAIL = "google.services.username";
+    //                                  the primary account before the native is loaded.
+    public static final String SIGNIN_LEGACY_PRIMARY_ACCOUNT_EMAIL = "google.services.username";
 
     public static final String SNAPSHOT_DATABASE_REMOVED = "snapshot_database_removed";
 
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
index 853b754..44cd23f 100644
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
@@ -18,8 +18,7 @@
 @CheckDiscard("Validation is performed in tests and in debug builds.")
 public class LegacyChromePreferenceKeys {
     /**
-     * @return The list of [keys in use] that do not conform to the "Chrome.[Feature].[Key]"
-     *     format.
+     * @return The list of [keys in use] that do not conform to the "Chrome.[Feature].[Key]" format.
      */
     static List<String> getKeysInUse() {
         return Arrays.asList(
@@ -113,7 +112,7 @@
                 ChromePreferenceKeys.SIGNIN_PROMO_NTP_PROMO_SUPPRESSION_PERIOD_START,
                 ChromePreferenceKeys.SIGNIN_PROMO_BOOKMARKS_DECLINED,
                 ChromePreferenceKeys.SIGNIN_PROMO_SETTINGS_PERSONALIZED_DISMISSED,
-                ChromePreferenceKeys.SIGNIN_LEGACY_SYNC_ACCOUNT_EMAIL,
+                ChromePreferenceKeys.SIGNIN_LEGACY_PRIMARY_ACCOUNT_EMAIL,
                 ChromePreferenceKeys.SNAPSHOT_DATABASE_REMOVED,
                 ChromePreferenceKeys.SYNC_ERROR_MESSAGE_SHOWN_AT_TIME,
                 ChromePreferenceKeys.TABBED_ACTIVITY_LAST_BACKGROUNDED_TIME_MS_PREF,
diff --git a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogTest.java b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogTest.java
index e23b1539..0e581c60 100644
--- a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogTest.java
+++ b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogTest.java
@@ -255,6 +255,7 @@
 
     @Test
     @SmallTest
+    @DisabledTest(message = "Flaky test. crbug.com/338991368")
     public void testControllerShowsEEAConsent() throws IOException {
         PrivacySandboxDialogController.disableEEANoticeForTesting(true);
 
@@ -278,6 +279,7 @@
 
     @Test
     @SmallTest
+    @DisabledTest(message = "Flaky test. crbug.com/338991368")
     public void testControllerShowsEEAConsentDropdown() {
         PrivacySandboxDialogController.disableEEANoticeForTesting(true);
 
@@ -412,6 +414,7 @@
 
     @Test
     @SmallTest
+    @DisabledTest(message = "Flaky test. crbug.com/338991368")
     public void testControllerShowsROWNotice() throws IOException {
         mFakePrivacySandboxBridge.setRequiredPromptType(PromptType.M1_NOTICE_ROW);
         launchDialog();
@@ -462,6 +465,7 @@
 
     @Test
     @SmallTest
+    @DisabledTest(message = "Flaky test. crbug.com/338991368")
     public void testControllerShowsRestrictedNotice() throws IOException {
         mFakePrivacySandboxBridge.setRequiredPromptType(PromptType.M1_NOTICE_RESTRICTED);
         launchDialog();
diff --git a/chrome/browser/resources/chromeos/login/BUILD.gn b/chrome/browser/resources/chromeos/login/BUILD.gn
index 2fd22b4..7a1d885 100644
--- a/chrome/browser/resources/chromeos/login/BUILD.gn
+++ b/chrome/browser/resources/chromeos/login/BUILD.gn
@@ -172,6 +172,7 @@
     "components/oobe_a11y_option.ts",
     "components/oobe_apps_list.ts",
     "components/oobe_carousel.ts",
+    "components/oobe_categories_list.ts",
     "components/oobe_cr_lottie.ts",
     "components/oobe_display_size_selector.ts",
     "components/oobe_i18n_dropdown.ts",
diff --git a/chrome/browser/resources/chromeos/login/components/oobe_categories_list.html b/chrome/browser/resources/chromeos/login/components/oobe_categories_list.html
new file mode 100644
index 0000000..dfcdb19
--- /dev/null
+++ b/chrome/browser/resources/chromeos/login/components/oobe_categories_list.html
@@ -0,0 +1,140 @@
+<!-- Copyright 2024 The Chromium Authors
+     Use of this source code is governed by a BSD-style license that can be
+     found in the LICENSE file. -->
+
+
+<!--
+  OOBE polymer element which is used to show a list of categories
+  that would be displayed in Persona Screen.
+  It has all styling for the categories_item element and can display
+  for each categories : Icon and a title and subtitle.
+-->
+
+<style include="oobe-dialog-host-styles cros-color-overrides">
+  :host {
+    --cr-card-button-height: 150px;
+    --iron-icon-width: 40px;
+    --iron-icon-height: 40px;
+  }
+
+  #categoriesList {
+    column-gap: 16px;
+    display: grid;
+    grid-template-columns: repeat(2, 1fr);
+    overflow-y: auto;
+    width: 100%;
+  }
+
+  .category-title {
+    color: var(--cros-sys-on_surface);
+    font: var(--cros-button-2-font);
+  }
+
+  .category-subtitle {
+    color: var(--cros-sys-on_surface_variant);
+    font: var(--cros-annotation-1-font);
+  }
+
+  .category-item {
+    background-color: var(--cros-sys-on_primary)  !important;
+    border-radius: 16px;
+    border-width: 0;
+    box-shadow: none;
+    gap: 16px;
+    display: flex;
+    height: 84px;
+    margin-bottom: 8px;
+    margin-inline-end: 4px;
+    margin-inline-start: 4px;
+    margin-top: 8px;
+    width: 100%;
+    align-items: center;
+  }
+
+  .category-item:hover {
+    background-color: var(--cros-sys-app_base_shaded);
+  }
+
+  .text-container {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+  }
+
+  .category-item:focus {
+    border: 2px solid var(--cros-sys-focus_ring);
+  }
+
+  .category-item[checked=true] .selected-icon {
+    display: flex;
+  }
+
+  .category-item[checked=true] .logo-container {
+    display: none;
+  }
+
+  .selected-icon {
+    align-items: center;
+    align-self: center;
+    display: none;
+    height: 40px;
+    width: 40px;
+  }
+
+  .logo-container {
+    width: 40px;
+    height: 40px;
+    border-radius: 22px;
+    align-items: center;
+    justify-content: center;
+    display: flex;
+    background-color: var(--cros-sys-primary_container);
+  }
+
+  /* Styles of icons in screen cards */
+  .category-icon  {
+    align-items: center;
+    align-self: center;
+    display: flex;
+    height: 24px;
+    width: 24px;
+  }
+
+  .content {
+    align-items: center;
+    align-self: center;
+    column-gap: 12px;
+  }
+</style>
+<div id="categoriesList">
+  <template is="dom-repeat" rendered-item-count="{{itemRendered}}"
+        items="{{categoriesList}}">
+    <cr-button id="[[getCategoryId(item.categoryId)]]"
+        class="category-item"
+        role="checkbox"
+        aria-checked="[[item.selected]]"
+        on-click="onClick">
+      <div class="content flex horizontal layout">
+        <div class="logo-container">
+          <webview
+              id="[[getWebViewId(item.categoryId)]]"
+              role="img"
+              class="category-icon"
+              src="[[getIconUrl(item.icon)]]"
+              aria-hidden="true"
+              tabindex="-1"
+              on-contentload="[[onIconLoaded()]]"
+            >
+          </webview>
+        </div>
+        <div class="selected-icon">
+          <iron-icon icon="oobe-40:category-selected"></iron-icon>
+        </div>
+        <div class="text-container" aria-hidden="true">
+          <div class="category-title"> [[item.title]]</div>
+          <div class="category-subtitle">[[item.subtitle]]</div>
+        </div>
+      </div>
+    </cr-button>
+  </template>
+</div>
diff --git a/chrome/browser/resources/chromeos/login/components/oobe_categories_list.ts b/chrome/browser/resources/chromeos/login/components/oobe_categories_list.ts
new file mode 100644
index 0000000..dc3e25a
--- /dev/null
+++ b/chrome/browser/resources/chromeos/login/components/oobe_categories_list.ts
@@ -0,0 +1,200 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import '//resources/ash/common/cr_elements/cros_color_overrides.css.js';
+import '//resources/ash/common/cr_elements/icons.html.js';
+
+import {PolymerElementProperties} from '//resources/polymer/v3_0/polymer/interfaces.js';
+import {DomRepeatEvent, PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js';
+
+import {getTemplate} from './oobe_categories_list.html.js';
+
+/**
+ * Data that is passed to the component during initialization.
+ */
+export interface OobeCategoriesListCategory {
+  categoryId: string;
+  title: string;
+  subtitle: string;
+  icon: string;
+  selected: boolean;
+}
+
+const GENERATE_WEB_VIEW_CSS = (backgroundColor: string, iconColor: string) => {
+  return {
+    code: `svg {
+      background-color: ` +
+        backgroundColor + `;
+      --oobe-jelly-icon-color: ` +
+        iconColor + `;
+    }`,
+  };
+};
+
+export interface OobeCategoriesListData extends
+    Array<OobeCategoriesListCategory> {}
+
+const OobeCategoriesListBase = PolymerElement;
+
+export class OobeCategoriesList extends OobeCategoriesListBase {
+  static get is() {
+    return 'oobe-categories-list' as const;
+  }
+
+  static get template(): HTMLTemplateElement {
+    return getTemplate();
+  }
+
+  static get properties(): PolymerElementProperties {
+    return {
+      /**
+       * List of categories to display.
+       */
+      categoriesList: {
+        type: Array,
+        value: [],
+        notify: true,
+      },
+      /**
+       * List of selected categories.
+       */
+      categoriesSelected: {
+        type: Array,
+        value: [],
+      },
+      /**
+       * Number of selected categories.
+       */
+      selectedCategoriesCount: {
+        type: Number,
+        value: 0,
+        notify: true,
+      },
+      /**
+       * Number of loaded icons categories.
+       */
+      loadedIconsCount: {
+        type: Number,
+        value: 0,
+      },
+      /**
+       * Number of dom repeat rendered items.
+       */
+      itemRendered: {
+        type: Number,
+        value: 0,
+        observer: 'itemRenderedChanged',
+      },
+    };
+  }
+
+  private categoriesList: OobeCategoriesListData;
+  private categoriesSelected: string[];
+  private selectedCategoriesCount: number;
+  private loadedIconsCount: number;
+  private itemRendered: number;
+
+  /**
+   * Initialize the list of categories.
+   */
+  init(categories: OobeCategoriesListData): void {
+    this.categoriesList = categories;
+    this.categoriesSelected = [];
+    this.selectedCategoriesCount = 0;
+    this.loadedIconsCount = 0;
+    this.itemRendered = 0;
+  }
+
+  itemRenderedChanged(): void {
+    if (this.itemRendered === this.categoriesList.length &&
+        this.loadedIconsCount === this.categoriesList.length) {
+      this.setWebviewStyle();
+      this.dispatchEvent(
+          new CustomEvent('icons-loaded', {bubbles: true, composed: true}));
+    }
+  }
+
+  /**
+   * Return the list of selected categories.
+   */
+  getCategoriesSelected(): string[] {
+    return this.categoriesSelected;
+  }
+
+  setWebviewStyle(): void {
+    const iconWebviews =
+        this.shadowRoot?.querySelectorAll<chrome.webviewTag.WebView>(
+            '.category-icon');
+    if (iconWebviews) {
+      const BackgroundColor =
+          getComputedStyle(document.body)
+              .getPropertyValue('--cros-sys-primary_container');
+      const iconColor = getComputedStyle(document.body)
+                            .getPropertyValue('--cros-sys-primary');
+      for (const iconWebview of iconWebviews) {
+        this.injectCss(iconWebview, BackgroundColor, iconColor);
+      }
+    }
+  }
+
+  private getIconUrl(iconUrl: string): string {
+    return iconUrl;
+  }
+
+  private onClick(e: DomRepeatEvent<OobeCategoriesListCategory, MouseEvent>):
+      void {
+    const clickedCategory = e.model.item;
+    const previousSelectedState = clickedCategory.selected;
+    const currentSelectedState = !previousSelectedState;
+    const path = `categoriesList.${
+        this.categoriesList.indexOf(clickedCategory)}.selected`;
+    this.set(path, currentSelectedState);
+    (e.currentTarget as HTMLElement)
+        ?.setAttribute('checked', String(currentSelectedState));
+
+    if (currentSelectedState) {
+      this.selectedCategoriesCount++;
+      this.categoriesSelected.push(clickedCategory.categoryId);
+    } else {
+      this.selectedCategoriesCount--;
+      this.categoriesSelected.splice(
+          this.categoriesSelected.indexOf(clickedCategory.categoryId), 1);
+    }
+    this.notifyPath('categoriesList');
+  }
+
+  private getCategoryId(categoryId: string): string {
+    return 'cr-button-' + categoryId;
+  }
+
+  private getWebViewId(categoryId: string): string {
+    return 'webview-' + categoryId;
+  }
+
+  private onIconLoaded(): void {
+    this.loadedIconsCount += 1;
+  }
+
+  private injectCss(
+      webview: chrome.webviewTag.WebView, backgroundColor: string,
+      iconColor: string) {
+    webview.addEventListener('contentload', () => {
+      webview.insertCSS(
+          GENERATE_WEB_VIEW_CSS(backgroundColor, iconColor), () => {
+            if (chrome.runtime.lastError) {
+              console.warn(
+                  'Failed to insertCSS: ' + chrome.runtime.lastError.message);
+            }
+          });
+    });
+  }
+}
+
+declare global {
+  interface HTMLElementTagNameMap {
+    [OobeCategoriesList.is]: OobeCategoriesList;
+  }
+}
+
+customElements.define(OobeCategoriesList.is, OobeCategoriesList);
diff --git a/chrome/browser/resources/chromeos/login/components/oobe_icons.html b/chrome/browser/resources/chromeos/login/components/oobe_icons.html
index 8e568a12..b441b421 100644
--- a/chrome/browser/resources/chromeos/login/components/oobe_icons.html
+++ b/chrome/browser/resources/chromeos/login/components/oobe_icons.html
@@ -386,6 +386,10 @@
         <path d="M31.2291 23.0049C31.5789 22.6317 32.1461 22.6317 32.496 23.0049C32.8458 23.378 32.8458 23.9831 32.496 24.3562L28.9126 28.1784C28.5628 28.5516 27.9956 28.5516 27.6457 28.1784L25.8541 26.2673C25.5042 25.8942 25.5042 25.2891 25.8541 24.916C26.2039 24.5428 26.7711 24.5428 27.121 24.916L28.2792 26.1514L31.2291 23.0049Z" fill="var(--oobe-duotone-cut-out)"></path>
         <path d="M25.6812 29.605C25.236 29.605 24.875 29.99 24.875 30.465C24.875 30.94 25.236 31.325 25.6812 31.325H32.6687C33.114 31.325 33.475 30.94 33.475 30.465C33.475 29.99 33.114 29.605 32.6687 29.605H25.6812Z" fill="var(--oobe-duotone-bg)"></path>
       </g>
+      <g id="category-selected">
+        <rect width="40" height="40" rx="20" fill="var(--cros-sys-primary)"></rect>
+        <path d="M18 24.4L14 20.4L15.4 19L18 21.6L24.6 15L26 16.4L18 24.4Z" fill="var(--cros-sys-primary_container)"></path>
+      </g>
     </defs>
   </svg>
 </iron-iconset-svg>
diff --git a/chrome/browser/resources/password_manager/credential_details/credential_field.html b/chrome/browser/resources/password_manager/credential_details/credential_field.html
index 80b3ca9..de49c20 100644
--- a/chrome/browser/resources/password_manager/credential_details/credential_field.html
+++ b/chrome/browser/resources/password_manager/credential_details/credential_field.html
@@ -8,7 +8,3 @@
       on-click="onCopyValueClick_" hidden="[[!value]]">
   </cr-icon-button>
 </cr-input>
-
-<cr-toast id="toast" duration="5000">
-  <span>[[valueCopiedToastLabel]]</span>
-</cr-toast>
diff --git a/chrome/browser/resources/password_manager/credential_details/credential_field.ts b/chrome/browser/resources/password_manager/credential_details/credential_field.ts
index 55268cdb..46d0653 100644
--- a/chrome/browser/resources/password_manager/credential_details/credential_field.ts
+++ b/chrome/browser/resources/password_manager/credential_details/credential_field.ts
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import type {CrToastElement} from '//resources/cr_elements/cr_toast/cr_toast.js';
 import type {CrIconButtonElement} from 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js';
 import type {CrInputElement} from 'chrome://resources/cr_elements/cr_input/cr_input.js';
 import {assert} from 'chrome://resources/js/assert.js';
@@ -16,7 +15,6 @@
   $: {
     inputValue: CrInputElement,
     copyButton: CrIconButtonElement,
-    toast: CrToastElement,
   };
 }
 
@@ -82,13 +80,21 @@
 
   private onCopyValueClick_() {
     navigator.clipboard.writeText(this.value).catch(() => {});
-    this.$.toast.show();
+    this.showToast_();
     PasswordManagerImpl.getInstance().extendAuthValidity();
     if (this.interactionId) {
       PasswordManagerImpl.getInstance().recordPasswordViewInteraction(
           this.interactionId);
     }
   }
+
+  private showToast_() {
+    this.dispatchEvent(new CustomEvent('value-copied', {
+      bubbles: true,
+      composed: true,
+      detail: {toastMessage: this.valueCopiedToastLabel},
+    }));
+  }
 }
 
 declare global {
diff --git a/chrome/browser/resources/password_manager/credential_details/password_details_card.html b/chrome/browser/resources/password_manager/credential_details/password_details_card.html
index e53f8c8c..497a2e3 100644
--- a/chrome/browser/resources/password_manager/credential_details/password_details_card.html
+++ b/chrome/browser/resources/password_manager/credential_details/password_details_card.html
@@ -134,9 +134,6 @@
       id="deletePasswordDialog" duplicated-password="[[password]]">
   </multi-store-delete-password-dialog>
 </template>
-<cr-toast id="toast" duration="5000">
-  <span>[[toastMessage_]]</span>
-</cr-toast>
 <template is="dom-if" if="[[showMovePasswordDialog_]]" restamp>
   <move-single-password-dialog on-close="onMovePasswordDialogClose_"
       id="movePasswordsDialog" password="[[password]]">
diff --git a/chrome/browser/resources/password_manager/credential_details/password_details_card.ts b/chrome/browser/resources/password_manager/credential_details/password_details_card.ts
index 8f4aead..93130a76 100644
--- a/chrome/browser/resources/password_manager/credential_details/password_details_card.ts
+++ b/chrome/browser/resources/password_manager/credential_details/password_details_card.ts
@@ -8,7 +8,6 @@
 import 'chrome://resources/cr_elements/cr_icons.css.js';
 import 'chrome://resources/cr_elements/cr_input/cr_input.js';
 import 'chrome://resources/cr_elements/cr_shared_style.css.js';
-import 'chrome://resources/cr_elements/cr_toast/cr_toast.js';
 import 'chrome://resources/cr_elements/policy/cr_tooltip_icon.js';
 import '../shared_style.css.js';
 import './credential_details_card.css.js';
@@ -18,7 +17,6 @@
 import '../sharing/metrics_utils.js';
 import '../dialogs/move_single_password_dialog.js';
 
-import type {CrToastElement} from '//resources/cr_elements/cr_toast/cr_toast.js';
 import {PrefsMixin} from '/shared/settings/prefs/prefs_mixin.js';
 import {HelpBubbleMixin} from 'chrome://resources/cr_components/help_bubble/help_bubble_mixin.js';
 import type {CrButtonElement} from 'chrome://resources/cr_elements/cr_button/cr_button.js';
@@ -28,7 +26,7 @@
 import {loadTimeData} from 'chrome://resources/js/load_time_data.js';
 import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
 
-import type {PasswordsMovedEvent} from '../password_manager_app.js';
+import type {PasswordsMovedEvent, ValueCopiedEvent} from '../password_manager_app.js';
 import {PasswordManagerImpl, PasswordViewPageInteractions} from '../password_manager_proxy.js';
 import {PasswordSharingActions, recordPasswordSharingInteraction} from '../sharing/metrics_utils.js';
 import {ShowPasswordMixin} from '../show_password_mixin.js';
@@ -48,6 +46,7 @@
   interface HTMLElementEventMap {
     'password-removed': PasswordRemovedEvent;
     'passwords-moved': PasswordsMovedEvent;
+    'value-copied': ValueCopiedEvent;
   }
 }
 
@@ -61,7 +60,6 @@
     noteValue: CredentialNoteElement,
     showMore: HTMLAnchorElement,
     showPasswordButton: CrIconButtonElement,
-    toast: CrToastElement,
     usernameValue: CredentialFieldElement,
     shareButton: CrButtonElement,
   };
@@ -81,10 +79,12 @@
 
   static get properties() {
     return {
-      password: Object,
+      password: {
+        type: Object,
+        observer: 'onPasswordChanged_',
+      },
       groupName: String,
       iconUrl: String,
-      toastMessage_: String,
       usernameCopyInteraction_: {
         type: PasswordViewPageInteractions,
         value() {
@@ -137,7 +137,6 @@
   groupName: string;
   iconUrl: string;
   isUsingAccountStore: boolean;
-  private toastMessage_: string;
   private showEditPasswordDialog_: boolean;
   private passwordSharingDisabled_: boolean;
   private showDeletePasswordDialog_: boolean;
@@ -202,8 +201,11 @@
   }
 
   private showToast_(message: string) {
-    this.toastMessage_ = message;
-    this.$.toast.show();
+    this.dispatchEvent(new CustomEvent('value-copied', {
+      bubbles: true,
+      composed: true,
+      detail: {toastMessage: message},
+    }));
   }
 
   private onEditClicked_() {
@@ -320,6 +322,10 @@
     this.showMovePasswordDialog_ = false;
   }
 
+  private onPasswordChanged_(): void {
+    this.isPasswordVisible = false;
+  }
+
   maybeRegisterSharingHelpBubble(): void {
     if (!this.showShareButton_ && !this.passwordSharingDisabled_) {
       return;
diff --git a/chrome/browser/resources/password_manager/password_manager_app.html b/chrome/browser/resources/password_manager/password_manager_app.html
index fcc2ef8..8ecdd930b 100644
--- a/chrome/browser/resources/password_manager/password_manager_app.html
+++ b/chrome/browser/resources/password_manager/password_manager_app.html
@@ -117,7 +117,8 @@
         <password-details-section class="cr-centered-card-container"
             on-password-removed="onPasswordRemoved_" prefs="{{prefs_}}"
             on-passkey-removed="onPasskeyRemoved_"
-            on-passwords-moved="onPasswordsMoved_">
+            on-passwords-moved="onPasswordsMoved_"
+            on-value-copied="onValueCopied_">
         </password-details-section>
       </template>
     </div>
diff --git a/chrome/browser/resources/password_manager/password_manager_app.ts b/chrome/browser/resources/password_manager/password_manager_app.ts
index 3a4255f..7d0aa2de 100644
--- a/chrome/browser/resources/password_manager/password_manager_app.ts
+++ b/chrome/browser/resources/password_manager/password_manager_app.ts
@@ -59,6 +59,8 @@
 export type PasswordsMovedEvent =
     CustomEvent<{accountEmail: string, numberOfPasswords: number}>;
 
+export type ValueCopiedEvent = CustomEvent<{toastMessage: string}>;
+
 export interface PasswordManagerAppElement {
   $: {
     checkup: CheckupSectionElement,
@@ -299,6 +301,12 @@
     this.$.toast.show();
   }
 
+  private async onValueCopied_(event: ValueCopiedEvent) {
+    this.showUndo_ = false;
+    this.toastMessage_ = event.detail.toastMessage;
+    this.$.toast.show();
+  }
+
   private onUndoButtonClick_() {
     PasswordManagerImpl.getInstance().undoRemoveSavedPasswordOrException();
     this.$.toast.hide();
diff --git a/chrome/browser/safety_hub/android/BUILD.gn b/chrome/browser/safety_hub/android/BUILD.gn
index da9ae72..a40006a 100644
--- a/chrome/browser/safety_hub/android/BUILD.gn
+++ b/chrome/browser/safety_hub/android/BUILD.gn
@@ -3,9 +3,16 @@
 # found in the LICENSE file.
 
 import("//build/config/android/rules.gni")
+import("//third_party/jni_zero/jni_zero.gni")
+
+generate_jni("jni_headers") {
+  sources =
+      [ "java/src/org/chromium/chrome/browser/safety_hub/PermissionsData.java" ]
+}
 
 android_library("java") {
   sources = [
+    "java/src/org/chromium/chrome/browser/safety_hub/PermissionsData.java",
     "java/src/org/chromium/chrome/browser/safety_hub/SafetyHubFetchService.java",
     "java/src/org/chromium/chrome/browser/safety_hub/SafetyHubFragment.java",
     "java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegate.java",
@@ -27,6 +34,7 @@
     "//components/background_task_scheduler:factory_java",
     "//components/background_task_scheduler:public_java",
     "//components/browser_ui/settings/android:java",
+    "//components/content_settings/core/common:content_settings_types_java",
     "//components/password_manager/core/browser:password_manager_java_enums",
     "//components/prefs/android:java",
     "//components/sync/android:sync_java",
@@ -35,8 +43,11 @@
     "//third_party/androidx:androidx_annotation_annotation_java",
     "//third_party/androidx:androidx_fragment_fragment_java",
     "//third_party/androidx:androidx_preference_preference_java",
+    "//third_party/jni_zero:jni_zero_java",
     "//ui/android:ui_java",
+    "//url:url_java",
   ]
+  srcjar_deps = [ ":jni_headers" ]
   resources_package = "org.chromium.chrome.browser.safety_hub"
 }
 
@@ -83,15 +94,31 @@
   sources = [
     "prefs.cc",
     "prefs.h",
+    "unused_site_permissions_bridge.cc",
+    "unused_site_permissions_bridge.h",
   ]
 
   deps = [
+    ":jni_headers",
+    "//chrome/browser/ui",
     "//chrome/common:constants",
+    "//components/content_settings/core/common",
     "//components/pref_registry",
     "//components/prefs",
   ]
 }
 
+source_set("unit_tests") {
+  testonly = true
+  sources = [ "unused_site_permissions_bridge_unittest.cc" ]
+  deps = [
+    ":android",
+    "//base/test:test_support",
+    "//chrome/browser/ui",
+    "//components/content_settings/core/common",
+  ]
+}
+
 android_resources("java_resources") {
   sources = [ "java/res/xml/safety_hub_preferences.xml" ]
   deps = [
diff --git a/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/PermissionsData.java b/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/PermissionsData.java
new file mode 100644
index 0000000..4e105973
--- /dev/null
+++ b/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/PermissionsData.java
@@ -0,0 +1,60 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.safety_hub;
+
+import org.jni_zero.CalledByNative;
+import org.jni_zero.JniType;
+
+import org.chromium.components.content_settings.ContentSettingsType;
+
+/** Container class needed to pass information from Native to Java and vice versa. */
+public class PermissionsData {
+    private final String mOrigin;
+    private final @ContentSettingsType.EnumType int[] mPermissions;
+    // Microseconds since windows epoch.
+    private final long mExpiration;
+    // TimeDelta in microseconds.
+    private final long mLifetime;
+
+    private PermissionsData(
+            String origin,
+            @ContentSettingsType.EnumType int[] permissions,
+            long expiration,
+            long lifetime) {
+        mOrigin = origin;
+        mPermissions = permissions;
+        mExpiration = expiration;
+        mLifetime = lifetime;
+    }
+
+    @CalledByNative
+    private static PermissionsData create(
+            @JniType("std::string") String origin,
+            @JniType("std::vector<int32_t>") int[] permissions,
+            @JniType("std::int64_t") long expiration,
+            @JniType("std::int64_t") long lifetime) {
+        return new PermissionsData(origin, permissions, expiration, lifetime);
+    }
+
+    @CalledByNative
+    public @JniType("std::string") String getOrigin() {
+        return mOrigin;
+    }
+
+    @CalledByNative
+    public @JniType("std::vector<int32_t>") int[] getPermissions() {
+        return mPermissions;
+    }
+
+    @CalledByNative
+    public @JniType("std::int64_t") long getExpiration() {
+        return mExpiration;
+    }
+
+    @CalledByNative
+    public @JniType("std::int64_t") long getLifetime() {
+        return mLifetime;
+    }
+}
diff --git a/chrome/browser/safety_hub/android/unused_site_permissions_bridge.cc b/chrome/browser/safety_hub/android/unused_site_permissions_bridge.cc
new file mode 100644
index 0000000..0cc80022
--- /dev/null
+++ b/chrome/browser/safety_hub/android/unused_site_permissions_bridge.cc
@@ -0,0 +1,67 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/safety_hub/android/unused_site_permissions_bridge.h"
+
+#include <jni.h>
+
+#include "base/time/time.h"
+#include "chrome/browser/safety_hub/android/jni_headers/PermissionsData_jni.h"
+#include "chrome/browser/ui/safety_hub/unused_site_permissions_service.h"
+#include "components/content_settings/core/common/content_settings_constraints.h"
+#include "components/content_settings/core/common/content_settings_pattern.h"
+#include "components/content_settings/core/common/content_settings_types.h"
+
+namespace jni_zero {
+
+template <>
+PermissionsData FromJniType<PermissionsData>(JNIEnv* env,
+                                             const JavaRef<jobject>& jobject) {
+  return FromJavaPermissionsData(env, jobject);
+}
+
+template <>
+ScopedJavaLocalRef<jobject> ToJniType(JNIEnv* env, const PermissionsData& obj) {
+  return ToJavaPermissionsData(env, obj);
+}
+
+}  // namespace jni_zero
+
+PermissionsData FromJavaPermissionsData(
+    JNIEnv* env,
+    const base::android::JavaRef<jobject>& jobject) {
+  PermissionsData permissions_data;
+
+  permissions_data.origin = ContentSettingsPattern::FromString(
+      Java_PermissionsData_getOrigin(env, jobject));
+
+  for (const int32_t permission_type :
+       Java_PermissionsData_getPermissions(env, jobject)) {
+    permissions_data.permission_types.insert(
+        static_cast<ContentSettingsType>(permission_type));
+  }
+
+  const base::Time expiration = base::Time::FromDeltaSinceWindowsEpoch(
+      base::Microseconds(Java_PermissionsData_getExpiration(env, jobject)));
+  const base::TimeDelta lifetime =
+      base::Microseconds(Java_PermissionsData_getLifetime(env, jobject));
+  permissions_data.constraints =
+      content_settings::ContentSettingConstraints(expiration - lifetime);
+  permissions_data.constraints.set_lifetime(lifetime);
+
+  return permissions_data;
+}
+
+base::android::ScopedJavaLocalRef<jobject> ToJavaPermissionsData(
+    JNIEnv* env,
+    const PermissionsData& obj) {
+  std::vector<int32_t> permissions;
+  for (ContentSettingsType type : obj.permission_types) {
+    permissions.push_back(static_cast<int32_t>(type));
+  }
+  return Java_PermissionsData_create(
+      env, obj.origin.ToString(), permissions,
+      obj.constraints.expiration().ToDeltaSinceWindowsEpoch().InMicroseconds(),
+      obj.constraints.lifetime().InMicroseconds());
+}
diff --git a/chrome/browser/safety_hub/android/unused_site_permissions_bridge.h b/chrome/browser/safety_hub/android/unused_site_permissions_bridge.h
new file mode 100644
index 0000000..545a4c4
--- /dev/null
+++ b/chrome/browser/safety_hub/android/unused_site_permissions_bridge.h
@@ -0,0 +1,22 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SAFETY_HUB_ANDROID_UNUSED_SITE_PERMISSIONS_BRIDGE_H_
+#define CHROME_BROWSER_SAFETY_HUB_ANDROID_UNUSED_SITE_PERMISSIONS_BRIDGE_H_
+
+#include <jni.h>
+
+#include "base/android/scoped_java_ref.h"
+#include "chrome/browser/ui/safety_hub/unused_site_permissions_service.h"
+
+// JNI helper methods to enable unit testing.
+PermissionsData FromJavaPermissionsData(
+    JNIEnv* env,
+    const base::android::JavaRef<jobject>& jobject);
+
+base::android::ScopedJavaLocalRef<jobject> ToJavaPermissionsData(
+    JNIEnv* env,
+    const PermissionsData& obj);
+
+#endif  // CHROME_BROWSER_SAFETY_HUB_ANDROID_UNUSED_SITE_PERMISSIONS_BRIDGE_H_
diff --git a/chrome/browser/safety_hub/android/unused_site_permissions_bridge_unittest.cc b/chrome/browser/safety_hub/android/unused_site_permissions_bridge_unittest.cc
new file mode 100644
index 0000000..8e032c1
--- /dev/null
+++ b/chrome/browser/safety_hub/android/unused_site_permissions_bridge_unittest.cc
@@ -0,0 +1,68 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/safety_hub/android/unused_site_permissions_bridge.h"
+
+#include <jni.h>
+
+#include "base/android/jni_android.h"
+#include "base/time/time.h"
+#include "chrome/browser/ui/safety_hub/unused_site_permissions_service.h"
+#include "components/content_settings/core/common/content_settings_constraints.h"
+#include "components/content_settings/core/common/content_settings_pattern.h"
+#include "components/content_settings/core/common/content_settings_types.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+using base::android::AttachCurrentThread;
+
+namespace {
+
+constexpr char kUnusedTestSite[] = "https://example.com";
+std::set<ContentSettingsType> kUnusedPermissionList = {
+    ContentSettingsType::GEOLOCATION, ContentSettingsType::MEDIASTREAM_CAMERA,
+    ContentSettingsType::MEDIASTREAM_MIC};
+const base::Time kExpiration = base::Time::Now();
+const base::TimeDelta kLifetime = base::Days(30);
+
+}  // namespace
+
+class UnusedSitePermissionsBridgeTest : public testing::Test {
+ public:
+  UnusedSitePermissionsBridgeTest() : env_(AttachCurrentThread()) {}
+
+  raw_ptr<JNIEnv> env() { return env_; }
+
+ private:
+  raw_ptr<JNIEnv> env_;
+};
+
+TEST_F(UnusedSitePermissionsBridgeTest, TestJavaRoundTrip) {
+  PermissionsData expected;
+  expected.origin = ContentSettingsPattern::FromString(kUnusedTestSite);
+  expected.permission_types = kUnusedPermissionList;
+  expected.constraints =
+      content_settings::ContentSettingConstraints(kExpiration - kLifetime);
+  expected.constraints.set_lifetime(kLifetime);
+
+  const auto jobject = ToJavaPermissionsData(env(), expected);
+  PermissionsData converted = FromJavaPermissionsData(env(), jobject);
+
+  EXPECT_EQ(expected.origin, converted.origin);
+  EXPECT_EQ(expected.permission_types, converted.permission_types);
+  EXPECT_EQ(kExpiration, converted.constraints.expiration());
+  EXPECT_EQ(kLifetime, converted.constraints.lifetime());
+}
+
+TEST_F(UnusedSitePermissionsBridgeTest, TestDefaultValuesRoundTrip) {
+  PermissionsData expected;
+
+  const auto jobject = ToJavaPermissionsData(env(), expected);
+  PermissionsData converted = FromJavaPermissionsData(env(), jobject);
+
+  EXPECT_EQ(expected.origin, converted.origin);
+  EXPECT_EQ(expected.permission_types, converted.permission_types);
+  EXPECT_EQ(expected.constraints.expiration(),
+            converted.constraints.expiration());
+  EXPECT_EQ(expected.constraints.lifetime(), converted.constraints.lifetime());
+}
diff --git a/chrome/browser/screen_ai/README.md b/chrome/browser/screen_ai/README.md
index 890bfbe..cb53b30 100644
--- a/chrome/browser/screen_ai/README.md
+++ b/chrome/browser/screen_ai/README.md
@@ -1 +1,44 @@
-See `services/screen_ai/README.md`
+# Chrome Screen AI Library
+
+## Purpose
+ScreenAI service provides accessibility helpers, is downloaded and initialized
+on demand, and stays on disk for 30 days after the last use.\
+The service is created per profile and will stay alive as long as the profile
+lives.\
+See `services/screen_ai/README.md` for more.
+
+
+## How to Use for OCR
+Depending on your use case restrictions, choose one of the following
+approaches.
+1. Using `OpticalCharacterRecognizer:CreateWithStatusCallback`, create an OCR
+    object, and wait until the callback is called. This will trigger download
+    and startup of the service (if needed) and reports the result.\
+    Once the callback is called with `true` value, use
+    `OpticalCharacterRecognizer:PerformOCR`.\
+    Creation of the object can only be done in the UI thread.
+1. If you cannot use the callback, create the object using
+    `OpticalCharacterRecognizer:Create` and keep calling
+    `OpticalCharacterRecognizer:is_ready` until it tells you that the service
+    is ready.\
+    Then use `OpticalCharacterRecognizer:PerformOCR` as above.\
+    Creation of the object can only be done in the UI thread.
+1. If neither of the above work, in the browser process call
+   `screen_ai:ScreenAIServiceRouterFactory:GetForBrowserContext:GetServiceStateAsync`
+   to trigger library download and service initialization and receive the result
+   in a callback.\
+   Once you know the service is ready, trigger connection to it in your process
+   by connecting to `screen_ai:mojom:ScreenAIAnnotator` interface.\
+   For an example see `components/pdf/renderer/pdf_ocr_helper.cc`.
+
+## How to use Main Content Extraction
+In the browser process call
+`screen_ai:ScreenAIServiceRouterFactory:GetForBrowserContext:GetServiceStateAsync`
+to trigger library download and service initialization and receive the result in
+a callback.\
+Once you know the service is ready, trigger connection to it in your process by
+connecting to `screen_ai:mojom:Screen2xMainContentExtractor` interface.\
+For an example see `chrome/renderer/accessibility/ax_tree_distiller.cc`.
+
+## Bugs Component:
+  Chromium > UI > Accessibility > MachineIntelligence (component id: 1457124)
diff --git a/chrome/browser/screen_ai/public/BUILD.gn b/chrome/browser/screen_ai/public/BUILD.gn
index 1fe2f89..43df3b9 100644
--- a/chrome/browser/screen_ai/public/BUILD.gn
+++ b/chrome/browser/screen_ai/public/BUILD.gn
@@ -2,9 +2,6 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-# TODO(crbug.com/327181467): Consider adding another interface for main content
-# extraction.
-
 source_set("optical_character_recognizer") {
   sources = [
     "optical_character_recognizer.cc",
diff --git a/chrome/browser/screen_ai/public/optical_character_recognizer.h b/chrome/browser/screen_ai/public/optical_character_recognizer.h
index ba8dd37a..2619a4a 100644
--- a/chrome/browser/screen_ai/public/optical_character_recognizer.h
+++ b/chrome/browser/screen_ai/public/optical_character_recognizer.h
@@ -23,7 +23,7 @@
 namespace screen_ai {
 
 // A simple class to initialize and perform OCR service.
-// See how to use OCR section in `/services/screen_ai/README.md` for more info.
+// See OCR section in `chrome/browser/screen_ai/README.md` for more info.
 class OpticalCharacterRecognizer
     : public ProfileObserver,
       public base::RefCountedDeleteOnSequence<OpticalCharacterRecognizer> {
@@ -58,15 +58,13 @@
   bool StatusAvailableForTesting() { return ready_.has_value(); }
 
   // Performs OCR on the given image and returns the results as a
-  // `VisualAnnotation` struct. If the client is not in the browser process, it
-  // needs to implement this function in its own process.
+  // `VisualAnnotation` struct.
   virtual void PerformOCR(
       const SkBitmap& image,
       base::OnceCallback<void(mojom::VisualAnnotationPtr)> callback);
 
   // Performs OCR on the given image and returns the results as an accessibility
-  // tree update. If the client is not in the browser process, it needs to
-  // implement this function in its own process.
+  // tree update.
   virtual void PerformOCR(
       const SkBitmap& image,
       base::OnceCallback<void(const ui::AXTreeUpdate& tree_update)> callback);
diff --git a/chrome/browser/shortcuts/icon_badging.cc b/chrome/browser/shortcuts/icon_badging.cc
index f5d5e54..946c983 100644
--- a/chrome/browser/shortcuts/icon_badging.cc
+++ b/chrome/browser/shortcuts/icon_badging.cc
@@ -17,6 +17,7 @@
 #include "base/numerics/safe_conversions.h"
 #include "base/version_info/channel.h"
 #include "build/branding_buildflags.h"
+#include "build/buildflag.h"
 #include "chrome/common/channel_info.h"
 #include "chrome/grit/chrome_unscaled_resources.h"
 #include "third_party/skia/include/core/SkBitmap.h"
@@ -189,6 +190,23 @@
 static_assert(static_cast<int>(kDevResourceMap.size()) == resource_map_size,
               "Ensure icon resources are filled for all entries in BadgeSize "
               "for dev resource map");
+
+#elif BUILDFLAG(GOOGLE_CHROME_FOR_TESTING_BRANDING)
+constexpr SizeToResourceMap kChromeForTestingBrandedResourceMap =
+    base::MakeFixedFlatMap<BadgeSize, int>(
+        {{BadgeSize::k8, IDR_PRODUCT_LOGO_16_CFT_SHORTCUTS},
+         {BadgeSize::k12, IDR_PRODUCT_LOGO_16_CFT_SHORTCUTS},
+         {BadgeSize::k16, IDR_PRODUCT_LOGO_16_CFT_SHORTCUTS},
+         {BadgeSize::k24, IDR_PRODUCT_LOGO_24_CFT_SHORTCUTS},
+         {BadgeSize::k32, IDR_PRODUCT_LOGO_32_CFT_SHORTCUTS},
+         {BadgeSize::k48, IDR_PRODUCT_LOGO_48_CFT_SHORTCUTS},
+         {BadgeSize::k64, IDR_PRODUCT_LOGO_64_CFT_SHORTCUTS},
+         {BadgeSize::k128, IDR_PRODUCT_LOGO_128_CFT_SHORTCUTS}});
+
+static_assert(static_cast<int>(kChromeForTestingBrandedResourceMap.size()) ==
+                  resource_map_size,
+              "Ensure icon resources are filled for all entries in BadgeSize "
+              "for Chrome for testing resource map");
 #else
 constexpr SizeToResourceMap kChromiumResourceMap =
     base::MakeFixedFlatMap<BadgeSize, int>(
@@ -222,6 +240,8 @@
     case version_info::Channel::BETA:
       return kBetaResourceMap;
   }
+#elif BUILDFLAG(GOOGLE_CHROME_FOR_TESTING_BRANDING)
+  return kChromeForTestingBrandedResourceMap;
 #else
   return kChromiumResourceMap;
 #endif  // BUILDFLAG(GOOGLE_CHROME_BRANDING)
diff --git a/chrome/browser/shortcuts/icon_badging_unittest.cc b/chrome/browser/shortcuts/icon_badging_unittest.cc
index d1b7510..cd8f5de 100644
--- a/chrome/browser/shortcuts/icon_badging_unittest.cc
+++ b/chrome/browser/shortcuts/icon_badging_unittest.cc
@@ -16,6 +16,7 @@
 #include "base/strings/to_string.h"
 #include "base/test/gmock_expected_support.h"
 #include "build/branding_buildflags.h"
+#include "build/buildflag.h"
 #include "chrome/browser/shortcuts/image_test_utils.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/skia/include/core/SkBitmap.h"
@@ -48,6 +49,9 @@
   base::FilePath compile_time_folder;
 #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
   compile_time_folder = base::FilePath(FILE_PATH_LITERAL("chrome_branded"));
+#elif BUILDFLAG(GOOGLE_CHROME_FOR_TESTING_BRANDING)
+  compile_time_folder =
+      base::FilePath(FILE_PATH_LITERAL("chrome_for_testing_branded"));
 #else
   compile_time_folder = base::FilePath(FILE_PATH_LITERAL("chromium"));
 #endif
diff --git a/chrome/browser/signin/dice_web_signin_interceptor_browsertest.cc b/chrome/browser/signin/dice_web_signin_interceptor_browsertest.cc
index 5fbe5b79..0012e5f 100644
--- a/chrome/browser/signin/dice_web_signin_interceptor_browsertest.cc
+++ b/chrome/browser/signin/dice_web_signin_interceptor_browsertest.cc
@@ -58,6 +58,7 @@
 #include "components/signin/public/base/signin_metrics.h"
 #include "components/signin/public/base/signin_pref_names.h"
 #include "components/signin/public/base/signin_switches.h"
+#include "components/signin/public/identity_manager/account_capabilities_test_mutator.h"
 #include "components/signin/public/identity_manager/account_info.h"
 #include "components/signin/public/identity_manager/accounts_mutator.h"
 #include "components/signin/public/identity_manager/identity_manager.h"
@@ -266,6 +267,11 @@
     account_info.hosted_domain = hosted_domain;
     account_info.locale = "en";
     account_info.picture_url = "https://example.com";
+
+    // Fill in the required account capabilities for the sign in intercept.
+    AccountCapabilitiesTestMutator mutator(&account_info.capabilities);
+    mutator.set_is_subject_to_parental_controls(false);
+
     DCHECK(account_info.IsValid());
     identity_test_env()->UpdateAccountInfoForAccount(account_info);
     return account_info;
diff --git a/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/SigninPreferencesManager.java b/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/SigninPreferencesManager.java
index 7400f29..f201cc05 100644
--- a/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/SigninPreferencesManager.java
+++ b/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/SigninPreferencesManager.java
@@ -130,15 +130,28 @@
      */
     // TODO(crbug.com/40697988): Remove this after migrating the legacy code that uses
     //                                  the sync account before the native is loaded.
+    public void setLegacyPrimaryAccountEmail(@Nullable String accountEmail) {
+        mManager.writeString(
+                ChromePreferenceKeys.SIGNIN_LEGACY_PRIMARY_ACCOUNT_EMAIL, accountEmail);
+    }
+
+    // TODO(crbug.com/337003667): Remove after fixing internal usages.
+    @Deprecated
     public void setLegacySyncAccountEmail(@Nullable String accountEmail) {
-        mManager.writeString(ChromePreferenceKeys.SIGNIN_LEGACY_SYNC_ACCOUNT_EMAIL, accountEmail);
+        setLegacyPrimaryAccountEmail(accountEmail);
     }
 
     /** The email of the account for which sync was enabled. */
     // TODO(crbug.com/40697988): Remove this after migrating the legacy code that uses
     //                                  the sync account before the native is loaded.
+    public String getLegacyPrimaryAccountEmail() {
+        return mManager.readString(ChromePreferenceKeys.SIGNIN_LEGACY_PRIMARY_ACCOUNT_EMAIL, null);
+    }
+
+    // TODO(crbug.com/337003667): Remove after fixing internal usages.
+    @Deprecated
     public String getLegacySyncAccountEmail() {
-        return mManager.readString(ChromePreferenceKeys.SIGNIN_LEGACY_SYNC_ACCOUNT_EMAIL, null);
+        return getLegacyPrimaryAccountEmail();
     }
 
     /** Increments the active dismissal count for the account picker bottom sheet. */
diff --git a/chrome/browser/supervised_user/supervised_user_extensions_manager.cc b/chrome/browser/supervised_user/supervised_user_extensions_manager.cc
index a8a95e6..fc90949 100644
--- a/chrome/browser/supervised_user/supervised_user_extensions_manager.cc
+++ b/chrome/browser/supervised_user/supervised_user_extensions_manager.cc
@@ -374,9 +374,14 @@
     case ApprovedExtensionChange::kAdd:
       CHECK(!approved_extensions.FindString(extension_id));
       approved_extensions.Set(extension_id, std::move(version));
+
       SupervisedUserExtensionsMetricsRecorder::RecordExtensionsUmaMetrics(
-          SupervisedUserExtensionsMetricsRecorder::UmaExtensionState::
-              kApprovalGranted);
+          supervised_user::SupervisedUserCanSkipExtensionParentApprovals(
+              *user_prefs_.get())
+              ? SupervisedUserExtensionsMetricsRecorder::UmaExtensionState::
+                    kApprovalGrantedByDefault
+              : SupervisedUserExtensionsMetricsRecorder::UmaExtensionState::
+                    kApprovalGranted);
       break;
     case ApprovedExtensionChange::kRemove:
       success = approved_extensions.Remove(extension_id);
@@ -516,6 +521,9 @@
     if (extension_registry_->GetInstalledExtension(extension_entry.first)) {
       ChangeExtensionStateIfNecessary(extension_entry.first);
     }
+    SupervisedUserExtensionsMetricsRecorder::RecordExtensionsUmaMetrics(
+        SupervisedUserExtensionsMetricsRecorder::UmaExtensionState::
+            kLocalApprovalGranted);
   }
 }
 #endif  // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
diff --git a/chrome/browser/supervised_user/supervised_user_extensions_manager_unittest.cc b/chrome/browser/supervised_user/supervised_user_extensions_manager_unittest.cc
index 7d9b47c..67f6fcb 100644
--- a/chrome/browser/supervised_user/supervised_user_extensions_manager_unittest.cc
+++ b/chrome/browser/supervised_user/supervised_user_extensions_manager_unittest.cc
@@ -8,11 +8,13 @@
 #include <vector>
 
 #include "base/test/gtest_util.h"
+#include "base/test/metrics/histogram_tester.h"
 #include "base/test/scoped_feature_list.h"
 #include "base/values.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/extension_service_test_base.h"
 #include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/supervised_user/supervised_user_extensions_metrics_recorder.h"
 #include "chrome/browser/supervised_user/supervised_user_test_util.h"
 #include "chrome/test/base/testing_profile.h"
 #include "components/prefs/pref_service.h"
@@ -245,6 +247,7 @@
 TEST_P(SupervisedUserExtensionsManagerTest,
        MigrateExtensionsToLocallyApproved) {
   ASSERT_TRUE(profile_->IsChild());
+  base::HistogramTester histogram_tester;
 
   // Register the extensions.
   scoped_refptr<const Extension> approved_extn =
@@ -291,11 +294,17 @@
 
   // The extensions approved in the migration should be allowed and part
   // of the local-approved list.
+  int approved_extensions_count = has_local_approval_migration_run ? 1 : 0;
   EXPECT_EQ(
       has_local_approval_migration_run,
       local_approved_extensions_pref.contains(locally_approved_extn->id()));
   EXPECT_EQ(has_local_approval_migration_run,
             manager_->IsExtensionAllowed(*locally_approved_extn));
+  histogram_tester.ExpectBucketCount(
+      SupervisedUserExtensionsMetricsRecorder::kExtensionsHistogramName,
+      SupervisedUserExtensionsMetricsRecorder::UmaExtensionState::
+          kLocalApprovalGranted,
+      approved_extensions_count);
 }
 
 // Tests that extensions missing parent approval are granted parent approval
@@ -305,6 +314,7 @@
 TEST_P(SupervisedUserExtensionsManagerTest,
        GrantParentApprovalOnInstallationWhenExtensionsToggleOn) {
   ASSERT_TRUE(profile_->IsChild());
+  base::HistogramTester histogram_tester;
 
 #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
   // Mark the migration done to avoid any interference with the one-off
@@ -343,6 +353,19 @@
   // switch manages them.
   supervised_user_test_util::SetSkipParentApprovalToInstallExtensionsPref(
       profile(), true);
+
+  // Toggling the extensions results in granting approval to the existing
+  // extension if the Extensions switch manages them.
+  int approved_extensions_count =
+      GetExtensionsManagingToggle() == ExtensionsManagingToggle::kExtensions
+          ? 1
+          : 0;
+  histogram_tester.ExpectBucketCount(
+      SupervisedUserExtensionsMetricsRecorder::kExtensionsHistogramName,
+      SupervisedUserExtensionsMetricsRecorder::UmaExtensionState::
+          kApprovalGrantedByDefault,
+      approved_extensions_count);
+
   // Install an extension.
   scoped_refptr<const Extension> extn_with_switch_on =
       MakeExtension("extension_test_2");
@@ -361,6 +384,19 @@
                 ->GetPrefs()
                 ->GetDict(prefs::kSupervisedUserApprovedExtensions)
                 .contains(extn_with_switch_on->id()));
+
+  histogram_tester.ExpectBucketCount(
+      SupervisedUserExtensionsMetricsRecorder::kExtensionsHistogramName,
+      SupervisedUserExtensionsMetricsRecorder::UmaExtensionState::
+          kApprovalGrantedByDefault,
+      approved_extensions_count + (is_extension_approved ? 1 : 0));
+  // The migration to locally approved extensions has occurred before we
+  // installed any extensions, so not local approvals have been granted.
+  histogram_tester.ExpectBucketCount(
+      SupervisedUserExtensionsMetricsRecorder::kExtensionsHistogramName,
+      SupervisedUserExtensionsMetricsRecorder::UmaExtensionState::
+          kLocalApprovalGranted,
+      0);
 }
 
 // Tests that extensions missing parent approval are granted parent approval
diff --git a/chrome/browser/supervised_user/supervised_user_extensions_metrics_recorder.cc b/chrome/browser/supervised_user/supervised_user_extensions_metrics_recorder.cc
index ad76d68..5083825 100644
--- a/chrome/browser/supervised_user/supervised_user_extensions_metrics_recorder.cc
+++ b/chrome/browser/supervised_user/supervised_user_extensions_metrics_recorder.cc
@@ -19,6 +19,12 @@
 const char
     SupervisedUserExtensionsMetricsRecorder::kApprovalRemovedActionName[] =
         "SupervisedUsers_Extensions_ApprovalRemoved";
+const char
+    SupervisedUserExtensionsMetricsRecorder::kApprovalGrantedByDefaultName[] =
+        "SupervisedUsers_Extensions_ApprovalGrantedByDefault";
+const char
+    SupervisedUserExtensionsMetricsRecorder::kLocalApprovalGrantedName[] =
+        "SupervisedUsers_Extensions_LocalApprovalGranted";
 // Extension Install Dialog.
 const char SupervisedUserExtensionsMetricsRecorder::
     kExtensionInstallDialogHistogramName[] =
@@ -92,6 +98,15 @@
       // Record UMA metrics for removing an extension.
       base::RecordAction(base::UserMetricsAction(kApprovalRemovedActionName));
       break;
+    case UmaExtensionState::kApprovalGrantedByDefault:
+      // Record UMA metrics for auto-granting parental approval.
+      base::RecordAction(
+          base::UserMetricsAction(kApprovalGrantedByDefaultName));
+      break;
+    case UmaExtensionState::kLocalApprovalGranted:
+      // Record UMA metrics for granting local parental approval.
+      base::RecordAction(base::UserMetricsAction(kLocalApprovalGrantedName));
+      break;
   }
 }
 
diff --git a/chrome/browser/supervised_user/supervised_user_extensions_metrics_recorder.h b/chrome/browser/supervised_user/supervised_user_extensions_metrics_recorder.h
index b2ab2a9..2c9bc65 100644
--- a/chrome/browser/supervised_user/supervised_user_extensions_metrics_recorder.h
+++ b/chrome/browser/supervised_user/supervised_user_extensions_metrics_recorder.h
@@ -14,8 +14,9 @@
   // These enum values represent the state that the child user has attained
   // while trying to install an extension.
   // These values are logged to UMA. Entries should not be renumbered and
-  // numeric values should never be reused. Please keep in sync with
-  // "SupervisedUserExtension2" in src/tools/metrics/histograms/enums.xml.
+  // numeric values should never be reused.
+  //
+  // LINT.IfChange(UmaExtensionState)
   enum class UmaExtensionState {
     // Recorded when custodian grants child approval to install an extension.
     kApprovalGranted = 0,
@@ -24,11 +25,19 @@
     kPermissionsIncreaseGranted = 1,
     // Recorded when the child removes an extension.
     kApprovalRemoved = 2,
-    // Add future entries above this comment, in sync with
-    // "SupervisedUserExtension2" in src/tools/metrics/histograms/enums.xml.
-    // Update kMaxValue to the last value.
-    kMaxValue = kApprovalRemoved
+    // Recorded when an extension receives automatic parent approval, when
+    // it is installed under the `SkipParentApprovalToInstallExtensions` mode
+    // with the corresponding preference enabled.
+    kApprovalGrantedByDefault = 3,
+    // Recorded when an extension receives local parent approval, when
+    // the `SkipParentApprovalToInstallExtensions` feature is first
+    // released on Desktop (Windows/Linux/Mac).
+    kLocalApprovalGranted = 4,
+    // Add future entries above this comment, updating kMaxValue to the last
+    // value.
+    kMaxValue = kLocalApprovalGranted
   };
+  // LINT.ThenChange(//tools/metrics/histograms/metadata/families/enums.xml:SupervisedUserExtension2)
 
   // These enum values represent the state of the Extension Install Dialog for
   // installing and enabling extensions for supervised users.
@@ -107,7 +116,8 @@
   static const char kApprovalGrantedActionName[];
   static const char kPermissionsIncreaseGrantedActionName[];
   static const char kApprovalRemovedActionName[];
-
+  static const char kApprovalGrantedByDefaultName[];
+  static const char kLocalApprovalGrantedName[];
   // UMA metrics for the Extension Install Dialog.
   static const char kExtensionInstallDialogHistogramName[];
   static const char kExtensionInstallDialogOpenedActionName[];
diff --git a/chrome/browser/sync/chrome_sync_client.cc b/chrome/browser/sync/chrome_sync_client.cc
index 00e95be..3f8aed9 100644
--- a/chrome/browser/sync/chrome_sync_client.cc
+++ b/chrome/browser/sync/chrome_sync_client.cc
@@ -88,6 +88,7 @@
 #include "components/sync/service/model_type_controller.h"
 #include "components/sync/service/sync_api_component_factory.h"
 #include "components/sync/service/syncable_service_based_model_type_controller.h"
+#include "components/sync/service/trusted_vault_synthetic_field_trial.h"
 #include "components/sync_bookmarks/bookmark_sync_service.h"
 #include "components/sync_preferences/pref_service_syncable.h"
 #include "components/sync_sessions/session_sync_service.h"
@@ -811,6 +812,13 @@
 #endif  // BUILDFLAG(IS_ANDROID)
 }
 
+void ChromeSyncClient::RegisterTrustedVaultAutoUpgradeSyntheticFieldTrial(
+    const syncer::TrustedVaultAutoUpgradeSyntheticFieldTrialGroup& group) {
+  CHECK(group.is_valid());
+
+  NOTIMPLEMENTED();
+}
+
 #if BUILDFLAG(ENABLE_EXTENSIONS)
 std::unique_ptr<syncer::ModelTypeController>
 ChromeSyncClient::CreateAppsModelTypeController() {
diff --git a/chrome/browser/sync/chrome_sync_client.h b/chrome/browser/sync/chrome_sync_client.h
index 2a6e4b1..d88526d 100644
--- a/chrome/browser/sync/chrome_sync_client.h
+++ b/chrome/browser/sync/chrome_sync_client.h
@@ -64,6 +64,9 @@
   bool IsPasswordSyncAllowed() override;
   void SetPasswordSyncAllowedChangeCb(
       const base::RepeatingClosure& cb) override;
+  void RegisterTrustedVaultAutoUpgradeSyntheticFieldTrial(
+      const syncer::TrustedVaultAutoUpgradeSyntheticFieldTrialGroup& group)
+      override;
 
  private:
   // Convenience function used during controller creation.
diff --git a/chrome/browser/sync/test/integration/single_client_wallet_credential_sync_test.cc b/chrome/browser/sync/test/integration/single_client_wallet_credential_sync_test.cc
index be40d74..55c2ed0 100644
--- a/chrome/browser/sync/test/integration/single_client_wallet_credential_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_wallet_credential_sync_test.cc
@@ -635,7 +635,7 @@
 
   autofill::PersonalDataManager* pdm = GetPersonalDataManager(0);
   ASSERT_NE(nullptr, pdm);
-  ASSERT_EQ(1uL, pdm->GetCreditCards().size());
+  ASSERT_EQ(1uL, pdm->payments_data_manager().GetCreditCards().size());
 
   // Add 2 wallet credential entities (CVC) on the fake server. One of them is
   // linked to the card created above and the other credential has no linkage to
@@ -646,7 +646,7 @@
                 /*last_updated_timestamp=*/base::Time::UnixEpoch() +
                     base::Milliseconds(50000)});
   WaitForCvcOnCard(pdm);
-  EXPECT_FALSE(pdm->GetCreditCards()[0]->cvc().empty());
+  EXPECT_FALSE(pdm->payments_data_manager().GetCreditCards()[0]->cvc().empty());
 
   // The count for CVCs on the fake server is still 2 as we reconcile the CVC
   // data on the wallet sync bridge.
@@ -664,5 +664,5 @@
   // Verify that Chrome sync server has deleted the orphaned CVC by verifying
   // the count and the CVC value on the card.
   EXPECT_TRUE(ServerCvcChecker(/*expected_count=*/1ul).Wait());
-  EXPECT_FALSE(pdm->GetCreditCards()[0]->cvc().empty());
+  EXPECT_FALSE(pdm->payments_data_manager().GetCreditCards()[0]->cvc().empty());
 }
diff --git a/chrome/browser/tab_resumption/java/src/org/chromium/chrome/browser/tab_resumption/UrlImageProvider.java b/chrome/browser/tab_resumption/java/src/org/chromium/chrome/browser/tab_resumption/UrlImageProvider.java
index 889710c..505555af3 100644
--- a/chrome/browser/tab_resumption/java/src/org/chromium/chrome/browser/tab_resumption/UrlImageProvider.java
+++ b/chrome/browser/tab_resumption/java/src/org/chromium/chrome/browser/tab_resumption/UrlImageProvider.java
@@ -67,10 +67,9 @@
                             ImageFetcherConfig.IN_MEMORY_WITH_DISK_CACHE,
                             profile.getProfileKey(),
                             GlobalDiscardableReferencePool.getReferencePool());
-            // TODO(hanxi@): Add a client id for tab resumption module.
             mImageServiceBridge =
                     new ImageServiceBridge(
-                            ClientId.BOOKMARKS,
+                            ClientId.NTP_TAB_RESUMPTION,
                             ImageFetcher.TAB_RESUMPTION_MODULE_NAME,
                             profile,
                             mImageFetcher);
diff --git a/chrome/browser/touch_to_fill/autofill/android/touch_to_fill_delegate_android_impl.cc b/chrome/browser/touch_to_fill/autofill/android/touch_to_fill_delegate_android_impl.cc
index b9fabb3..6d98f65 100644
--- a/chrome/browser/touch_to_fill/autofill/android/touch_to_fill_delegate_android_impl.cc
+++ b/chrome/browser/touch_to_fill/autofill/android/touch_to_fill_delegate_android_impl.cc
@@ -16,6 +16,7 @@
 #include "components/autofill/core/browser/form_types.h"
 #include "components/autofill/core/browser/logging/log_manager.h"
 #include "components/autofill/core/browser/payments/iban_access_manager.h"
+#include "components/autofill/core/browser/payments_data_manager.h"
 #include "components/autofill/core/browser/ui/fast_checkout_client.h"
 #include "components/autofill/core/browser/ui/suggestion_hiding_reason.h"
 #include "components/autofill/core/common/autofill_features.h"
@@ -39,6 +40,18 @@
          SanitizedFieldIsEmpty(form_field->value());
 }
 
+bool IsTriggeredOnIbanField(const FormStructure* form_field,
+                            const FormFieldData& field) {
+  if (!form_field) {
+    return false;
+  }
+
+  const autofill::AutofillField* autofill_field =
+      form_field->GetFieldById(field.global_id());
+  return autofill_field &&
+         autofill_field->Type().group() == FieldTypeGroup::kIban;
+}
+
 }  // namespace
 
 TouchToFillDelegateAndroidImpl::DryRunResult::DryRunResult(
@@ -189,10 +202,13 @@
     }
   }
 
-  // TODO(b/309163888): Revisit how to log IBAN related metrics.
-  if (dry_run.outcome != TriggerOutcome::kUnsupportedFieldType) {
-    base::UmaHistogramEnumeration(kUmaTouchToFillCreditCardTriggerOutcome,
-                                  dry_run.outcome);
+  if (!IsTriggeredOnIbanField(manager_->FindCachedFormById(form.global_id()),
+                              field)) {
+    // TODO(b/309163888): Revisit how to log IBAN related metrics.
+    if (dry_run.outcome != TriggerOutcome::kUnsupportedFieldType) {
+      base::UmaHistogramEnumeration(kUmaTouchToFillCreditCardTriggerOutcome,
+                                    dry_run.outcome);
+    }
   }
   LOG_AF(manager_->client().GetLogManager())
       << LoggingScope::kTouchToFill << LogMessage::kTouchToFill
@@ -279,7 +295,8 @@
 
   PersonalDataManager* pdm = manager_->client().GetPersonalDataManager();
   CHECK(pdm);
-  CreditCard* card = pdm->GetCreditCardByGUID(unique_id);
+  CreditCard* card =
+      pdm->payments_data_manager().GetCreditCardByGUID(unique_id);
   // TODO(crbug.com/40071928): Figure out why `card` is sometimes nullptr.
   if (!card) {
     return;
diff --git a/chrome/browser/touch_to_fill/autofill/android/touch_to_fill_delegate_android_impl_unittest.cc b/chrome/browser/touch_to_fill/autofill/android/touch_to_fill_delegate_android_impl_unittest.cc
index 35bcfb6..f6edabde 100644
--- a/chrome/browser/touch_to_fill/autofill/android/touch_to_fill_delegate_android_impl_unittest.cc
+++ b/chrome/browser/touch_to_fill/autofill/android/touch_to_fill_delegate_android_impl_unittest.cc
@@ -164,7 +164,9 @@
     form_ = test::CreateTestCreditCardFormData(/*is_https=*/true,
                                                /*use_month_type=*/false);
     form_.fields[0].set_is_focusable(true);
-    autofill_client_.GetPersonalDataManager()->AddCreditCard(card);
+    autofill_client_.GetPersonalDataManager()
+        ->payments_data_manager()
+        .AddCreditCard(card);
   }
 
   // Helper method to add an IBAN and create an IBAN form.
@@ -234,10 +236,6 @@
   }
 
   bool IsCreditCard() const { return GetParam(); }
-
-  std::string GetTriggerOutcomeHistogramName() {
-    return kUmaTouchToFillCreditCardTriggerOutcome;
-  }
 };
 
 INSTANTIATE_TEST_SUITE_P(All,
@@ -255,73 +253,6 @@
 }
 
 TEST_P(TouchToFillDelegateAndroidImplPaymentMethodUnitTest,
-       TryToShowTouchToFillPaymentMethodSucceeds) {
-  ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
-
-  EXPECT_CALL(*browser_autofill_manager_, DidShowSuggestions);
-  TryToShowTouchToFill(/*expected_success=*/true);
-  histogram_tester_.ExpectUniqueSample(
-      GetTriggerOutcomeHistogramName(),
-      TouchToFillPaymentMethodTriggerOutcome::kShown, 1);
-}
-
-TEST_P(TouchToFillDelegateAndroidImplPaymentMethodUnitTest,
-       TryToShowTouchToFillFailsForPaymentMethodIfWasShown) {
-  TryToShowTouchToFill(/*expected_success=*/true);
-  touch_to_fill_delegate_->HideTouchToFill();
-
-  TryToShowTouchToFill(/*expected_success=*/false);
-  histogram_tester_.ExpectBucketCount(
-      GetTriggerOutcomeHistogramName(),
-      TouchToFillPaymentMethodTriggerOutcome::kShownBefore, 1);
-}
-
-TEST_P(TouchToFillDelegateAndroidImplPaymentMethodUnitTest,
-       TryToShowTouchToFillFailsForPaymentMethodIfFieldIsNotFocusable) {
-  form_.fields[0].set_is_focusable(false);
-  ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
-
-  TryToShowTouchToFill(/*expected_success=*/false);
-  histogram_tester_.ExpectUniqueSample(
-      GetTriggerOutcomeHistogramName(),
-      TouchToFillPaymentMethodTriggerOutcome::kFieldNotEmptyOrNotFocusable, 1);
-}
-
-TEST_P(TouchToFillDelegateAndroidImplPaymentMethodUnitTest,
-       TryToShowTouchToFillFailsForPaymentMethodIfFieldHasValue) {
-  ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
-  form_.fields[0].set_value(u"Initial value");
-
-  TryToShowTouchToFill(/*expected_success=*/false);
-  histogram_tester_.ExpectUniqueSample(
-      GetTriggerOutcomeHistogramName(),
-      TouchToFillPaymentMethodTriggerOutcome::kFieldNotEmptyOrNotFocusable, 1);
-}
-
-TEST_P(TouchToFillDelegateAndroidImplPaymentMethodUnitTest,
-       TryToShowTouchToFillFailsForPaymentMethodIfNoPaymentMethodsOnFile) {
-  ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
-  autofill_client_.GetPersonalDataManager()->ClearAllLocalData();
-
-  TryToShowTouchToFill(/*expected_success=*/false);
-  histogram_tester_.ExpectUniqueSample(
-      GetTriggerOutcomeHistogramName(),
-      TouchToFillPaymentMethodTriggerOutcome::kNoValidPaymentMethods, 1);
-}
-
-TEST_P(TouchToFillDelegateAndroidImplPaymentMethodUnitTest,
-       TryToShowTouchToFillFailsIfCanNotShowUi) {
-  ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
-  EXPECT_CALL(*browser_autofill_manager_, CanShowAutofillUi)
-      .WillRepeatedly(Return(false));
-
-  TryToShowTouchToFill(/*expected_success=*/false);
-  histogram_tester_.ExpectUniqueSample(
-      GetTriggerOutcomeHistogramName(),
-      TouchToFillPaymentMethodTriggerOutcome::kCannotShowAutofillUi, 1);
-}
-
-TEST_P(TouchToFillDelegateAndroidImplPaymentMethodUnitTest,
        HideTouchToFillDoesNothingIfNotShown) {
   ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
 
@@ -398,6 +329,73 @@
 }
 
 TEST_F(TouchToFillDelegateAndroidImplCreditCardUnitTest,
+       TryToShowTouchToFillPaymentMethodSucceeds) {
+  ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
+
+  EXPECT_CALL(*browser_autofill_manager_, DidShowSuggestions);
+  TryToShowTouchToFill(/*expected_success=*/true);
+  histogram_tester_.ExpectUniqueSample(
+      kUmaTouchToFillCreditCardTriggerOutcome,
+      TouchToFillPaymentMethodTriggerOutcome::kShown, 1);
+}
+
+TEST_F(TouchToFillDelegateAndroidImplCreditCardUnitTest,
+       TryToShowTouchToFillFailsForPaymentMethodIfWasShown) {
+  TryToShowTouchToFill(/*expected_success=*/true);
+  touch_to_fill_delegate_->HideTouchToFill();
+
+  TryToShowTouchToFill(/*expected_success=*/false);
+  histogram_tester_.ExpectBucketCount(
+      kUmaTouchToFillCreditCardTriggerOutcome,
+      TouchToFillPaymentMethodTriggerOutcome::kShownBefore, 1);
+}
+
+TEST_F(TouchToFillDelegateAndroidImplCreditCardUnitTest,
+       TryToShowTouchToFillFailsForPaymentMethodIfFieldIsNotFocusable) {
+  form_.fields[0].set_is_focusable(false);
+  ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
+
+  TryToShowTouchToFill(/*expected_success=*/false);
+  histogram_tester_.ExpectUniqueSample(
+      kUmaTouchToFillCreditCardTriggerOutcome,
+      TouchToFillPaymentMethodTriggerOutcome::kFieldNotEmptyOrNotFocusable, 1);
+}
+
+TEST_F(TouchToFillDelegateAndroidImplCreditCardUnitTest,
+       TryToShowTouchToFillFailsForPaymentMethodIfFieldHasValue) {
+  ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
+  form_.fields[0].set_value(u"Initial value");
+
+  TryToShowTouchToFill(/*expected_success=*/false);
+  histogram_tester_.ExpectUniqueSample(
+      kUmaTouchToFillCreditCardTriggerOutcome,
+      TouchToFillPaymentMethodTriggerOutcome::kFieldNotEmptyOrNotFocusable, 1);
+}
+
+TEST_F(TouchToFillDelegateAndroidImplCreditCardUnitTest,
+       TryToShowTouchToFillFailsForPaymentMethodIfNoPaymentMethodsOnFile) {
+  ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
+  autofill_client_.GetPersonalDataManager()->ClearAllLocalData();
+
+  TryToShowTouchToFill(/*expected_success=*/false);
+  histogram_tester_.ExpectUniqueSample(
+      kUmaTouchToFillCreditCardTriggerOutcome,
+      TouchToFillPaymentMethodTriggerOutcome::kNoValidPaymentMethods, 1);
+}
+
+TEST_F(TouchToFillDelegateAndroidImplCreditCardUnitTest,
+       TryToShowTouchToFillFailsIfCanNotShowUi) {
+  ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
+  EXPECT_CALL(*browser_autofill_manager_, CanShowAutofillUi)
+      .WillRepeatedly(Return(false));
+
+  TryToShowTouchToFill(/*expected_success=*/false);
+  histogram_tester_.ExpectUniqueSample(
+      kUmaTouchToFillCreditCardTriggerOutcome,
+      TouchToFillPaymentMethodTriggerOutcome::kCannotShowAutofillUi, 1);
+}
+
+TEST_F(TouchToFillDelegateAndroidImplCreditCardUnitTest,
        TryToShowTouchToFillFailsForIncompleteForm) {
   // Erase expiration month and expiration year fields.
   ASSERT_EQ(form_.fields[2].name(), u"ccmonth");
@@ -519,20 +517,26 @@
       .ClearCreditCards();
   CreditCard cc_no_number = test::GetCreditCard();
   cc_no_number.SetNumber(u"");
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(cc_no_number);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(cc_no_number);
 
   TryToShowTouchToFill(/*expected_success=*/false);
 
   CreditCard cc_no_exp_date = test::GetCreditCard();
   cc_no_exp_date.SetExpirationMonth(0);
   cc_no_exp_date.SetExpirationYear(0);
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(cc_no_exp_date);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(cc_no_exp_date);
 
   TryToShowTouchToFill(/*expected_success=*/false);
 
   CreditCard cc_no_name = test::GetCreditCard();
   cc_no_name.SetRawInfo(CREDIT_CARD_NAME_FULL, u"");
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(cc_no_name);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(cc_no_name);
 
   TryToShowTouchToFill(/*expected_success=*/false);
   histogram_tester_.ExpectUniqueSample(
@@ -546,8 +550,9 @@
   autofill_client_.GetPersonalDataManager()
       ->test_payments_data_manager()
       .ClearCreditCards();
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(
-      test::GetExpiredCreditCard());
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(test::GetExpiredCreditCard());
 
   TryToShowTouchToFill(/*expected_success=*/false);
   histogram_tester_.ExpectUniqueSample(
@@ -563,7 +568,9 @@
       .ClearCreditCards();
   CreditCard cc_invalid_number = test::GetCreditCard();
   cc_invalid_number.SetNumber(u"invalid number");
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(cc_invalid_number);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(cc_invalid_number);
 
   TryToShowTouchToFill(/*expected_success=*/false);
   histogram_tester_.ExpectUniqueSample(
@@ -571,8 +578,9 @@
       TouchToFillPaymentMethodTriggerOutcome::kNoValidPaymentMethods, 1);
 
   // But succeeds for existing masked server card with incomplete number.
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(
-      test::GetMaskedServerCard());
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(test::GetMaskedServerCard());
 
   TryToShowTouchToFill(/*expected_success=*/true);
   histogram_tester_.ExpectBucketCount(
@@ -610,8 +618,12 @@
       .ClearCreditCards();
   CreditCard credit_card = autofill::test::GetCreditCard();
   CreditCard expired_card = test::GetExpiredCreditCard();
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(credit_card);
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(expired_card);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(credit_card);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(expired_card);
   ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
   EXPECT_CALL(autofill_client_, ShowTouchToFillCreditCard)
       .WillOnce(Return(true));
@@ -626,10 +638,16 @@
       .ClearCreditCards();
   CreditCard credit_card = autofill::test::GetCreditCard();
   CreditCard expired_card = test::GetExpiredCreditCard();
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(credit_card);
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(expired_card);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(credit_card);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(expired_card);
   std::vector<CreditCard*> credit_cards =
-      autofill_client_.GetPersonalDataManager()->GetCreditCardsToSuggest();
+      autofill_client_.GetPersonalDataManager()
+          ->payments_data_manager()
+          .GetCreditCardsToSuggest();
 
   ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
   EXPECT_CALL(autofill_client_,
@@ -649,9 +667,12 @@
   credit_card.set_use_date(AutofillClock::Now());
   disused_expired_card.set_use_date(AutofillClock::Now() -
                                     kDisusedDataModelTimeDelta * 2);
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(credit_card);
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(
-      disused_expired_card);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(credit_card);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(disused_expired_card);
   ASSERT_TRUE(credit_card.IsCompleteValidCard());
   ASSERT_FALSE(disused_expired_card.IsCompleteValidCard());
   ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
@@ -668,7 +689,9 @@
       .ClearCreditCards();
   CreditCard credit_card =
       autofill::test::GetMaskedServerCardEnrolledIntoVirtualCardNumber();
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(credit_card);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(credit_card);
   ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
   ON_CALL(*static_cast<MockAutofillOptimizationGuide*>(
               autofill_client_.GetAutofillOptimizationGuide()),
@@ -696,7 +719,9 @@
       .ClearCreditCards();
   CreditCard credit_card =
       test::GetMaskedServerCardEnrolledIntoVirtualCardNumber();
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(credit_card);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(credit_card);
   ASSERT_FALSE(touch_to_fill_delegate_->IsShowingTouchToFill());
   ON_CALL(*static_cast<MockAutofillOptimizationGuide*>(
               autofill_client_.GetAutofillOptimizationGuide()),
@@ -722,10 +747,16 @@
       .ClearCreditCards();
   CreditCard credit_card1 = autofill::test::GetCreditCard();
   CreditCard credit_card2 = autofill::test::GetCreditCard2();
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(credit_card1);
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(credit_card2);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(credit_card1);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(credit_card2);
   std::vector<CreditCard*> credit_cards =
-      autofill_client_.GetPersonalDataManager()->GetCreditCardsToSuggest();
+      autofill_client_.GetPersonalDataManager()
+          ->payments_data_manager()
+          .GetCreditCardsToSuggest();
 
   EXPECT_CALL(autofill_client_,
               ShowTouchToFillCreditCard(
@@ -765,7 +796,9 @@
       ->test_payments_data_manager()
       .ClearCreditCards();
   CreditCard credit_card = autofill::test::GetCreditCard();
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(credit_card);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(credit_card);
 
   TryToShowTouchToFill(/*expected_success=*/true);
 
@@ -780,7 +813,9 @@
       ->test_payments_data_manager()
       .ClearCreditCards();
   CreditCard credit_card = autofill::test::GetCreditCard();
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(credit_card);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(credit_card);
 
   TryToShowTouchToFill(/*expected_success=*/true);
 
@@ -796,7 +831,9 @@
       .ClearCreditCards();
   CreditCard credit_card =
       autofill::test::GetMaskedServerCardEnrolledIntoVirtualCardNumber();
-  autofill_client_.GetPersonalDataManager()->AddCreditCard(credit_card);
+  autofill_client_.GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(credit_card);
 
   TryToShowTouchToFill(/*expected_success=*/true);
 
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
index c8ce8e9..18ec3a62 100644
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -179,6 +179,12 @@
     "profiles/profile_error_dialog.h",
     "recently_audible_helper.cc",
     "recently_audible_helper.h",
+    "safety_hub/safety_hub_service.cc",
+    "safety_hub/safety_hub_service.h",
+    "safety_hub/unused_site_permissions_service.cc",
+    "safety_hub/unused_site_permissions_service.h",
+    "safety_hub/unused_site_permissions_service_factory.cc",
+    "safety_hub/unused_site_permissions_service_factory.h",
     "screen_capture_notification_ui.h",
     "search_engines/edit_search_engine_controller.cc",
     "search_engines/edit_search_engine_controller.h",
@@ -1437,12 +1443,6 @@
       "safety_hub/safety_hub_constants.h",
       "safety_hub/safety_hub_prefs.cc",
       "safety_hub/safety_hub_prefs.h",
-      "safety_hub/safety_hub_service.cc",
-      "safety_hub/safety_hub_service.h",
-      "safety_hub/unused_site_permissions_service.cc",
-      "safety_hub/unused_site_permissions_service.h",
-      "safety_hub/unused_site_permissions_service_factory.cc",
-      "safety_hub/unused_site_permissions_service_factory.h",
       "scoped_tabbed_browser_displayer.cc",
       "scoped_tabbed_browser_displayer.h",
       "search/instant_controller.cc",
diff --git a/chrome/browser/ui/ash/picker/picker_interactive_uitest.cc b/chrome/browser/ui/ash/picker/picker_interactive_uitest.cc
index 9be6301..0a4b81c8 100644
--- a/chrome/browser/ui/ash/picker/picker_interactive_uitest.cc
+++ b/chrome/browser/ui/ash/picker/picker_interactive_uitest.cc
@@ -402,8 +402,17 @@
       }));
 }
 
+// TODO(b/328144222): Re-enable this test. Causes build failures with MSAN
+// enabled on CrOS.
+#if BUILDFLAG(IS_CHROMEOS) && defined(MEMORY_SANITIZER)
+#define MAYBE_AnnouncesKeyboardNavigationOnResultsPage \
+  DISABLED_AnnouncesKeyboardNavigationOnResultsPage
+#else
+#define MAYBE_AnnouncesKeyboardNavigationOnResultsPage \
+  AnnouncesKeyboardNavigationOnResultsPage
+#endif
 IN_PROC_BROWSER_TEST_F(PickerSpokenFeedbackInteractiveUiTest,
-                       AnnouncesKeyboardNavigationOnResultsPage) {
+                       MAYBE_AnnouncesKeyboardNavigationOnResultsPage) {
   ASSERT_TRUE(CreateBrowserWindow(
       GURL("data:text/html,<input type=\"text\" autofocus/>")));
   const ui::ElementContext browser_context =
diff --git a/chrome/browser/ui/autofill/autofill_keyboard_accessory_controller_impl.cc b/chrome/browser/ui/autofill/autofill_keyboard_accessory_controller_impl.cc
index e2334df..40955a3 100644
--- a/chrome/browser/ui/autofill/autofill_keyboard_accessory_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_keyboard_accessory_controller_impl.cc
@@ -25,6 +25,7 @@
 #include "chrome/browser/ui/autofill/autofill_suggestion_controller_utils.h"
 #include "components/autofill/core/browser/address_data_manager.h"
 #include "components/autofill/core/browser/metrics/granular_filling_metrics.h"
+#include "components/autofill/core/browser/payments_data_manager.h"
 #include "components/autofill/core/browser/personal_data_manager.h"
 #include "components/autofill/core/browser/ui/autofill_popup_delegate.h"
 #include "components/autofill/core/browser/ui/suggestion_hiding_reason.h"
@@ -46,6 +47,11 @@
 constexpr std::u16string_view kLabelSeparator = u" ";
 constexpr size_t kMaxBulletCount = 8;
 
+// Creates a text label used by the keyboard accessory. For password
+// suggestions, constructs the label from the password stored in
+// `Suggestion::additional_label` and an optional signon realm stored in
+// `Suggestion::labels`. For other suggestions, constructs the label from
+// `Suggestion::labels`.
 Suggestion::Text CreateLabel(const Suggestion& suggestion) {
   std::u16string password =
       suggestion.additional_label.substr(0, kMaxBulletCount);
@@ -540,8 +546,9 @@
   PersonalDataManager* pdm = PersonalDataManagerFactory::GetForBrowserContext(
       web_contents_->GetBrowserContext());
 
-  if (const CreditCard* credit_card = pdm->GetCreditCardByGUID(
-          absl::get<Suggestion::Guid>(backend_id).value())) {
+  if (const CreditCard* credit_card =
+          pdm->payments_data_manager().GetCreditCardByGUID(
+              absl::get<Suggestion::Guid>(backend_id).value())) {
     if (!CreditCard::IsLocalCard(credit_card)) {
       return false;
     }
@@ -589,14 +596,7 @@
   labels_.clear();
   labels_.reserve(suggestions_.size());
   for (const Suggestion& suggestion : suggestions_) {
-    if (suggestion.type != SuggestionType::kClearForm) {
-      labels_.push_back(CreateLabel(suggestion));
-    } else if (suggestion.labels.empty()) {
-      labels_.emplace_back();
-    } else {
-      CHECK(!suggestion.labels[0].empty());
-      labels_.push_back(suggestion.labels[0][0]);
-    }
+    labels_.push_back(CreateLabel(suggestion));
   }
 }
 
diff --git a/chrome/browser/ui/autofill/autofill_keyboard_accessory_controller_impl_unittest.cc b/chrome/browser/ui/autofill/autofill_keyboard_accessory_controller_impl_unittest.cc
index a9b3da2..d411fb0 100644
--- a/chrome/browser/ui/autofill/autofill_keyboard_accessory_controller_impl_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_keyboard_accessory_controller_impl_unittest.cc
@@ -11,6 +11,7 @@
 #include "base/time/time.h"
 #include "chrome/browser/ui/autofill/autofill_suggestion_controller_test_base.h"
 #include "chrome/browser/ui/autofill/test_autofill_keyboard_accessory_controller_autofill_client.h"
+#include "components/autofill/core/browser/address_data_manager.h"
 #include "components/autofill/core/browser/ui/suggestion_hiding_reason.h"
 #include "components/password_manager/core/common/password_manager_features.h"
 #include "components/strings/grit/components_strings.h"
@@ -53,7 +54,7 @@
  protected:
   AutofillProfile ShowAutofillProfileSuggestion() {
     AutofillProfile complete_profile = test::GetFullProfile();
-    personal_data().AddProfile(complete_profile);
+    personal_data().address_data_manager().AddProfile(complete_profile);
     ShowSuggestions(manager(), {test::CreateAutofillSuggestion(
                                    SuggestionType::kAddressEntry,
                                    u"Complete autofill profile",
@@ -63,7 +64,7 @@
 
   CreditCard ShowLocalCardSuggestion() {
     CreditCard local_card = test::GetCreditCard();
-    personal_data().AddCreditCard(local_card);
+    personal_data().payments_data_manager().AddCreditCard(local_card);
     ShowSuggestions(manager(),
                     {test::CreateAutofillSuggestion(
                         SuggestionType::kCreditCardEntry, u"Local credit card",
@@ -182,7 +183,7 @@
        GetRemovalConfirmationText_AutofillProfile_EmptyCity) {
   AutofillProfile profile = test::GetFullProfile();
   profile.ClearFields({ADDRESS_HOME_CITY});
-  personal_data().AddProfile(profile);
+  personal_data().address_data_manager().AddProfile(profile);
 
   std::u16string title;
   std::u16string body;
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller.h b/chrome/browser/ui/autofill/autofill_popup_controller.h
index 4795d2c..1583d9c 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller.h
+++ b/chrome/browser/ui/autofill/autofill_popup_controller.h
@@ -8,6 +8,10 @@
 #include "base/memory/weak_ptr.h"
 #include "chrome/browser/ui/autofill/autofill_suggestion_controller.h"
 
+namespace content {
+struct NativeWebKeyboardEvent;
+}  // namespace content
+
 namespace autofill {
 
 // The interface implemented by Desktop implementations of the
@@ -76,6 +80,14 @@
   // e.g. `RemoveSuggestion()`) become invalid.
   virtual void SetFilter(std::optional<SuggestionFilter> filter) = 0;
 
+  // Handles a key press event and returns whether the event should be swallowed
+  // (meaning that no other handler, in particular not the default handler, can
+  // process it).
+  // TODO(b/325246516): Change the event type to `ui::KeyEvent` as events can
+  // come not only from blink, but from native UI too.
+  virtual bool HandleKeyPressEvent(
+      const content::NativeWebKeyboardEvent& event) = 0;
+
   virtual base::WeakPtr<AutofillPopupController> GetWeakPtr() = 0;
 
   virtual void SetViewForTesting(base::WeakPtr<AutofillPopupView> view) = 0;
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
index 3994f995..2092e03f 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
@@ -65,9 +65,14 @@
     const AutofillPopupController::SuggestionFilter& filter) {
   SuggestionFiltrationResult result;
 
-  for (const Suggestion& suggestion : suggestions) {
-    if (size_t pos = suggestion.main_text.value.find(*filter);
-        pos != std::u16string::npos) {
+  for (size_t i = 0; i < suggestions.size(); ++i) {
+    const Suggestion& suggestion = suggestions[i];
+    // Footer suggestions cannot be filtered out.
+    if (IsFooterItem(suggestions, i)) {
+      result.first.push_back(suggestion);
+      result.second.emplace_back();
+    } else if (size_t pos = suggestion.main_text.value.find(*filter);
+               pos != std::u16string::npos) {
       result.first.push_back(suggestion);
       result.second.push_back(AutofillPopupController::SuggestionFilterMatch{
           .main_text_match = {pos, pos + filter->size()}});
@@ -304,16 +309,6 @@
   Hide(SuggestionHidingReason::kViewDestroyed);
 }
 
-bool AutofillPopupControllerImpl::HandleKeyPressEvent(
-    const content::NativeWebKeyboardEvent& event) {
-  if (sub_popup_controller_ &&
-      sub_popup_controller_->HandleKeyPressEvent(event)) {
-    return true;
-  }
-
-  return view_ && view_->HandleKeyPressEvent(event);
-}
-
 void AutofillPopupControllerImpl::OnSuggestionsChanged() {
   if (view_) {
     view_->OnSuggestionsChanged();
@@ -762,6 +757,16 @@
   UpdateFilteredSuggestions(/*notify_suggestions_changed=*/true);
 }
 
+bool AutofillPopupControllerImpl::HandleKeyPressEvent(
+    const content::NativeWebKeyboardEvent& event) {
+  if (sub_popup_controller_ &&
+      sub_popup_controller_->HandleKeyPressEvent(event)) {
+    return true;
+  }
+
+  return view_ && view_->HandleKeyPressEvent(event);
+}
+
 void AutofillPopupControllerImpl::SetViewForTesting(
     base::WeakPtr<AutofillPopupView> view) {
   view_ = std::move(view);
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.h b/chrome/browser/ui/autofill/autofill_popup_controller_impl.h
index 2bcf870a..ab5487c 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.h
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.h
@@ -24,7 +24,6 @@
 #include "third_party/abseil-cpp/absl/types/variant.h"
 
 namespace content {
-struct NativeWebKeyboardEvent;
 class WebContents;
 }  // namespace content
 
@@ -72,11 +71,6 @@
   AutofillPopupControllerImpl& operator=(const AutofillPopupControllerImpl&) =
       delete;
 
-  // Handles a key press event and returns whether the event should be swallowed
-  // (meaning that no other handler, in not particular the default handler, can
-  // process it).
-  bool HandleKeyPressEvent(const content::NativeWebKeyboardEvent& event);
-
   // AutofillSuggestionController:
   void OnSuggestionsChanged() override;
   void AcceptSuggestion(int index) override;
@@ -112,6 +106,8 @@
   const std::vector<SuggestionFilterMatch>& GetSuggestionFilterMatches()
       const override;
   void SetFilter(std::optional<SuggestionFilter> filter) override;
+  bool HandleKeyPressEvent(
+      const content::NativeWebKeyboardEvent& event) override;
   base::WeakPtr<AutofillPopupController> GetWeakPtr() override;
   void SetViewForTesting(base::WeakPtr<AutofillPopupView> view) override;
 
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl_unittest.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl_unittest.cc
index 7647313..e50d0ac 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_impl_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl_unittest.cc
@@ -11,6 +11,7 @@
 #include "chrome/browser/ui/autofill/autofill_suggestion_controller_test_base.h"
 #include "chrome/browser/ui/autofill/test_autofill_popup_controller_autofill_client.h"
 #include "components/autofill/core/browser/ui/suggestion.h"
+#include "components/autofill/core/browser/ui/suggestion_type.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "ui/accessibility/ax_active_popup.h"
@@ -32,6 +33,7 @@
 
 using ::testing::_;
 using ::testing::AllOf;
+using ::testing::ElementsAre;
 using ::testing::Eq;
 using ::testing::Field;
 using ::testing::Matcher;
@@ -342,6 +344,40 @@
   EXPECT_EQ(controller.GetSuggestionFilterMatches().size(), 0u);
 }
 
+TEST_F(AutofillPopupControllerImplTest,
+       SuggestionFiltration_FooterSuggestionsAreNotFiltratable) {
+  using enum SuggestionType;
+
+  AutofillPopupController& controller = client().popup_controller(manager());
+  ShowSuggestions(manager(), {
+                                 Suggestion(u"abc", kAddressEntry),
+                                 Suggestion(u"abx", kAddressEntry),
+                                 Suggestion(kSeparator),
+                                 Suggestion(kClearForm),
+                             });
+
+  controller.SetFilter(AutofillPopupController::SuggestionFilter(u"ab"));
+  EXPECT_EQ(controller.GetSuggestions().size(), 4u);
+  EXPECT_THAT(controller.GetSuggestions(),
+              ElementsAre(Field(&Suggestion::type, kAddressEntry),
+                          Field(&Suggestion::type, kAddressEntry),
+                          Field(&Suggestion::type, kSeparator),
+                          Field(&Suggestion::type, kClearForm)));
+
+  controller.SetFilter(AutofillPopupController::SuggestionFilter(u"abc"));
+  EXPECT_EQ(controller.GetSuggestions().size(), 3u);
+  EXPECT_THAT(controller.GetSuggestions(),
+              ElementsAre(Field(&Suggestion::type, kAddressEntry),
+                          Field(&Suggestion::type, kSeparator),
+                          Field(&Suggestion::type, kClearForm)));
+
+  controller.SetFilter(AutofillPopupController::SuggestionFilter(u"abcdef"));
+  EXPECT_EQ(controller.GetSuggestions().size(), 2u);
+  EXPECT_THAT(controller.GetSuggestions(),
+              ElementsAre(Field(&Suggestion::type, kSeparator),
+                          Field(&Suggestion::type, kClearForm)));
+}
+
 TEST_F(AutofillPopupControllerImplTest, RemoveSuggestion) {
   ShowSuggestions(manager(),
                   {SuggestionType::kAddressEntry, SuggestionType::kAddressEntry,
diff --git a/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.cc b/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.cc
index c71e5a9..fbf2cad 100644
--- a/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.cc
+++ b/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.cc
@@ -31,6 +31,74 @@
   return !kUnacceptableItemIds.contains(id);
 }
 
+bool IsFooterSuggestionType(SuggestionType type) {
+  switch (type) {
+    case SuggestionType::kAllSavedPasswordsEntry:
+    case SuggestionType::kAutofillOptions:
+    case SuggestionType::kClearForm:
+    case SuggestionType::kDeleteAddressProfile:
+    case SuggestionType::kEditAddressProfile:
+    case SuggestionType::kFillEverythingFromAddressProfile:
+    case SuggestionType::kPasswordAccountStorageEmpty:
+    case SuggestionType::kPasswordAccountStorageOptIn:
+    case SuggestionType::kPasswordAccountStorageOptInAndGenerate:
+    case SuggestionType::kPasswordAccountStorageReSignin:
+    case SuggestionType::kScanCreditCard:
+    case SuggestionType::kSeePromoCodeDetails:
+    case SuggestionType::kShowAccountCards:
+    case SuggestionType::kViewPasswordDetails:
+      return true;
+    case SuggestionType::kAccountStoragePasswordEntry:
+    case SuggestionType::kAddressEntry:
+    case SuggestionType::kAddressFieldByFieldFilling:
+    case SuggestionType::kAutocompleteEntry:
+    case SuggestionType::kCompose:
+    case SuggestionType::kComposeDisable:
+    case SuggestionType::kComposeGoToSettings:
+    case SuggestionType::kComposeNeverShowOnThisSiteAgain:
+    case SuggestionType::kComposeSavedStateNotification:
+    case SuggestionType::kCreateNewPlusAddress:
+    case SuggestionType::kCreditCardEntry:
+    case SuggestionType::kCreditCardFieldByFieldFilling:
+    case SuggestionType::kDatalistEntry:
+    case SuggestionType::kDevtoolsTestAddressEntry:
+    case SuggestionType::kDevtoolsTestAddresses:
+    case SuggestionType::kFillExistingPlusAddress:
+    case SuggestionType::kFillFullAddress:
+    case SuggestionType::kFillFullEmail:
+    case SuggestionType::kFillFullName:
+    case SuggestionType::kFillFullPhoneNumber:
+    case SuggestionType::kFillPassword:
+    case SuggestionType::kGeneratePasswordEntry:
+    case SuggestionType::kIbanEntry:
+    case SuggestionType::kInsecureContextPaymentDisabledMessage:
+    case SuggestionType::kMerchantPromoCodeEntry:
+    case SuggestionType::kMixedFormMessage:
+    case SuggestionType::kPasswordEntry:
+    case SuggestionType::kPasswordFieldByFieldFilling:
+    case SuggestionType::kSeparator:
+    case SuggestionType::kTitle:
+    case SuggestionType::kVirtualCreditCardEntry:
+    case SuggestionType::kWebauthnCredential:
+    case SuggestionType::kWebauthnSignInWithAnotherDevice:
+      return false;
+  }
+}
+
+bool IsFooterItem(const std::vector<Suggestion>& suggestions,
+                  size_t line_number) {
+  if (line_number >= suggestions.size()) {
+    return false;
+  }
+
+  // Separators are a special case: They belong into the footer iff the next
+  // item exists and is a footer item.
+  SuggestionType type = suggestions[line_number].type;
+  return type == SuggestionType::kSeparator
+             ? IsFooterItem(suggestions, line_number + 1)
+             : IsFooterSuggestionType(type);
+}
+
 content::RenderFrameHost* GetRenderFrameHost(AutofillPopupDelegate& delegate) {
   return absl::visit(
       base::Overloaded{
diff --git a/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.h b/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.h
index 9d1d6bf..abe33b9 100644
--- a/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.h
+++ b/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.h
@@ -26,6 +26,16 @@
 // that even if this is true, the suggestion itself may still not be acceptable.
 bool IsAcceptableSuggestionType(SuggestionType id);
 
+// Returns whether the suggestion with this `type` belongs into
+// the footer section of the popup. Returns `false` for separators, which may
+// belong either to the main or the footer section.
+bool IsFooterSuggestionType(SuggestionType type);
+
+// Returns `true` if the item at `line_number` belongs into the footer section
+// of the popup. For separators, the result is that of the next item.
+bool IsFooterItem(const std::vector<Suggestion>& suggestions,
+                  size_t line_number);
+
 // Returns the RenderFrameHost` corresponding to an `AutofillPopupDelegate`.
 content::RenderFrameHost* GetRenderFrameHost(AutofillPopupDelegate& delegate);
 
diff --git a/chrome/browser/ui/autofill/mock_autofill_popup_controller.h b/chrome/browser/ui/autofill/mock_autofill_popup_controller.h
index aaf5ebe..093b91c 100644
--- a/chrome/browser/ui/autofill/mock_autofill_popup_controller.h
+++ b/chrome/browser/ui/autofill/mock_autofill_popup_controller.h
@@ -110,6 +110,10 @@
               (override));
   MOCK_METHOD(void, PinView, (), (override));
   MOCK_METHOD(void, SetFilter, (std::optional<SuggestionFilter>), (override));
+  MOCK_METHOD(bool,
+              HandleKeyPressEvent,
+              (const content::NativeWebKeyboardEvent& event),
+              (override));
 
   void set_suggestions(const std::vector<SuggestionType>& ids) {
     suggestions_.clear();
diff --git a/chrome/browser/ui/autofill/payments/offer_notification_controller_android_browsertest.cc b/chrome/browser/ui/autofill/payments/offer_notification_controller_android_browsertest.cc
index 70be1e4..17efa01 100644
--- a/chrome/browser/ui/autofill/payments/offer_notification_controller_android_browsertest.cc
+++ b/chrome/browser/ui/autofill/payments/offer_notification_controller_android_browsertest.cc
@@ -19,6 +19,7 @@
 #include "components/autofill/core/browser/data_model/autofill_offer_data.h"
 #include "components/autofill/core/browser/metrics/payments/offers_metrics.h"
 #include "components/autofill/core/browser/payments/autofill_offer_manager.h"
+#include "components/autofill/core/browser/payments_data_manager.h"
 #include "components/autofill/core/browser/payments_data_manager_test_api.h"
 #include "components/autofill/core/browser/personal_data_manager.h"
 #include "components/autofill/core/common/autofill_clock.h"
@@ -88,7 +89,7 @@
   Profile* GetProfile() { return chrome_test_utils::GetProfile(this); }
 
   AutofillOfferData* SetUpOfferDataWithDomains(const GURL& url) {
-    personal_data_->ClearAllServerDataForTesting();
+    personal_data_->payments_data_manager().ClearAllServerDataForTesting();
     std::vector<GURL> merchant_origins;
     merchant_origins.emplace_back(url.DeprecatedGetOriginAsURL());
     std::vector<int64_t> eligible_instrument_ids = {0x4444};
@@ -100,7 +101,8 @@
         .AddOfferData(std::move(offer));
     auto card = std::make_unique<CreditCard>();
     card->set_instrument_id(0x4444);
-    personal_data_->AddServerCreditCardForTest(std::move(card));
+    personal_data_->payments_data_manager().AddServerCreditCardForTest(
+        std::move(card));
     personal_data_->NotifyPersonalDataObserver();
     return offer_ptr;
   }
diff --git a/chrome/browser/ui/safety_hub/unused_site_permissions_service.cc b/chrome/browser/ui/safety_hub/unused_site_permissions_service.cc
index e74a796..4fffb7d 100644
--- a/chrome/browser/ui/safety_hub/unused_site_permissions_service.cc
+++ b/chrome/browser/ui/safety_hub/unused_site_permissions_service.cc
@@ -23,6 +23,7 @@
 #include "base/time/default_clock.h"
 #include "base/time/time.h"
 #include "base/values.h"
+#include "build/build_config.h"
 #include "chrome/app/chrome_command_ids.h"
 #include "chrome/browser/ui/safety_hub/safety_hub_service.h"
 #include "chrome/common/chrome_features.h"
@@ -236,12 +237,17 @@
 
 std::u16string UnusedSitePermissionsService::UnusedSitePermissionsResult::
     GetNotificationString() const {
+#if !BUILDFLAG(IS_ANDROID)
   if (revoked_permissions_.empty()) {
     return std::u16string();
   }
   return l10n_util::GetPluralStringFUTF16(
       IDS_SETTINGS_SAFETY_HUB_UNUSED_SITE_PERMISSIONS_MENU_NOTIFICATION,
       revoked_permissions_.size());
+#else
+  // Menu notifications are not present on Android.
+  return std::u16string();
+#endif
 }
 
 int UnusedSitePermissionsService::UnusedSitePermissionsResult::
diff --git a/chrome/browser/ui/views/autofill/payments/offer_notification_bubble_views_interactive_uitest.cc b/chrome/browser/ui/views/autofill/payments/offer_notification_bubble_views_interactive_uitest.cc
index 8686f2bc..0bb6534 100644
--- a/chrome/browser/ui/views/autofill/payments/offer_notification_bubble_views_interactive_uitest.cc
+++ b/chrome/browser/ui/views/autofill/payments/offer_notification_bubble_views_interactive_uitest.cc
@@ -708,7 +708,7 @@
   CloseBubbleWithReason(views::Widget::ClosedReason::kCloseButtonClicked);
 
   // Simulate the user clearing server data.
-  personal_data()->ClearAllServerDataForTesting();
+  personal_data()->payments_data_manager().ClearAllServerDataForTesting();
 
   // Simulate the user re-showing the bubble by clicking on the icon.
   SimulateClickOnIconAndReshowBubble();
diff --git a/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.cc b/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.cc
index c7e6a20..0a0d005 100644
--- a/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.cc
+++ b/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.cc
@@ -10,6 +10,7 @@
 
 #include "base/containers/fixed_flat_set.h"
 #include "chrome/browser/ui/autofill/autofill_popup_controller.h"
+#include "chrome/browser/ui/autofill/autofill_suggestion_controller_utils.h"
 #include "chrome/browser/ui/views/autofill/popup/popup_base_view.h"
 #include "chrome/browser/ui/views/autofill/popup/popup_cell_utils.h"
 #include "chrome/browser/ui/views/autofill/popup/popup_row_content_view.h"
diff --git a/chrome/browser/ui/views/autofill/popup/popup_search_bar_view.cc b/chrome/browser/ui/views/autofill/popup/popup_search_bar_view.cc
index d644fe9..52c28d0 100644
--- a/chrome/browser/ui/views/autofill/popup/popup_search_bar_view.cc
+++ b/chrome/browser/ui/views/autofill/popup/popup_search_bar_view.cc
@@ -13,6 +13,7 @@
 #include "components/vector_icons/vector_icons.h"
 #include "ui/base/interaction/element_identifier.h"
 #include "ui/base/metadata/metadata_impl_macros.h"
+#include "ui/events/types/event_type.h"
 #include "ui/views/controls/button/image_button.h"
 #include "ui/views/controls/image_view.h"
 #include "ui/views/controls/textfield/textfield.h"
@@ -23,9 +24,11 @@
 PopupSearchBarView::PopupSearchBarView(
     const std::u16string& placeholder,
     OnInputChangedCallback on_input_changed_callback,
-    base::RepeatingClosure on_focus_lost_callback)
+    base::RepeatingClosure on_focus_lost_callback,
+    Delegate& delegate)
     : on_input_changed_callback_(std::move(on_input_changed_callback)),
-      on_focus_lost_callback_(std::move(on_focus_lost_callback)) {
+      on_focus_lost_callback_(std::move(on_focus_lost_callback)),
+      delegate_(delegate) {
   ChromeLayoutProvider* layout_provider = ChromeLayoutProvider::Get();
 
   SetLayoutManager(std::make_unique<views::FlexLayout>())
@@ -48,6 +51,7 @@
           // TODO(b/325246516): Set default placeholder according to approved
           // greenlines.
           .SetPlaceholderText(placeholder.empty() ? u"Search" : placeholder)
+          .SetController(this)
           .SetBorder(nullptr)
           .SetProperty(views::kElementIdentifierKey, kInputField)
           .SetProperty(views::kFlexBehaviorKey,
@@ -89,6 +93,14 @@
   }
 }
 
+bool PopupSearchBarView::HandleKeyEvent(views::Textfield* sender,
+                                        const ui::KeyEvent& key_event) {
+  if (key_event.type() == ui::ET_KEY_PRESSED) {
+    return delegate_->SearchBarHandleKeyPressed(key_event);
+  }
+  return false;
+}
+
 void PopupSearchBarView::Focus() {
   input_->RequestFocus();
 }
diff --git a/chrome/browser/ui/views/autofill/popup/popup_search_bar_view.h b/chrome/browser/ui/views/autofill/popup/popup_search_bar_view.h
index 1e9531f..cfebaa4 100644
--- a/chrome/browser/ui/views/autofill/popup/popup_search_bar_view.h
+++ b/chrome/browser/ui/views/autofill/popup/popup_search_bar_view.h
@@ -8,8 +8,10 @@
 #include <string>
 
 #include "base/functional/callback.h"
+#include "base/memory/raw_ref.h"
 #include "base/timer/timer.h"
 #include "ui/base/interaction/element_identifier.h"
+#include "ui/views/controls/textfield/textfield_controller.h"
 #include "ui/views/focus/focus_manager.h"
 #include "ui/views/view.h"
 
@@ -25,13 +27,26 @@
 // an API that allows the hosting popup to retrieve search queries and receive
 // input event notifications.
 class PopupSearchBarView : public views::View,
-                           public views::FocusChangeListener {
+                           public views::FocusChangeListener,
+                           public views::TextfieldController {
   METADATA_HEADER(PopupSearchBarView, views::View)
 
  public:
   using OnInputChangedCallback =
       base::RepeatingCallback<void(const std::u16string&)>;
 
+  class Delegate {
+   public:
+    // Keyboard events from the textfield are passed to this method first.
+    // The delegate returns `true` if the event was handled, this suppresses
+    // the default behaviour in the textfield. As an example, the LEFT/RIGHT
+    // arrow keys handled will not change the position of the text cursor.
+    virtual bool SearchBarHandleKeyPressed(const ui::KeyEvent& event) = 0;
+
+   protected:
+    virtual ~Delegate() = default;
+  };
+
   DECLARE_CLASS_ELEMENT_IDENTIFIER_VALUE(kInputField);
 
   // The delay between the textfield text change and triggering
@@ -41,7 +56,8 @@
 
   PopupSearchBarView(const std::u16string& placeholder,
                      OnInputChangedCallback on_input_changed_callback,
-                     base::RepeatingClosure on_focus_lost_callback);
+                     base::RepeatingClosure on_focus_lost_callback,
+                     Delegate& delegate);
   PopupSearchBarView(const PopupSearchBarView&) = delete;
   PopupSearchBarView& operator=(const PopupSearchBarView&) = delete;
   ~PopupSearchBarView() override;
@@ -54,6 +70,10 @@
   void OnWillChangeFocus(View* focused_before, View* focused_now) override {}
   void OnDidChangeFocus(View* focused_before, View* focused_now) override;
 
+  // views::TextfieldController:
+  bool HandleKeyEvent(views::Textfield* sender,
+                      const ui::KeyEvent& key_event) override;
+
   // Focuses on the input field.
   void Focus();
 
@@ -65,9 +85,12 @@
  private:
   void OnInputChanged();
 
+  // TODO(b/325246516): Move these callbacks to Delegate.
   OnInputChangedCallback on_input_changed_callback_;
   base::RepeatingClosure on_focus_lost_callback_;
 
+  const raw_ref<Delegate> delegate_;
+
   raw_ptr<views::Textfield> input_ = nullptr;
   raw_ptr<views::Button> clear_ = nullptr;
 
diff --git a/chrome/browser/ui/views/autofill/popup/popup_search_bar_view_unittest.cc b/chrome/browser/ui/views/autofill/popup/popup_search_bar_view_unittest.cc
index 6e64952..a5397fbd 100644
--- a/chrome/browser/ui/views/autofill/popup/popup_search_bar_view_unittest.cc
+++ b/chrome/browser/ui/views/autofill/popup/popup_search_bar_view_unittest.cc
@@ -12,7 +12,10 @@
 #include "chrome/test/views/chrome_views_test_base.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "ui/events/test/event_generator.h"
+#include "ui/events/types/event_type.h"
 #include "ui/views/widget/widget.h"
+#include "ui/views/widget/widget_utils.h"
 
 namespace autofill {
 
@@ -21,6 +24,18 @@
 using ::testing::InSequence;
 using ::testing::Mock;
 using ::testing::MockFunction;
+using ::testing::NiceMock;
+
+class MockDelegate : public PopupSearchBarView::Delegate {
+ public:
+  MockDelegate() = default;
+  ~MockDelegate() override = default;
+  MOCK_METHOD(bool,
+              SearchBarHandleKeyPressed,
+              (const ui::KeyEvent& event),
+              (override));
+};
+
 }  // namespace
 
 class PopupSearchBarViewTest : public ChromeViewsTestBase {
@@ -29,25 +44,32 @@
   void SetUp() override {
     ChromeViewsTestBase::SetUp();
     widget_ = CreateTestWidget();
+    generator_ = std::make_unique<ui::test::EventGenerator>(
+        views::GetRootWindow(widget_.get()));
   }
 
   void TearDown() override {
+    generator_.reset();
     widget_.reset();
     ChromeViewsTestBase::TearDown();
   }
 
  protected:
   views::Widget& widget() { return *widget_; }
+  ui::test::EventGenerator& generator() { return *generator_; }
+  MockDelegate& delegate() { return delegate_; }
 
  private:
   std::unique_ptr<views::Widget> widget_;
+  std::unique_ptr<ui::test::EventGenerator> generator_;
+  NiceMock<MockDelegate> delegate_;
 };
 
 TEST_F(PopupSearchBarViewTest, SetsFocusOnTextfield) {
   PopupSearchBarView* view =
       widget().SetContentsView(std::make_unique<PopupSearchBarView>(
           u"placeholder", /*on_input_changed_callback=*/base::DoNothing(),
-          /*on_focus_lost_callback=*/base::DoNothing()));
+          /*on_focus_lost_callback=*/base::DoNothing(), delegate()));
   widget().Show();
   view->Focus();
 
@@ -62,7 +84,7 @@
   PopupSearchBarView* view =
       widget().SetContentsView(std::make_unique<PopupSearchBarView>(
           u"placeholder", /*on_input_changed_callback=*/base::DoNothing(),
-          mock_on_focus_lost_callback.Get()));
+          mock_on_focus_lost_callback.Get(), delegate()));
   widget().Show();
   view->Focus();
   ASSERT_NE(widget().GetFocusManager()->GetFocusedView(), nullptr);
@@ -75,7 +97,7 @@
   base::MockRepeatingCallback<void(const std::u16string&)> input_callback;
   auto view = std::make_unique<PopupSearchBarView>(
       u"placeholder", input_callback.Get(),
-      /*on_focus_lost_callback=*/base::DoNothing());
+      /*on_focus_lost_callback=*/base::DoNothing(), delegate());
 
   MockFunction<void()> check;
   {
@@ -96,7 +118,7 @@
   base::MockRepeatingCallback<void(const std::u16string&)> input_callback;
   auto view = std::make_unique<PopupSearchBarView>(
       u"placeholder", input_callback.Get(),
-      /*on_focus_lost_callback=*/base::DoNothing());
+      /*on_focus_lost_callback=*/base::DoNothing(), delegate());
 
   MockFunction<void()> check;
   {
@@ -114,4 +136,31 @@
       PopupSearchBarView::kInputChangeCallbackDelay);
 }
 
+// TODO(b/338934966): Enable when key events suppressing in tests is fixed.
+#if !BUILDFLAG(IS_WIN)
+TEST_F(PopupSearchBarViewTest, KeyPressedFromTextfieldPassedToDelegateFirst) {
+  base::MockRepeatingCallback<void(const std::u16string&)> input_callback;
+  PopupSearchBarView* view =
+      widget().SetContentsView(std::make_unique<PopupSearchBarView>(
+          u"placeholder", input_callback.Get(),
+          /*on_focus_lost_callback=*/base::DoNothing(), delegate()));
+  widget().Show();
+  view->Focus();
+
+  // Set up "a" suppressing handler.
+  ON_CALL(delegate(), SearchBarHandleKeyPressed)
+      .WillByDefault([](const ui::KeyEvent& event) {
+        return event.key_code() == ui::VKEY_A ? true : false;
+      });
+  // As "a" is suppressed, only "bc" is expected.
+  EXPECT_CALL(input_callback, Run(std::u16string(u"bc")));
+
+  generator().PressAndReleaseKey(ui::VKEY_A);
+  generator().PressAndReleaseKey(ui::VKEY_B);
+  generator().PressAndReleaseKey(ui::VKEY_C);
+
+  task_environment()->FastForwardBy(
+      PopupSearchBarView::kInputChangeCallbackDelay);
+}
+#endif  // !BUILDFLAG(IS_WIN)
 }  // namespace autofill
diff --git a/chrome/browser/ui/views/autofill/popup/popup_view_utils.cc b/chrome/browser/ui/views/autofill/popup/popup_view_utils.cc
index 9021b3e..9ab5d76 100644
--- a/chrome/browser/ui/views/autofill/popup/popup_view_utils.cc
+++ b/chrome/browser/ui/views/autofill/popup/popup_view_utils.cc
@@ -435,60 +435,6 @@
   return arrow;
 }
 
-bool IsFooterSuggestionType(SuggestionType type) {
-  switch (type) {
-    case SuggestionType::kAllSavedPasswordsEntry:
-    case SuggestionType::kAutofillOptions:
-    case SuggestionType::kClearForm:
-    case SuggestionType::kDeleteAddressProfile:
-    case SuggestionType::kEditAddressProfile:
-    case SuggestionType::kFillEverythingFromAddressProfile:
-    case SuggestionType::kPasswordAccountStorageEmpty:
-    case SuggestionType::kPasswordAccountStorageOptIn:
-    case SuggestionType::kPasswordAccountStorageOptInAndGenerate:
-    case SuggestionType::kPasswordAccountStorageReSignin:
-    case SuggestionType::kScanCreditCard:
-    case SuggestionType::kSeePromoCodeDetails:
-    case SuggestionType::kShowAccountCards:
-    case SuggestionType::kViewPasswordDetails:
-      return true;
-    case SuggestionType::kAccountStoragePasswordEntry:
-    case SuggestionType::kAddressEntry:
-    case SuggestionType::kAddressFieldByFieldFilling:
-    case SuggestionType::kAutocompleteEntry:
-    case SuggestionType::kCompose:
-    case SuggestionType::kComposeDisable:
-    case SuggestionType::kComposeGoToSettings:
-    case SuggestionType::kComposeNeverShowOnThisSiteAgain:
-    case SuggestionType::kComposeSavedStateNotification:
-    case SuggestionType::kCreateNewPlusAddress:
-    case SuggestionType::kCreditCardEntry:
-    case SuggestionType::kCreditCardFieldByFieldFilling:
-    case SuggestionType::kDatalistEntry:
-    case SuggestionType::kDevtoolsTestAddressEntry:
-    case SuggestionType::kDevtoolsTestAddresses:
-    case SuggestionType::kFillExistingPlusAddress:
-    case SuggestionType::kFillFullAddress:
-    case SuggestionType::kFillFullEmail:
-    case SuggestionType::kFillFullName:
-    case SuggestionType::kFillFullPhoneNumber:
-    case SuggestionType::kFillPassword:
-    case SuggestionType::kGeneratePasswordEntry:
-    case SuggestionType::kIbanEntry:
-    case SuggestionType::kInsecureContextPaymentDisabledMessage:
-    case SuggestionType::kMerchantPromoCodeEntry:
-    case SuggestionType::kMixedFormMessage:
-    case SuggestionType::kPasswordEntry:
-    case SuggestionType::kPasswordFieldByFieldFilling:
-    case SuggestionType::kSeparator:
-    case SuggestionType::kTitle:
-    case SuggestionType::kVirtualCreditCardEntry:
-    case SuggestionType::kWebauthnCredential:
-    case SuggestionType::kWebauthnSignInWithAnotherDevice:
-      return false;
-  }
-}
-
 bool IsExpandableSuggestionType(SuggestionType type) {
   switch (type) {
     case SuggestionType::kAddressEntry:
diff --git a/chrome/browser/ui/views/autofill/popup/popup_view_utils.h b/chrome/browser/ui/views/autofill/popup/popup_view_utils.h
index 03291c80..452716fa 100644
--- a/chrome/browser/ui/views/autofill/popup/popup_view_utils.h
+++ b/chrome/browser/ui/views/autofill/popup/popup_view_utils.h
@@ -124,11 +124,6 @@
 // extension popup) and stays within the bounds of the browser window.
 bool PopupMayExceedContentAreaBounds(content::WebContents* web_contents);
 
-// Returns whether the suggestion with this `type` belongs into
-// the footer section of the popup. Returns `false` for separators, which may
-// belong either to the main or the footer section.
-bool IsFooterSuggestionType(SuggestionType type);
-
 // Returns whether the suggestion with this `type` can have child
 // suggestions.
 bool IsExpandableSuggestionType(SuggestionType type);
diff --git a/chrome/browser/ui/views/autofill/popup/popup_view_views.cc b/chrome/browser/ui/views/autofill/popup/popup_view_views.cc
index 9c5c428..786f3e5 100644
--- a/chrome/browser/ui/views/autofill/popup/popup_view_views.cc
+++ b/chrome/browser/ui/views/autofill/popup/popup_view_views.cc
@@ -23,6 +23,7 @@
 #include "build/build_config.h"
 #include "chrome/browser/platform_util.h"
 #include "chrome/browser/ui/autofill/autofill_popup_controller.h"
+#include "chrome/browser/ui/autofill/autofill_suggestion_controller_utils.h"
 #include "chrome/browser/ui/browser_element_identifiers.h"
 #include "chrome/browser/ui/browser_finder.h"
 #include "chrome/browser/ui/passwords/ui_utils.h"
@@ -49,6 +50,7 @@
 #include "components/feature_engagement/public/feature_constants.h"
 #include "components/strings/grit/components_strings.h"
 #include "components/user_education/common/feature_promo_controller.h"
+#include "content/public/common/input/native_web_keyboard_event.h"
 #include "third_party/abseil-cpp/absl/types/variant.h"
 #include "third_party/blink/public/common/input/web_input_event.h"
 #include "ui/accessibility/ax_node_data.h"
@@ -56,6 +58,8 @@
 #include "ui/base/metadata/metadata_impl_macros.h"
 #include "ui/base/ui_base_features.h"
 #include "ui/color/color_id.h"
+#include "ui/events/blink/web_input_event.h"
+#include "ui/events/event.h"
 #include "ui/events/keycodes/keyboard_codes.h"
 #include "ui/events/types/event_type.h"
 #include "ui/gfx/geometry/insets.h"
@@ -101,21 +105,6 @@
       DISTANCE_CONTENT_LIST_VERTICAL_SINGLE);
 }
 
-// Returns true if the item at `line_number` is a footer item.
-bool IsFooterItem(const std::vector<Suggestion>& suggestions,
-                  size_t line_number) {
-  if (line_number >= suggestions.size()) {
-    return false;
-  }
-
-  // Separators are a special case: They belong into the footer iff the next
-  // item exists and is a footer item.
-  SuggestionType type = suggestions[line_number].type;
-  return type == SuggestionType::kSeparator
-             ? IsFooterItem(suggestions, line_number + 1)
-             : IsFooterSuggestionType(type);
-}
-
 bool CanShowRootPopup(AutofillSuggestionController& controller) {
 #if BUILDFLAG(IS_MAC)
   // It's possible for the container_view to not be in a window. In that case,
@@ -707,6 +696,18 @@
       feature_engagement::kIPHAutofillCreditCardBenefitFeature);
 }
 
+bool PopupViewViews::SearchBarHandleKeyPressed(const ui::KeyEvent& event) {
+  if (!controller_) {
+    return false;
+  }
+
+  // Handling events in the controller (the delegate's handler is prioritized by
+  // the search bar) enables keyboard navigation when the search bar input
+  // field is focused.
+  return controller_->HandleKeyPressEvent(
+      content::NativeWebKeyboardEvent(event));
+}
+
 void PopupViewViews::SetSelectedCell(
     std::optional<CellIndex> cell_index,
     PopupCellSelectionSource source,
@@ -785,7 +786,8 @@
         base::BindRepeating(&PopupViewViews::OnSearchBarInputChanged,
                             base::Unretained(this)),
         base::BindRepeating(&PopupViewViews::OnSearchBarFocusLost,
-                            base::Unretained(this))));
+                            base::Unretained(this)),
+        *this));
     search_bar_->SetProperty(views::kMarginsKey,
                              gfx::Insets::VH(GetContentsVerticalPadding(), 0));
     AddChildView(std::make_unique<PopupSeparatorView>(/*vertical_padding=*/0));
@@ -818,6 +820,8 @@
 
   rows_.reserve(kSuggestions.size());
   size_t current_line_number = 0u;
+  // TODO(b/325246516): Add "No suggestions found" label if there is a filter
+  // and there are only footer suggestions in the list.
   // Add the body rows, if there are any.
   if (!kSuggestions.empty() && !IsFooterItem(kSuggestions, 0u)) {
     // Create a container to wrap the "regular" (non-footer) rows.
diff --git a/chrome/browser/ui/views/autofill/popup/popup_view_views.h b/chrome/browser/ui/views/autofill/popup/popup_view_views.h
index 2aaa070..7e473bd 100644
--- a/chrome/browser/ui/views/autofill/popup/popup_view_views.h
+++ b/chrome/browser/ui/views/autofill/popup/popup_view_views.h
@@ -65,7 +65,8 @@
 class PopupViewViews : public PopupBaseView,
                        public AutofillPopupView,
                        public PopupRowView::SelectionDelegate,
-                       public ExpandablePopupParentView {
+                       public ExpandablePopupParentView,
+                       public PopupSearchBarView::Delegate {
   METADATA_HEADER(PopupViewViews, PopupBaseView)
 
  public:
@@ -125,6 +126,9 @@
   // PopupBaseView:
   void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override;
 
+  // PopupSearchBarView::Delegate:
+  bool SearchBarHandleKeyPressed(const ui::KeyEvent& event) override;
+
  private:
   friend class PopupViewViewsTestApi;
 
diff --git a/chrome/browser/ui/views/autofill/popup/popup_view_views_unittest.cc b/chrome/browser/ui/views/autofill/popup/popup_view_views_unittest.cc
index 78efd36..c353ad2d 100644
--- a/chrome/browser/ui/views/autofill/popup/popup_view_views_unittest.cc
+++ b/chrome/browser/ui/views/autofill/popup/popup_view_views_unittest.cc
@@ -69,6 +69,7 @@
 
 using ::testing::_;
 using ::testing::AllOf;
+using ::testing::Eq;
 using ::testing::Field;
 using ::testing::InSequence;
 using ::testing::Mock;
@@ -1738,4 +1739,16 @@
       PopupSearchBarView::kInputChangeCallbackDelay);
 }
 
+TEST_F(PopupViewViewsTest, SearchBar_PressedKeysPassedToController) {
+  CreateAndShowView({SuggestionType::kAddressEntry},
+                    CreateParamsForTestWidget(),
+                    /*search_bar_config=*/{.enabled = true});
+
+  EXPECT_CALL(controller(), HandleKeyPressEvent(
+                                Field(&content::NativeWebKeyboardEvent::dom_key,
+                                      ui::DomKey::Key::ARROW_DOWN)));
+
+  generator().PressAndReleaseKey(ui::VKEY_DOWN);
+}
+
 }  // namespace autofill
diff --git a/chrome/browser/ui/views/default_link_capturing_interactive_uitest.cc b/chrome/browser/ui/views/default_link_capturing_interactive_uitest.cc
index ff480a0..30213f0 100644
--- a/chrome/browser/ui/views/default_link_capturing_interactive_uitest.cc
+++ b/chrome/browser/ui/views/default_link_capturing_interactive_uitest.cc
@@ -199,6 +199,25 @@
 }
 #endif  // BUILDFLAG(IS_MAC)
 
+// TODO(b/338969664): The following tests are failing on Linux MSan, so
+// disabling for now. These should be re-enabled.
+#if BUILDFLAG(IS_LINUX) && \
+    (defined(MEMORY_SANITIZER) || defined(THREAD_SANITIZER))
+#define MAYBE_AcceptingBubbleMeasuresUserAccept \
+  DISABLED_AcceptingBubbleMeasuresUserAccept
+#define MAYBE_BubbleDismissMeasuresUserDismiss \
+  DISABLED_BubbleDismissMeasuresUserDismiss
+#define MAYBE_ClosingAppWindowMeasuresDismiss \
+  DISABLED_ClosingAppWindowMeasuresDismiss
+#define MAYBE_IPHShownOnLinkClick DISABLED_IPHShownOnLinkClick
+#else
+#define MAYBE_AcceptingBubbleMeasuresUserAccept \
+  AcceptingBubbleMeasuresUserAccept
+#define MAYBE_BubbleDismissMeasuresUserDismiss BubbleDismissMeasuresUserDismiss
+#define MAYBE_ClosingAppWindowMeasuresDismiss ClosingAppWindowMeasuresDismiss
+#define MAYBE_IPHShownOnLinkClick IPHShownOnLinkClick
+#endif
+
 // Test to verify that launching an app from the intent picker chip shows the
 // IPH bubble if the feature flag is enabled.
 class WebAppLinkCapturingIPHPromoTest
@@ -315,7 +334,7 @@
 }
 
 IN_PROC_BROWSER_TEST_P(WebAppLinkCapturingIPHPromoTest,
-                       IPHShownOnLinkClick) {
+                       MAYBE_IPHShownOnLinkClick) {
   const webapps::AppId app_id = InstallApp();
   SetUpSiteForLinkCapturingIphBubble(app_id);
 
@@ -332,7 +351,7 @@
 }
 
 IN_PROC_BROWSER_TEST_P(WebAppLinkCapturingIPHPromoTest,
-                       ClosingAppWindowMeasuresDismiss) {
+                       MAYBE_ClosingAppWindowMeasuresDismiss) {
   const webapps::AppId app_id = InstallApp();
   base::UserActionTester user_action_tester;
   SetUpSiteForLinkCapturingIphBubble(app_id);
@@ -348,7 +367,7 @@
 }
 
 IN_PROC_BROWSER_TEST_P(WebAppLinkCapturingIPHPromoTest,
-                       AcceptingBubbleMeasuresUserAccept) {
+                       MAYBE_AcceptingBubbleMeasuresUserAccept) {
   const webapps::AppId app_id = InstallApp();
   base::UserActionTester user_action_tester;
   SetUpSiteForLinkCapturingIphBubble(app_id);
@@ -362,7 +381,7 @@
 }
 
 IN_PROC_BROWSER_TEST_P(WebAppLinkCapturingIPHPromoTest,
-                       BubbleDismissMeasuresUserDismiss) {
+                       MAYBE_BubbleDismissMeasuresUserDismiss) {
   const webapps::AppId app_id = InstallApp();
   base::UserActionTester user_action_tester;
   SetUpSiteForLinkCapturingIphBubble(app_id);
diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt.cc b/chrome/browser/ui/views/permissions/embedded_permission_prompt.cc
index 368105a..d575c7a9 100644
--- a/chrome/browser/ui/views/permissions/embedded_permission_prompt.cc
+++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt.cc
@@ -131,24 +131,30 @@
     ContentSetting setting,
     const content_settings::SettingInfo& info,
     ContentSettingsType type) {
-  // First determine if we can directly show one of the OS views, if the
-  // permission was granted (previously or by Administrator).
-  if (setting == CONTENT_SETTING_ALLOW) {
-    // TODO(crbug.com/40275129): Handle going to Windows settings.
-#if BUILDFLAG(IS_MAC)
-    if (ShouldShowSystemSettingsViewOnMacOS(type)) {
-      return Variant::kOsSystemSettings;
-    }
-
-    if (ShouldShowOSPromptViewOnMacOS(type)) {
-      return Variant::kOsPrompt;
-    }
-#endif
+  // If the administrator blocked the permission, there is nothing the user can
+  // do. Presenting them with a different screen in unproductive.
+  if (IsPermissionSetByAdministator(setting, info) &&
+      setting == CONTENT_SETTING_BLOCK) {
+    return Variant::kAdministratorDenied;
   }
 
+  // Determine if we can directly show one of the OS views. The "System
+  // Settings" view is higher priority then all the other remaining options,
+  // whereas the "OS Prompt" view is only higher priority then the views that
+  // are associated with a site-level allowed state.
+  // TODO(crbug.com/40275129): Handle going to Windows settings.
+#if BUILDFLAG(IS_MAC)
+  if (ShouldShowSystemSettingsViewOnMacOS(type)) {
+    return Variant::kOsSystemSettings;
+  }
+
+  if (setting == CONTENT_SETTING_ALLOW && ShouldShowOSPromptViewOnMacOS(type)) {
+    return Variant::kOsPrompt;
+  }
+#endif
+
   if (IsPermissionSetByAdministator(setting, info)) {
-    return setting == CONTENT_SETTING_ALLOW ? Variant::kAdministratorGranted
-                                            : Variant::kAdministratorDenied;
+    return Variant::kAdministratorGranted;
   }
 
   switch (setting) {
diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt.h b/chrome/browser/ui/views/permissions/embedded_permission_prompt.h
index da0d273..2409b02 100644
--- a/chrome/browser/ui/views/permissions/embedded_permission_prompt.h
+++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt.h
@@ -46,18 +46,18 @@
     // Permission prompt that informs the user they already granted permission.
     // Offers additional options to modify the permission decision.
     kPreviouslyGranted = 2,
-    // Informs the user that they need to go to OS system settings to grant
-    // access to Chrome.
-    kOsSystemSettings = 3,
     // Informs the user that Chrome needs permission from the OS level, in order
     // for the site to be able to access a permission.
-    kOsPrompt = 4,
+    kOsPrompt = 3,
     // Permission prompt that asks the user for site-level permission.
-    kAsk = 5,
+    kAsk = 4,
     // Permission prompt that additionally informs the user that they have
     // previously denied permission to the site. May offer different options
     // (buttons) to the site-level prompt |kAsk|.
-    kPreviouslyDenied = 6,
+    kPreviouslyDenied = 5,
+    // Informs the user that they need to go to OS system settings to grant
+    // access to Chrome.
+    kOsSystemSettings = 6,
     // Informs the user that the permission was denied by their administrator.
     kAdministratorDenied = 7,
   };
diff --git a/chrome/browser/ui/views/profiles/profile_menu_view.cc b/chrome/browser/ui/views/profiles/profile_menu_view.cc
index b19dd56..16e5539 100644
--- a/chrome/browser/ui/views/profiles/profile_menu_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_menu_view.cc
@@ -842,7 +842,10 @@
   // The sign-out button is always at the bottom.
   if (add_sign_out_button) {
     AddFeatureButton(
-        l10n_util::GetStringUTF16(IDS_SCREEN_LOCK_SIGN_OUT),
+        l10n_util::GetStringUTF16(
+            switches::IsExplicitBrowserSigninUIOnDesktopEnabled()
+                ? IDS_PROFILE_MENU_SIGN_OUT
+                : IDS_SCREEN_LOCK_SIGN_OUT),
         base::BindRepeating(&ProfileMenuView::OnSignoutButtonClicked,
                             base::Unretained(this)),
         kSignOutIcon);
diff --git a/chrome/browser/ui/webui/ash/cellular_setup/cellular_setup_localized_strings_provider.cc b/chrome/browser/ui/webui/ash/cellular_setup/cellular_setup_localized_strings_provider.cc
index afed9a4e..5b578155 100644
--- a/chrome/browser/ui/webui/ash/cellular_setup/cellular_setup_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/ash/cellular_setup/cellular_setup_localized_strings_provider.cc
@@ -71,7 +71,6 @@
      IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_USE_CAMERA_AGAIN},
     {"scanQrCodeError", IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_ERROR},
     {"qrCodeRetry", IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_RETRY},
-    {"scanQrCodeLoading", IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_LOADING},
     {"scanQrCodeInvalid", IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_INVALID},
     {"scanQrCodeInputSubtitle",
      IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_INPUT_SUBTITLE},
diff --git a/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.cc b/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.cc
index d337f07..3dd0a8ab 100644
--- a/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.cc
+++ b/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.cc
@@ -498,6 +498,30 @@
   }
 }
 
+void InputDeviceSettingsProvider::OnKeyboardBatteryInfoChanged(
+    const ::ash::mojom::Keyboard& keyboard) {
+  CHECK(features::IsWelcomeExperienceEnabled());
+  NotifyKeyboardsUpdated();
+}
+
+void InputDeviceSettingsProvider::OnGraphicsTabletBatteryInfoChanged(
+    const ::ash::mojom::GraphicsTablet& graphics_tablet) {
+  CHECK(features::IsWelcomeExperienceEnabled());
+  NotifyGraphicsTabletUpdated();
+}
+
+void InputDeviceSettingsProvider::OnMouseBatteryInfoChanged(
+    const ::ash::mojom::Mouse& mouse) {
+  CHECK(features::IsWelcomeExperienceEnabled());
+  NotifyMiceUpdated();
+}
+
+void InputDeviceSettingsProvider::OnTouchpadBatteryInfoChanged(
+    const ::ash::mojom::Touchpad& touchpad) {
+  CHECK(features::IsWelcomeExperienceEnabled());
+  NotifyTouchpadsUpdated();
+}
+
 void InputDeviceSettingsProvider::OnKeyboardConnected(
     const ::ash::mojom::Keyboard& keyboard) {
   NotifyKeyboardsUpdated();
diff --git a/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.h b/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.h
index 2642a2f..b38e42f 100644
--- a/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.h
+++ b/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.h
@@ -115,6 +115,13 @@
   void OnCustomizableTabletButtonPressed(
       const ::ash::mojom::GraphicsTablet& graphics_tablet,
       const ::ash::mojom::Button& button) override;
+  void OnKeyboardBatteryInfoChanged(
+      const ::ash::mojom::Keyboard& keyboard) override;
+  void OnGraphicsTabletBatteryInfoChanged(
+      const ::ash::mojom::GraphicsTablet& graphics_tablet) override;
+  void OnMouseBatteryInfoChanged(const ::ash::mojom::Mouse& mouse) override;
+  void OnTouchpadBatteryInfoChanged(
+      const ::ash::mojom::Touchpad& touchpad) override;
 
   void StartObserving(uint32_t device_id) override;
   void StopObserving() override;
diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/browser/ui/webui/settings/site_settings_helper.cc
index 0782260..081e8d8 100644
--- a/chrome/browser/ui/webui/settings/site_settings_helper.cc
+++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc
@@ -668,6 +668,7 @@
     case content_settings::ProviderType::kDefaultProvider:
       return SiteSettingSource::kDefault;
 
+    case content_settings::ProviderType::kNone:
     case content_settings::ProviderType::kNotificationAndroidProvider:
     case content_settings::ProviderType::kProviderForTests:
     case content_settings::ProviderType::kOtherProviderForTests:
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt
index 93c36ce..fcc2f08 100644
--- a/chrome/build/android-arm32.pgo.txt
+++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@
-chrome-android32-main-1714974569-f3722ba4b341dfdae6eeb621b033fd4d4f4fda33-aed977ff8651f242050b6c99627a220e960339e3.profdata
+chrome-android32-main-1714996788-e3c2addce111ed86f8023654c33636b5746915fa-7c029bd763013d4311fe512635c7f1211ccf1917.profdata
diff --git a/chrome/build/android-arm64.pgo.txt b/chrome/build/android-arm64.pgo.txt
index 5666fe60..a882f6c 100644
--- a/chrome/build/android-arm64.pgo.txt
+++ b/chrome/build/android-arm64.pgo.txt
@@ -1 +1 @@
-chrome-android64-main-1714953389-a3eeac0fe29eb683cbf190b555eb00ee4dc37e11-9d6d5d7557fd9af738c39afafdfb097855eda193.profdata
+chrome-android64-main-1714989444-bd283582b59cd499b71ba473dbb73283dc7014e9-27ba269c2b2d0e7b260bc10ae9ac74bcde46e884.profdata
diff --git a/chrome/build/lacros-arm64.pgo.txt b/chrome/build/lacros-arm64.pgo.txt
index 034b19269..46c830d 100644
--- a/chrome/build/lacros-arm64.pgo.txt
+++ b/chrome/build/lacros-arm64.pgo.txt
@@ -1 +1 @@
-chrome-chromeos-arm64-generic-main-1714909987-10897ddca7a8da3e41e6e94f313c9dfc8d43e0c5-264a8fddf4bb4c4808de9d97f936549f3f85e323.profdata
+chrome-chromeos-arm64-generic-main-1714996788-112245ef7e15a75159501bd883c44e12be5484b3-7c029bd763013d4311fe512635c7f1211ccf1917.profdata
diff --git a/chrome/build/lacros64.pgo.txt b/chrome/build/lacros64.pgo.txt
index 6855f7898..4ee2689 100644
--- a/chrome/build/lacros64.pgo.txt
+++ b/chrome/build/lacros64.pgo.txt
@@ -1 +1 @@
-chrome-chromeos-amd64-generic-main-1714953389-be0c0d19fec2e45ac9e424c3d4c3a8d6aa53d426-9d6d5d7557fd9af738c39afafdfb097855eda193.profdata
+chrome-chromeos-amd64-generic-main-1714996788-a90a711822199f15cd5aa15904bf9469670c8ec6-7c029bd763013d4311fe512635c7f1211ccf1917.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt
index 2b31479..692cbf3 100644
--- a/chrome/build/linux.pgo.txt
+++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@
-chrome-linux-main-1714974569-efa16879d95c804915464b03179eb2ea49b7b9ce-aed977ff8651f242050b6c99627a220e960339e3.profdata
+chrome-linux-main-1714996788-342c0129f2e53c6f7b5c6d5c3da8bffad295c32d-7c029bd763013d4311fe512635c7f1211ccf1917.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt
index 1c6b20d..6f80ba7 100644
--- a/chrome/build/mac-arm.pgo.txt
+++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@
-chrome-mac-arm-main-1714982245-728b440f96581e4189f6dcdf3d0375c1c948fa58-dcece8ab0b9c7145dd28f8a44eadc701296e95f3.profdata
+chrome-mac-arm-main-1715003908-4b8d24c91952eb1d06cbd772b33aa213ab11447f-0e4f503cfb9fd0328f0d50bcd735b135524d6a5a.profdata
diff --git a/chrome/build/win-arm64.pgo.txt b/chrome/build/win-arm64.pgo.txt
index 1418df42..11c6ccb 100644
--- a/chrome/build/win-arm64.pgo.txt
+++ b/chrome/build/win-arm64.pgo.txt
@@ -1 +1 @@
-chrome-win-arm64-main-1714974569-6a20b5a21eb5bcfb7dcfc1cb9bdccc94ebe7f98b-aed977ff8651f242050b6c99627a220e960339e3.profdata
+chrome-win-arm64-main-1714996788-40b717090d865e2c1a4155d523dc6429002db915-7c029bd763013d4311fe512635c7f1211ccf1917.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt
index cb06e54..3bd8e904 100644
--- a/chrome/build/win32.pgo.txt
+++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@
-chrome-win32-main-1714974569-e2c1eeb26a93da0cb8541268e75019b755a19ae7-aed977ff8651f242050b6c99627a220e960339e3.profdata
+chrome-win32-main-1714996788-441ab6b72f9b64c23ed5e2dd105a6e5f10a111bc-7c029bd763013d4311fe512635c7f1211ccf1917.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt
index d8c70b9..81db942 100644
--- a/chrome/build/win64.pgo.txt
+++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@
-chrome-win64-main-1714974569-600710712baa709c9726859755106086e139e82d-aed977ff8651f242050b6c99627a220e960339e3.profdata
+chrome-win64-main-1714996788-77cb83580f0f722722791763dd25f568c62af22a-7c029bd763013d4311fe512635c7f1211ccf1917.profdata
diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
index f02b473..9254836 100644
--- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -4925,6 +4925,32 @@
   EXPECT_EQ(fake_driver_.called_inform_about_user_input_count(), 0);
 }
 
+// Tests that the metric for the number of times form fill data is stored
+// for a form is recorded correctly.
+TEST_F(PasswordAutofillAgentTest, TimesReceivedFillDataForFormMetric) {
+  // Simulate the browser sending back the login info, it triggers the
+  // autocomplete.
+  SimulateOnFillPasswordForm(fill_data_);
+
+  // Simulate form fill data changing after form reparsing.
+  fill_data_.username_element_renderer_id = FieldRendererId();
+  SimulateOnFillPasswordForm(fill_data_);
+
+  // Simulate receiving form fill data that cannot be used, e.g. because
+  // the fields are not present on the page.
+  // Simulate form fill data changing after form reparsing.
+  fill_data_.username_element_renderer_id = FieldRendererId(404);
+  fill_data_.password_element_renderer_id = FieldRendererId(40404);
+  SimulateOnFillPasswordForm(fill_data_);
+
+  // Simulate navigating to a new document.
+  password_autofill_agent_->ReadyToCommitNavigation(nullptr);
+  // The histogram should be recorded only for the form present on a
+  // page.
+  histogram_tester_.ExpectUniqueSample(
+      "PasswordManager.TimesReceivedFillDataForForm", 2, 1);
+}
+
 #if BUILDFLAG(IS_ANDROID)
 // If a password field is hidden, the field unlikely has an Enter listener. So,
 // trigger a form submission on the username field.
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index e9d77528..5b624ad 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -7647,6 +7647,7 @@
       "//chrome/browser/password_manager/android:utils",
       "//chrome/browser/reading_list/android:reading_list",
       "//chrome/browser/reading_list/android:unit_tests",
+      "//chrome/browser/safety_hub/android:unit_tests",
       "//chrome/browser/share",
       "//chrome/browser/thumbnail:unit_tests",
       "//chrome/browser/touch_to_fill/autofill/android:public",
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/signin/SigninTestRule.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/signin/SigninTestRule.java
index de75c868..843be56 100644
--- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/signin/SigninTestRule.java
+++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/signin/SigninTestRule.java
@@ -101,7 +101,12 @@
         waitForSeeding();
     }
 
-    /** Adds and signs in an account with the default name without sync consent. */
+    /**
+     * Adds and signs in an account with the default name without sync consent.
+     *
+     * @deprecated Use the version with {@link AccountInfo}.
+     */
+    @Deprecated
     public CoreAccountInfo addTestAccountThenSignin() {
         assert !mIsSignedIn : "An account is already signed in!";
         CoreAccountInfo coreAccountInfo = addAccountAndWaitForSeeding(TEST_ACCOUNT_EMAIL);
@@ -110,7 +115,12 @@
         return coreAccountInfo;
     }
 
-    /** Adds and signs in an account with the specified name without sync consent. */
+    /**
+     * Adds and signs in an account with the specified name without sync consent.
+     *
+     * @deprecated Use the version with {@link AccountInfo}.
+     */
+    @Deprecated
     public CoreAccountInfo addAccountThenSignin(String email, String name) {
         assert !mIsSignedIn : "An account is already signed in!";
         CoreAccountInfo coreAccountInfo = addAccount(email, name);
@@ -120,6 +130,15 @@
         return coreAccountInfo;
     }
 
+    /** Adds and signs in with the provided account without sync consent. */
+    public void addAccountThenSignin(AccountInfo accountInfo) {
+        assert !mIsSignedIn : "An account is already signed in!";
+        addAccount(accountInfo);
+        waitForSeeding();
+        SigninTestUtil.signin(accountInfo);
+        mIsSignedIn = true;
+    }
+
     /** Adds and signs in an account with the default name and enables sync. */
     public CoreAccountInfo addTestAccountThenSigninAndEnableSync() {
         return addTestAccountThenSigninAndEnableSync(
diff --git a/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/128.png b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/128.png
new file mode 100644
index 0000000..db75a07
--- /dev/null
+++ b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/128.png
Binary files differ
diff --git a/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/16.png b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/16.png
new file mode 100644
index 0000000..e1c4363
--- /dev/null
+++ b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/16.png
Binary files differ
diff --git a/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/24.png b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/24.png
new file mode 100644
index 0000000..d234dcda
--- /dev/null
+++ b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/24.png
Binary files differ
diff --git a/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/256.png b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/256.png
new file mode 100644
index 0000000..ff3a7c32
--- /dev/null
+++ b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/256.png
Binary files differ
diff --git a/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/32.png b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/32.png
new file mode 100644
index 0000000..21333c4
--- /dev/null
+++ b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/32.png
Binary files differ
diff --git a/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/48.png b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/48.png
new file mode 100644
index 0000000..0f8832b
--- /dev/null
+++ b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/48.png
Binary files differ
diff --git a/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/512.png b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/512.png
new file mode 100644
index 0000000..5f61e947
--- /dev/null
+++ b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/512.png
Binary files differ
diff --git a/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/64.png b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/64.png
new file mode 100644
index 0000000..101e28f
--- /dev/null
+++ b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/64.png
Binary files differ
diff --git a/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/96.png b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/96.png
new file mode 100644
index 0000000..90c15d9f
--- /dev/null
+++ b/chrome/test/data/shortcuts/badging_icons/chrome_for_testing_branded/96.png
Binary files differ
diff --git a/chrome/test/data/webui/chromeos/print_preview_cros/destination_row_test.ts b/chrome/test/data/webui/chromeos/print_preview_cros/destination_row_test.ts
index 51e2679..4d59b60d 100644
--- a/chrome/test/data/webui/chromeos/print_preview_cros/destination_row_test.ts
+++ b/chrome/test/data/webui/chromeos/print_preview_cros/destination_row_test.ts
@@ -67,6 +67,7 @@
       displayName: 'Fake Destination',
       printerType: PrinterType.LOCAL_PRINTER,
       printerManuallySelected: false,
+      printerStatusReason: null,
     };
     element.destination = destination;
 
diff --git a/chrome/test/data/webui/chromeos/print_preview_cros/print_ticket_manager_test.ts b/chrome/test/data/webui/chromeos/print_preview_cros/print_ticket_manager_test.ts
index 081b2e0..ce51feb 100644
--- a/chrome/test/data/webui/chromeos/print_preview_cros/print_ticket_manager_test.ts
+++ b/chrome/test/data/webui/chromeos/print_preview_cros/print_ticket_manager_test.ts
@@ -11,7 +11,7 @@
 import {FAKE_PRINT_SESSION_CONTEXT_SUCCESSFUL, FakePrintPreviewPageHandler} from 'chrome://os-print/js/fakes/fake_print_preview_page_handler.js';
 import {createCustomEvent} from 'chrome://os-print/js/utils/event_utils.js';
 import {setPrintPreviewPageHandlerForTesting} from 'chrome://os-print/js/utils/mojo_data_providers.js';
-import {PrintTicket} from 'chrome://os-print/js/utils/print_preview_cros_app_types.js';
+import {PrinterStatusReason, PrintTicket} from 'chrome://os-print/js/utils/print_preview_cros_app_types.js';
 import {assertDeepEquals, assertEquals, assertFalse, assertNotEquals, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js';
 import {MockController} from 'chrome://webui-test/chromeos/mock_controller.m.js';
 import {MockTimer} from 'chrome://webui-test/mock_timer.js';
@@ -291,6 +291,9 @@
             ticket!.printerManuallySelected,
             'printerManuallySelected set from DestinationManager active' +
                 ' destination');
+        assertEquals(
+            PrinterStatusReason.UNKNOWN_REASON, ticket!.printerStatusReason,
+            'printerStatusReason fallback to UNKNOWN_REASON if null');
       });
 
   // Verify PrintTicket destination set to empty string if no active
@@ -400,6 +403,9 @@
             ticket!.printerManuallySelected,
             `printerManuallySelected should be ${
                 PDF_DESTINATION.printerManuallySelected}`);
+        assertEquals(
+            PrinterStatusReason.UNKNOWN_REASON, ticket!.printerStatusReason,
+            `printerStatusReason should fall back to UNKNOWN_REASON when null`);
         getActiveDestinationFn.returnValue = {
           id: 'fake_id',
           displayName: 'Fake Destination',
@@ -501,6 +507,14 @@
             undefined, ticket.pinValue,
             'Ticket pinValue optional property should not be set');
         assertEquals(
+            PrinterStatusReason.UNKNOWN_REASON, ticket.printerStatusReason,
+            'Ticket printerStatusReason should match ' +
+                'DEFAULT_PARTIAL_PRINT_TICKET');
+        assertEquals(
+            PrinterStatusReason.UNKNOWN_REASON, ticket.printerStatusReason,
+            'Ticket printerStatusReason should be ' +
+                'PrinterStatusReason.UNKNOWN_REASON');
+        assertEquals(
             DEFAULT_PARTIAL_PRINT_TICKET.printerType, ticket.printerType,
             'Ticket printerType should match DEFAULT_PARTIAL_PRINT_TICKET');
         assertEquals(
diff --git a/chrome/test/data/webui/chromeos/settings/os_apps_page/app_management_page/permission_item_test.ts b/chrome/test/data/webui/chromeos/settings/os_apps_page/app_management_page/permission_item_test.ts
index bdfd0a3..bbfe9fad 100644
--- a/chrome/test/data/webui/chromeos/settings/os_apps_page/app_management_page/permission_item_test.ts
+++ b/chrome/test/data/webui/chromeos/settings/os_apps_page/app_management_page/permission_item_test.ts
@@ -15,7 +15,7 @@
 import {loadTimeData} from 'chrome://resources/js/load_time_data.js';
 import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
 import {assertEquals, assertFalse, assertNull, assertTrue} from 'chrome://webui-test/chai_assert.js';
-import {flushTasks} from 'chrome://webui-test/polymer_test_util.js';
+import {flushTasks, waitAfterNextRender} from 'chrome://webui-test/polymer_test_util.js';
 
 import {FakePageHandler} from '../../app_management/fake_page_handler.js';
 import {fakeComponentBrowserProxy, replaceStore, setupFakeHandler} from '../../app_management/test_util.js';
@@ -179,7 +179,7 @@
       const link = permissionDescription.shadowRoot!.querySelector('a');
       assertTrue(!!link);
       link.click();
-      await flushTasks();
+      await waitAfterNextRender(permissionItem);
     }
 
     test('Open dialog and close using cancel button', async () => {
@@ -208,7 +208,7 @@
               '#cancelButton');
       assertTrue(!!cancelButton);
       cancelButton.click();
-      await flushTasks();
+      await waitAfterNextRender(permissionItem);
 
       // Dialog not visible anymore.
       assertNull(getDialogElement());
@@ -240,8 +240,10 @@
               '#confirmButton');
       assertTrue(!!confirmButton);
       confirmButton.click();
-      await flushTasks();
+      await waitAfterNextRender(permissionItem);
 
+      // Dialog not visible anymore.
+      assertNull(getDialogElement());
       // Sensor access is turned ON.
       assertEquals(
           GeolocationAccessLevel.ALLOWED,
diff --git a/chrome/test/data/webui/chromeos/settings/os_settings_browsertest.cc b/chrome/test/data/webui/chromeos/settings/os_settings_browsertest.cc
index e18ceb8..3f0b2b9 100644
--- a/chrome/test/data/webui/chromeos/settings/os_settings_browsertest.cc
+++ b/chrome/test/data/webui/chromeos/settings/os_settings_browsertest.cc
@@ -1439,9 +1439,8 @@
       "os_apps_page/app_management_page/supported_links_item_test.js");
 }
 
-// // TODO: crbug.com/336956194 - Flaky for OsSettingsRevampWayfindingEnabled.
 IN_PROC_BROWSER_TEST_P(OSSettingsRevampMochaTest,
-                       DISABLED_OsAppsPageAppManagementPagePermissionItem) {
+                       OsAppsPageAppManagementPagePermissionItem) {
   RunSettingsTest("os_apps_page/app_management_page/permission_item_test.js");
 }
 
diff --git a/chrome/test/data/webui/cr_components/chromeos/cellular_setup/activation_code_page_test.ts b/chrome/test/data/webui/cr_components/chromeos/cellular_setup/activation_code_page_test.ts
index 3e07de5..d16076ca 100644
--- a/chrome/test/data/webui/cr_components/chromeos/cellular_setup/activation_code_page_test.ts
+++ b/chrome/test/data/webui/cr_components/chromeos/cellular_setup/activation_code_page_test.ts
@@ -15,7 +15,6 @@
 import {eventToPromise} from 'chrome://webui-test/test_util.js';
 import {assertFalse, assertTrue, assertEquals} from 'chrome://webui-test/chai_assert.js';
 import {loadTimeData} from 'chrome://resources/js/load_time_data.js';
-import type {CrButtonElement} from 'chrome://resources/ash/common/cr_elements/cr_button/cr_button.js';
 import type {CrInputElement} from 'chrome://resources/ash/common/cr_elements/cr_input/cr_input.js';
 
 import {FakeBarcodeDetector, FakeImageCapture} from './fake_barcode_detector.js';
@@ -170,8 +169,6 @@
     assertFalse(!!getUseCameraAgainButton());
     assertTrue(!!scanSuccessContainer);
     assertTrue(!!scanFailureContainer);
-    assertFalse(
-        !!activationCodePage.shadowRoot!.querySelector('paper-spinner-lite'));
 
     // Initial state should only be showing the start scanning UI.
     assertFalse(startScanningContainer.hidden);
@@ -179,8 +176,6 @@
     assertTrue(video.hidden);
     assertTrue(scanFinishContainer.hidden);
     assertTrue(switchCameraButton.hidden);
-    assertFalse(
-        !!activationCodePage.shadowRoot!.querySelector('paper-spinner-lite'));
 
     // Click the start scanning button.
     startScanningButton.click();
@@ -226,13 +221,8 @@
     assertTrue(video.hidden);
     assertTrue(scanFinishContainer.hidden);
     assertTrue(switchCameraButton.hidden);
-    assertFalse(
-        !!activationCodePage.shadowRoot!.querySelector('paper-spinner-lite'));
 
-    activationCodePage.showBusy = true;
     await flushAsync();
-    assertTrue(
-        !!activationCodePage.shadowRoot!.querySelector('paper-spinner-lite'));
 
     // Mock, no media devices present
     mediaDevices.removeDevice();
@@ -321,34 +311,6 @@
     assertTrue(video.hidden);
   });
 
-  test('UI is disabled when showBusy property is set', async function() {
-    const startScanningButton =
-        activationCodePage.shadowRoot!.querySelector<CrButtonElement>('#startScanningButton');
-    const switchCameraButton =
-        activationCodePage.shadowRoot!.querySelector<CrButtonElement>('#switchCameraButton');
-    const tryAgainButton =
-        activationCodePage.shadowRoot!.querySelector<CrButtonElement>('#tryAgainButton');
-    const input =
-        activationCodePage.shadowRoot!.querySelector<CrInputElement>('#activationCode');
-
-    assertTrue(!!startScanningButton);
-    assertTrue(!!switchCameraButton);
-    assertTrue(!!tryAgainButton);
-    assertTrue(!!input);
-
-    assertFalse(startScanningButton.disabled);
-    assertFalse(switchCameraButton.disabled);
-    assertFalse(tryAgainButton.disabled);
-    assertFalse(input.disabled);
-
-    activationCodePage.showBusy = true;
-
-    assertTrue(startScanningButton.disabled);
-    assertTrue(switchCameraButton.disabled);
-    assertTrue(tryAgainButton.disabled);
-    assertTrue(input.disabled);
-  });
-
   test(
       'Do not show qrContainer when BarcodeDetector is not ready',
       async function() {
diff --git a/chrome/test/data/webui/password_manager/credential_field_test.ts b/chrome/test/data/webui/password_manager/credential_field_test.ts
index 6852d386..0493dee 100644
--- a/chrome/test/data/webui/password_manager/credential_field_test.ts
+++ b/chrome/test/data/webui/password_manager/credential_field_test.ts
@@ -6,7 +6,7 @@
 
 import type {CredentialFieldElement} from 'chrome://password-manager/password_manager.js';
 import {Page, PasswordManagerImpl, PasswordViewPageInteractions, Router} from 'chrome://password-manager/password_manager.js';
-import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js';
+import {assertEquals} from 'chrome://webui-test/chai_assert.js';
 import {flushTasks} from 'chrome://webui-test/polymer_test_util.js';
 
 import {TestPasswordManagerProxy} from './test_password_manager_proxy.js';
@@ -50,15 +50,11 @@
 
   test('copy value', async function() {
     const element = await createCredentialFieldElement();
-    assertFalse(element.$.toast.open);
 
     element.$.copyButton.click();
     await passwordManager.whenCalled('extendAuthValidity');
     assertEquals(
         INTERACTION_ID,
         await passwordManager.whenCalled('recordPasswordViewInteraction'));
-
-    assertTrue(element.$.toast.open);
-    assertEquals(VALUE_COPIED_TOAST_LABEL, element.$.toast.textContent!.trim());
   });
 });
diff --git a/chrome/test/data/webui/password_manager/password_details_card_test.ts b/chrome/test/data/webui/password_manager/password_details_card_test.ts
index 63121183..6d5c47c 100644
--- a/chrome/test/data/webui/password_manager/password_details_card_test.ts
+++ b/chrome/test/data/webui/password_manager/password_details_card_test.ts
@@ -89,9 +89,9 @@
     const card = await createCardElement(password);
 
     assertTrue(isVisible(card.$.copyPasswordButton));
-    assertFalse(card.$.toast.open);
 
     card.$.copyPasswordButton.click();
+    await eventToPromise('value-copied', card);
     await passwordManager.whenCalled('extendAuthValidity');
     const {id, reason} =
         await passwordManager.whenCalled('requestPlaintextPassword');
@@ -102,10 +102,6 @@
         await passwordManager.whenCalled('recordPasswordViewInteraction'));
 
     await flushTasks();
-    assertTrue(card.$.toast.open);
-    assertEquals(
-        loadTimeData.getString('passwordCopiedToClipboard'),
-        card.$.toast.textContent!.trim());
   });
 
   test('Links properly displayed', async function() {
@@ -496,4 +492,20 @@
         const dialog = moveDialog!.shadowRoot!.querySelector('#dialog');
         assertTrue(!!dialog);
       });
+
+  test('Password value is hidden if object was changed', async function() {
+    const password1 = createPasswordEntry(
+        {id: 1, url: 'test.com', username: 'vik', password: 'password69'});
+    password1.affiliatedDomains = [createAffiliatedDomain('test.com')];
+
+    const password2 = createPasswordEntry(
+        {id: 1, url: 'test.com', username: 'viktor', password: 'password69'});
+    password2.affiliatedDomains = [createAffiliatedDomain('test.com')];
+
+    const card = await createCardElement(password1);
+    card.isPasswordVisible = true;
+
+    card.password = password2;
+    assertFalse(card.isPasswordVisible);
+  });
 });
diff --git a/chrome/test/data/webui/password_manager/password_manager_app_test.ts b/chrome/test/data/webui/password_manager/password_manager_app_test.ts
index aa39c34..22c97f5e 100644
--- a/chrome/test/data/webui/password_manager/password_manager_app_test.ts
+++ b/chrome/test/data/webui/password_manager/password_manager_app_test.ts
@@ -242,6 +242,55 @@
                    .includes(testEmail));
   });
 
+  test('Only one toast is visible', async () => {
+    const group = createCredentialGroup({
+      name: 'test.com',
+      credentials: [
+        createPasswordEntry({id: 0, username: 'test1'}),
+      ],
+    });
+    Router.getInstance().navigateTo(Page.PASSWORD_DETAILS, group);
+    const VALUE_COPIED_TOAST_LABEL = 'Username copied!';
+
+    await flushTasks();
+
+    assertFalse(app.$.toast.open);
+    const detailsSection =
+        app.shadowRoot!.querySelector('password-details-section');
+    assertTrue(!!detailsSection);
+
+    // Copy password.
+    detailsSection.dispatchEvent(new CustomEvent('value-copied', {
+      bubbles: true,
+      composed: true,
+      detail: {
+        toastMessage: 'Password copied!',
+      },
+    }));
+    await flushTasks();
+    assertTrue(app.$.toast.open);
+
+    // Copy username.
+    detailsSection.dispatchEvent(new CustomEvent('value-copied', {
+      bubbles: true,
+      composed: true,
+      detail: {
+        toastMessage: VALUE_COPIED_TOAST_LABEL,
+      },
+    }));
+
+    await flushTasks();
+    assertEquals(app.shadowRoot!.querySelectorAll('cr-toast').length, 1);
+    assertTrue(app.$.toast.open);
+
+    const button = app.shadowRoot!.querySelector<HTMLElement>('#undo');
+    assertTrue(!!button);
+    assertFalse(isVisible(button));
+    assertTrue(app.$.toast.querySelector<HTMLElement>(
+                              '#toast-message')!.textContent!.trim()
+                   .includes(VALUE_COPIED_TOAST_LABEL));
+  });
+
   // TODO(crbug.com/331450809): This test is flaky.
   test.skip('settings password moved toast', async () => {
     const testEmail = 'test.user@gmail.com';
diff --git a/chromeos/ash/components/login/auth/auth_attempt_state.h b/chromeos/ash/components/login/auth/auth_attempt_state.h
index 0f2b004..855bba8 100644
--- a/chromeos/ash/components/login/auth/auth_attempt_state.h
+++ b/chromeos/ash/components/login/auth/auth_attempt_state.h
@@ -9,7 +9,6 @@
 #include <string>
 
 #include "base/component_export.h"
-#include "base/memory/weak_ptr.h"
 #include "chromeos/ash/components/login/auth/auth_status_consumer.h"
 #include "chromeos/ash/components/login/auth/public/user_context.h"
 #include "google_apis/gaia/gaia_auth_consumer.h"
@@ -19,8 +18,7 @@
 
 // Tracks the state associated with a single attempt to log in to chromium OS.
 // Enforces that methods are only called on the UI thread.
-class COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_LOGIN_AUTH) AuthAttemptState
-    : public base::SupportsWeakPtr<AuthAttemptState> {
+class COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_LOGIN_AUTH) AuthAttemptState {
  public:
   // Used to initialize for a login attempt.
   explicit AuthAttemptState(std::unique_ptr<UserContext> user_context);
diff --git a/chromeos/ash/components/login/auth/auth_factor_editor.cc b/chromeos/ash/components/login/auth/auth_factor_editor.cc
index 8a6c44e..c07a2a76 100644
--- a/chromeos/ash/components/login/auth/auth_factor_editor.cc
+++ b/chromeos/ash/components/login/auth/auth_factor_editor.cc
@@ -228,7 +228,10 @@
   request.set_auth_factor_label(ref.label().value());
 
   cryptohome::AuthFactorCommonMetadata metadata;
-  cryptohome::AuthFactor factor(ref, std::move(metadata));
+  cryptohome::PasswordMetadata password_metadata =
+      cryptohome::PasswordMetadata::CreateWithoutSalt();
+  cryptohome::AuthFactor factor(ref, std::move(metadata),
+                                std::move(password_metadata));
 
   cryptohome::AuthFactorInput input(
       cryptohome::AuthFactorInput::Password{key->GetSecret()});
diff --git a/clank b/clank
index 5077b23..86a403c 160000
--- a/clank
+++ b/clank
@@ -1 +1 @@
-Subproject commit 5077b2364a2885c3aea01d603ca1bb1647cc25f4
+Subproject commit 86a403cb8a162ba2670eafa8f962ae894531a42b
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc
index df944dc..a97851c 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -19,6 +19,7 @@
 #include "base/i18n/case_conversion.h"
 #include "base/memory/raw_ptr.h"
 #include "base/metrics/field_trial_params.h"
+#include "base/metrics/histogram_functions.h"
 #include "base/metrics/histogram_macros.h"
 #include "base/no_destructor.h"
 #include "base/notreached.h"
@@ -1439,6 +1440,7 @@
     return;
   }
 
+  times_received_fill_data_[form_data.form_renderer_id]++;
   StoreDataForFillOnAccountSelect(form_data, username_element,
                                   password_element);
 
@@ -1763,6 +1765,12 @@
 #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
   page_passwords_analyser_.Reset();
 #endif
+
+  for (const auto& [_, times_received_data] : times_received_fill_data_) {
+    base::UmaHistogramCounts100("PasswordManager.TimesReceivedFillDataForForm",
+                                times_received_data);
+  }
+  times_received_fill_data_.clear();
 }
 
 void PasswordAutofillAgent::InformBrowserAboutUserInput(
diff --git a/components/autofill/content/renderer/password_autofill_agent.h b/components/autofill/content/renderer/password_autofill_agent.h
index b417263..7a49d37 100644
--- a/components/autofill/content/renderer/password_autofill_agent.h
+++ b/components/autofill/content/renderer/password_autofill_agent.h
@@ -575,6 +575,12 @@
   // triggered.
   FieldRendererId field_renderer_id_to_submit_;
 
+  // Tracks how many times PasswordFormFillData was received from the browser
+  // for every form.
+  // Can be used to estimate how many times forms are actually reparsed
+  // during their lifetime.
+  std::map<FormRendererId, size_t> times_received_fill_data_;
+
 #if BUILDFLAG(IS_ANDROID)
   // Current state of the keyboard replacing surface. This is reset during
   // CleanupOnDocumentShutdown.
diff --git a/components/autofill/core/browser/autofill_suggestion_generator.cc b/components/autofill/core/browser/autofill_suggestion_generator.cc
index 2ed0a8e..bfa6806 100644
--- a/components/autofill/core/browser/autofill_suggestion_generator.cc
+++ b/components/autofill/core/browser/autofill_suggestion_generator.cc
@@ -940,11 +940,18 @@
   if (trigger_field_type != CREDIT_CARD_NUMBER) {
     return suggestion_canon.starts_with(field_contents_canon);
   }
-  // For card number fields, suggest the card if:
+  // If `kAutofillDontPrefixMatchCreditCardNumbers` is enabled, we do not apply
+  // prefix matching to credit cards. If the feature is disabled, we suggest a
+  // card iff
   // - the number matches any part of the card, or
   // - it's a masked card and there are 6 or fewer typed so far.
   // - it's a masked card, field is autofilled, and the last 4 digits in the
   // field match the last 4 digits of the card.
+  if (base::FeatureList::IsEnabled(
+          features::kAutofillDontPrefixMatchCreditCardNumbers)) {
+    return true;
+  }
+
   if (suggestion_canon.find(field_contents_canon) != std::u16string::npos) {
     return true;
   }
diff --git a/components/autofill/core/browser/autofill_suggestion_generator_unittest.cc b/components/autofill/core/browser/autofill_suggestion_generator_unittest.cc
index 2b6bd29..63a6666 100644
--- a/components/autofill/core/browser/autofill_suggestion_generator_unittest.cc
+++ b/components/autofill/core/browser/autofill_suggestion_generator_unittest.cc
@@ -67,6 +67,7 @@
 using testing::Field;
 using testing::IsEmpty;
 using testing::Matcher;
+using testing::UnorderedElementsAre;
 using testing::UnorderedElementsAreArray;
 
 constexpr auto kDefaultTriggerSource =
@@ -2350,6 +2351,37 @@
   histogram_tester.ExpectBucketCount(kHistogramName, 1, 1);
 }
 
+// Tests that credit card suggestions are not subject to prefix matching for the
+// credit card number if `kAutofillDontPrefixMatchCreditCardNumbers` is enabled.
+TEST_F(AutofillSuggestionGeneratorTest,
+       NoPrefixMatchingForCreditCardsIfFeatureIsTurnedOn) {
+  base::test::ScopedFeatureList features(
+      features::kAutofillDontPrefixMatchCreditCardNumbers);
+  CreditCard card1 = test::GetCreditCard();
+  card1.set_record_type(CreditCard::RecordType::kLocalCard);
+  personal_data().payments_data_manager().AddCreditCard(card1);
+  CreditCard card2 = test::GetCreditCard2();
+  card2.set_record_type(CreditCard::RecordType::kMaskedServerCard);
+  personal_data().AddServerCreditCard(card2);
+
+  auto get_cards = [&](std::u16string field_value) {
+    FormFieldData field;
+    field.set_value(std::move(field_value));
+    return test_api(suggestion_generator())
+        .GetOrderedCardsToSuggest(field, CREDIT_CARD_NUMBER,
+                                  /*suppress_disused_cards=*/false,
+                                  /*prefix_match=*/true,
+                                  /*include_virtual_cards=*/false);
+  };
+
+  EXPECT_THAT(get_cards(u""), UnorderedElementsAre(card1, card2));
+
+  ASSERT_NE(card1.number(), card2.number());
+  EXPECT_THAT(get_cards(card1.number()), UnorderedElementsAre(card1, card2));
+
+  EXPECT_THAT(get_cards(card2.number()), UnorderedElementsAre(card1, card2));
+}
+
 TEST_F(AutofillSuggestionGeneratorTest,
        ManualFallback_UnusedExpiredCardsAreNotSuppressed) {
   CreditCard local_card = test::GetCreditCard();
diff --git a/components/autofill/core/browser/browser_autofill_manager.cc b/components/autofill/core/browser/browser_autofill_manager.cc
index 0da3d49a..ace09cd 100644
--- a/components/autofill/core/browser/browser_autofill_manager.cc
+++ b/components/autofill/core/browser/browser_autofill_manager.cc
@@ -87,6 +87,7 @@
 #include "components/autofill/core/browser/logging/log_manager.h"
 #include "components/autofill/core/browser/metrics/autofill_metrics.h"
 #include "components/autofill/core/browser/metrics/fallback_autocomplete_unrecognized_metrics.h"
+#include "components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h"
 #include "components/autofill/core/browser/metrics/form_events/form_event_logger_base.h"
 #include "components/autofill/core/browser/metrics/form_events/form_events.h"
 #include "components/autofill/core/browser/metrics/log_event.h"
@@ -203,7 +204,8 @@
       {"Manually filled to same type",
        base::NumberToString(filling_stats.num_manually_filled_to_same_type)},
       {"Manually filled to a different type",
-       base::NumberToString(filling_stats.num_manually_filled_to_differt_type)},
+       base::NumberToString(
+           filling_stats.num_manually_filled_to_different_type)},
       {"Manually filled to an unknown type",
        base::NumberToString(filling_stats.num_manually_filled_to_unknown_type)},
       {"Total corrected", base::NumberToString(filling_stats.TotalCorrected())},
diff --git a/components/autofill/core/browser/form_parsing/internal_resources b/components/autofill/core/browser/form_parsing/internal_resources
index 9660b914..feb267b 160000
--- a/components/autofill/core/browser/form_parsing/internal_resources
+++ b/components/autofill/core/browser/form_parsing/internal_resources
@@ -1 +1 @@
-Subproject commit 9660b91477518bb99509fe8db257dba2e2d1eec6
+Subproject commit feb267b80dd9df83ce4949470d5b1cc6214cd775
diff --git a/components/autofill/core/browser/form_parsing/resources/legacy_regex_patterns.json b/components/autofill/core/browser/form_parsing/resources/legacy_regex_patterns.json
index ffd070fc..37d1b7da 100644
--- a/components/autofill/core/browser/form_parsing/resources/legacy_regex_patterns.json
+++ b/components/autofill/core/browser/form_parsing/resources/legacy_regex_patterns.json
@@ -834,6 +834,16 @@
         "match_field_attributes": ["LABEL", "NAME"],
         "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"]
       }
+    ],
+    "pl": [
+      {
+        // "(?<!o)" exists to prevent "okrajov" and "okraj" from matching.
+        "positive_pattern": "(?<!o)kraj|pa[nń]stwo",
+        "positive_score": 1.1,
+        "negative_pattern": null,
+        "match_field_attributes": ["LABEL", "NAME"],
+        "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"]
+      }
     ]
   },
   "COUNTRY_LOCATION": {
diff --git a/components/autofill/core/browser/metrics/autofill_metrics.cc b/components/autofill/core/browser/metrics/autofill_metrics.cc
index de4b9e3..d711b03 100644
--- a/components/autofill/core/browser/metrics/autofill_metrics.cc
+++ b/components/autofill/core/browser/metrics/autofill_metrics.cc
@@ -48,8 +48,6 @@
 // Exponential bucket spacing for UKM event data.
 constexpr double kAutofillEventDataBucketSpacing = 2.0;
 
-using autofill_metrics::FormGroupFillingStats;
-
 // Translates structured name types into simple names that are used for
 // naming histograms.
 constexpr auto kStructuredNameTypeToNameMap =
diff --git a/components/autofill/core/browser/metrics/autofill_metrics.h b/components/autofill/core/browser/metrics/autofill_metrics.h
index 9b224b8..ae7fc1ea 100644
--- a/components/autofill/core/browser/metrics/autofill_metrics.h
+++ b/components/autofill/core/browser/metrics/autofill_metrics.h
@@ -540,33 +540,6 @@
     kMaxValue = AUTOFILLED_FIELD_WAS_NOT_EDITED,
   };
 
-  // The filling status of an autofilled field.
-  // These values are persisted to logs. Entries should not be renumbered and
-  // numeric values should never be reused.
-  enum class FieldFillingStatus {
-    // The field was filled and accepted.
-    kAccepted = 0,
-    // The field was filled and corrected to a value of the same type.
-    kCorrectedToSameType = 1,
-    // The field was filled and corrected to a value of a different type.
-    kCorrectedToDifferentType = 2,
-    // The field was filled and corrected to a value of an unknown type.
-    kCorrectedToUnknownType = 3,
-    // The field was filled and the value was cleared afterwards.
-    kCorrectedToEmpty = 4,
-    // The field was manually filled to a value of the same type as the
-    // field was predicted to.
-    kManuallyFilledToSameType = 5,
-    // The field was manually filled to a value of a different type as the field
-    // was predicted to.
-    kManuallyFilledToDifferentType = 6,
-    // The field was manually filled to a value of an unknown type.
-    kManuallyFilledToUnknownType = 7,
-    // The field was left empty.
-    kLeftEmpty = 8,
-    kMaxValue = kLeftEmpty
-  };
-
   enum class AutocompleteState {
     kNone = 0,
     kValid = 1,
diff --git a/components/autofill/core/browser/metrics/autofill_metrics_unittest.cc b/components/autofill/core/browser/metrics/autofill_metrics_unittest.cc
index 00ba969..fea26a4 100644
--- a/components/autofill/core/browser/metrics/autofill_metrics_unittest.cc
+++ b/components/autofill/core/browser/metrics/autofill_metrics_unittest.cc
@@ -37,6 +37,7 @@
 #include "components/autofill/core/browser/crowdsourcing/autofill_crowdsourcing_encoding.h"
 #include "components/autofill/core/browser/data_model/credit_card.h"
 #include "components/autofill/core/browser/field_types.h"
+#include "components/autofill/core/browser/filling_product.h"
 #include "components/autofill/core/browser/form_structure.h"
 #include "components/autofill/core/browser/form_structure_test_api.h"
 #include "components/autofill/core/browser/metrics/autofill_metrics_test_base.h"
@@ -216,22 +217,46 @@
                    .value = u"Elvis Aaron Presley",
                    .is_autofilled = true},
                   {.role = CREDIT_CARD_NUMBER, .value = u"01230123012399"}}});
+  FormData autocompleted_form =
+      test::GetFormData({.fields = {{.role = CREDIT_CARD_NUMBER,
+                                     .value = u"01230123012399",
+                                     .is_autofilled = true},
+                                    {.role = ADDRESS_HOME_CITY,
+                                     .value = u"Munich",
+                                     .is_autofilled = true}}});
   payments_form.fields.back().set_is_user_edited(true);
   autofill_manager().AddSeenForm(address_form, {NAME_FULL, ADDRESS_HOME_LINE1});
   autofill_manager().AddSeenForm(payments_form,
                                  {CREDIT_CARD_NAME_FULL, CREDIT_CARD_NUMBER});
+  autofill_manager()
+      .GetAutofillField(address_form, address_form.fields.front())
+      ->set_filling_product(FillingProduct::kAddress);
+  autofill_manager()
+      .GetAutofillField(payments_form, payments_form.fields.front())
+      ->set_filling_product(FillingProduct::kCreditCard);
 
   base::HistogramTester histogram_tester;
+  // Upon submitting the address form, we expect logging a perfect address
+  // filling.
   SubmitForm(address_form);
   histogram_tester.ExpectUniqueSample("Autofill.PerfectFilling.Addresses", 1,
                                       1);
   histogram_tester.ExpectTotalCount("Autofill.PerfectFilling.CreditCards", 0);
-
+  // Upon submitting the payments form, we expect logging a perfect address
+  // filling, since one of the fields was user edited.
   SubmitForm(payments_form);
   histogram_tester.ExpectUniqueSample("Autofill.PerfectFilling.Addresses", 1,
                                       1);
   histogram_tester.ExpectUniqueSample("Autofill.PerfectFilling.CreditCards", 0,
                                       1);
+  // Upon submitting the autocompleted form, we expect not logging anything for
+  // both metrics, since the product of filling the form is neither addresses
+  // nor credit cards.
+  SubmitForm(autocompleted_form);
+  histogram_tester.ExpectUniqueSample("Autofill.PerfectFilling.Addresses", 1,
+                                      1);
+  histogram_tester.ExpectUniqueSample("Autofill.PerfectFilling.CreditCards", 0,
+                                      1);
 }
 
 // Test the emission of collisions between NUMERIC_QUANTITY and server
diff --git a/components/autofill/core/browser/metrics/autofill_metrics_utils.cc b/components/autofill/core/browser/metrics/autofill_metrics_utils.cc
index fe59ff6..5d17cc03 100644
--- a/components/autofill/core/browser/metrics/autofill_metrics_utils.cc
+++ b/components/autofill/core/browser/metrics/autofill_metrics_utils.cc
@@ -11,76 +11,6 @@
 
 namespace autofill::autofill_metrics {
 
-using FieldFillingStatus = AutofillMetrics::FieldFillingStatus;
-
-void FormGroupFillingStats::AddFieldFillingStatus(FieldFillingStatus status) {
-  switch (status) {
-    case FieldFillingStatus::kAccepted:
-      num_accepted++;
-      return;
-    case FieldFillingStatus::kCorrectedToSameType:
-      num_corrected_to_same_type++;
-      return;
-    case FieldFillingStatus::kCorrectedToDifferentType:
-      num_corrected_to_different_type++;
-      return;
-    case FieldFillingStatus::kCorrectedToUnknownType:
-      num_corrected_to_unknown_type++;
-      return;
-    case FieldFillingStatus::kCorrectedToEmpty:
-      num_corrected_to_empty++;
-      return;
-    case FieldFillingStatus::kManuallyFilledToSameType:
-      num_manually_filled_to_same_type++;
-      return;
-    case FieldFillingStatus::kManuallyFilledToDifferentType:
-      num_manually_filled_to_differt_type++;
-      return;
-    case FieldFillingStatus::kManuallyFilledToUnknownType:
-      num_manually_filled_to_unknown_type++;
-      return;
-    case FieldFillingStatus::kLeftEmpty:
-      num_left_empty++;
-      return;
-  }
-  NOTREACHED();
-}
-
-FieldFillingStatus GetFieldFillingStatus(const AutofillField& field) {
-  const bool is_empty = field.IsEmpty();
-  const bool possible_types_empty =
-      !FieldHasMeaningfulPossibleFieldTypes(field);
-  const bool possible_types_contain_type = TypeOfFieldIsPossibleType(field);
-
-  if (field.is_autofilled()) {
-    return FieldFillingStatus::kAccepted;
-  }
-
-  if (field.previously_autofilled()) {
-    if (is_empty)
-      return FieldFillingStatus::kCorrectedToEmpty;
-
-    if (possible_types_contain_type)
-      return FieldFillingStatus::kCorrectedToSameType;
-
-    if (possible_types_empty)
-      return FieldFillingStatus::kCorrectedToUnknownType;
-
-    return FieldFillingStatus::kCorrectedToDifferentType;
-  }
-
-  if (is_empty)
-    return FieldFillingStatus::kLeftEmpty;
-
-  if (possible_types_contain_type)
-    return FieldFillingStatus::kManuallyFilledToSameType;
-
-  if (possible_types_empty)
-    return FieldFillingStatus::kManuallyFilledToUnknownType;
-
-  return FieldFillingStatus::kManuallyFilledToDifferentType;
-}
-
 AutofillProfileSourceCategory GetCategoryOfProfile(
     const AutofillProfile& profile) {
   switch (profile.source()) {
@@ -146,28 +76,4 @@
   }
 }
 
-void MergeFormGroupFillingStats(const FormGroupFillingStats& first,
-                                FormGroupFillingStats& second) {
-  second.num_accepted = first.num_accepted + second.num_accepted;
-  second.num_corrected_to_same_type =
-      first.num_corrected_to_same_type + second.num_corrected_to_same_type;
-  second.num_corrected_to_different_type =
-      first.num_corrected_to_different_type +
-      second.num_corrected_to_different_type;
-  second.num_corrected_to_unknown_type = first.num_corrected_to_unknown_type +
-                                         second.num_corrected_to_unknown_type;
-  second.num_corrected_to_empty =
-      first.num_corrected_to_empty + second.num_corrected_to_empty;
-  second.num_manually_filled_to_same_type =
-      first.num_manually_filled_to_same_type +
-      second.num_manually_filled_to_same_type;
-  second.num_manually_filled_to_differt_type =
-      first.num_manually_filled_to_differt_type +
-      second.num_manually_filled_to_differt_type;
-  second.num_manually_filled_to_unknown_type =
-      first.num_manually_filled_to_unknown_type +
-      second.num_manually_filled_to_unknown_type;
-  second.num_left_empty = first.num_left_empty + second.num_left_empty;
-}
-
 }  // namespace autofill::autofill_metrics
diff --git a/components/autofill/core/browser/metrics/autofill_metrics_utils.h b/components/autofill/core/browser/metrics/autofill_metrics_utils.h
index b49bc0c5..5092f5d 100644
--- a/components/autofill/core/browser/metrics/autofill_metrics_utils.h
+++ b/components/autofill/core/browser/metrics/autofill_metrics_utils.h
@@ -12,52 +12,6 @@
 
 namespace autofill::autofill_metrics {
 
-// Helper struct to count the `FieldFillingStatus` for a form group like
-// addresses and credit cards.
-struct FormGroupFillingStats {
-  // Please have a look at AutofillMetrics::FieldFillingStatus for the meaning
-  // of the different fields.
-  size_t num_accepted = 0;
-  size_t num_corrected_to_same_type = 0;
-  size_t num_corrected_to_different_type = 0;
-  size_t num_corrected_to_unknown_type = 0;
-  size_t num_corrected_to_empty = 0;
-  size_t num_manually_filled_to_same_type = 0;
-  size_t num_manually_filled_to_differt_type = 0;
-  size_t num_manually_filled_to_unknown_type = 0;
-  size_t num_left_empty = 0;
-
-  size_t TotalCorrected() const {
-    return num_corrected_to_same_type + num_corrected_to_different_type +
-           num_corrected_to_unknown_type + num_corrected_to_empty;
-  }
-
-  size_t TotalManuallyFilled() const {
-    return num_manually_filled_to_differt_type +
-           num_manually_filled_to_unknown_type +
-           num_manually_filled_to_same_type;
-  }
-
-  size_t TotalUnfilled() const {
-    return TotalManuallyFilled() + num_left_empty;
-  }
-
-  size_t TotalFilled() const { return num_accepted + TotalCorrected(); }
-
-  size_t Total() const { return TotalFilled() + TotalUnfilled(); }
-
-  void AddFieldFillingStatus(AutofillMetrics::FieldFillingStatus status);
-};
-
-// Returns the filling status of `field`.
-AutofillMetrics::FieldFillingStatus GetFieldFillingStatus(
-    const AutofillField& field);
-
-// Merge `first` into `second` by summing each attribute from
-// `FormGroupFillingStats`.
-void MergeFormGroupFillingStats(const FormGroupFillingStats& first,
-                                FormGroupFillingStats& second);
-
 // kAccount profiles are synced from an external source and have potentially
 // originated from outside of Autofill. In order to determine the added value
 // for Autofill, the `AutofillProfile::Source` is further resolved in some
diff --git a/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.cc b/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.cc
index 89831c9..ea0c948 100644
--- a/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.cc
+++ b/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.cc
@@ -3,13 +3,17 @@
 // found in the LICENSE file.
 
 #include "components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h"
+
 #include "base/containers/flat_map.h"
 #include "base/metrics/histogram_functions.h"
 #include "base/strings/strcat.h"
 #include "components/autofill/core/browser/autofill_granular_filling_utils.h"
+#include "components/autofill/core/browser/field_type_utils.h"
+#include "components/autofill/core/browser/form_structure.h"
 #include "components/autofill/core/browser/form_types.h"
 #include "components/autofill/core/browser/metrics/autofill_metrics_utils.h"
 #include "components/autofill/core/browser/metrics/granular_filling_metrics_utils.h"
+#include "components/autofill/core/common/autofill_features.h"
 
 namespace autofill::autofill_metrics {
 
@@ -58,7 +62,7 @@
   base::UmaHistogramCounts100(
       base::StrCat(
           {histogram_prefix_with_form_type, "ManuallyFilledToDifferentType"}),
-      filling_stats.num_manually_filled_to_differt_type);
+      filling_stats.num_manually_filled_to_different_type);
 
   base::UmaHistogramCounts100(
       base::StrCat(
@@ -200,28 +204,169 @@
 
 }  // namespace
 
-void LogFieldFillingStatsAndScore(
-    const FormGroupFillingStats& address_filling_stats,
-    const FormGroupFillingStats& cc_filling_stats,
-    const FormGroupFillingStats& ac_unrecognized_address_field_stats) {
-  LogFieldFillingStats(FormType::kAddressForm, address_filling_stats);
-  LogFieldFillingStats(FormType::kCreditCardForm, cc_filling_stats);
+void FormGroupFillingStats::AddFieldFillingStatus(FieldFillingStatus status) {
+  switch (status) {
+    case FieldFillingStatus::kAccepted:
+      num_accepted++;
+      return;
+    case FieldFillingStatus::kCorrectedToSameType:
+      num_corrected_to_same_type++;
+      return;
+    case FieldFillingStatus::kCorrectedToDifferentType:
+      num_corrected_to_different_type++;
+      return;
+    case FieldFillingStatus::kCorrectedToUnknownType:
+      num_corrected_to_unknown_type++;
+      return;
+    case FieldFillingStatus::kCorrectedToEmpty:
+      num_corrected_to_empty++;
+      return;
+    case FieldFillingStatus::kManuallyFilledToSameType:
+      num_manually_filled_to_same_type++;
+      return;
+    case FieldFillingStatus::kManuallyFilledToDifferentType:
+      num_manually_filled_to_different_type++;
+      return;
+    case FieldFillingStatus::kManuallyFilledToUnknownType:
+      num_manually_filled_to_unknown_type++;
+      return;
+    case FieldFillingStatus::kLeftEmpty:
+      num_left_empty++;
+      return;
+  }
+  NOTREACHED();
+}
+
+FieldFillingStatus GetFieldFillingStatus(const AutofillField& field) {
+  const bool is_empty = field.IsEmpty();
+  const bool possible_types_empty =
+      !FieldHasMeaningfulPossibleFieldTypes(field);
+  const bool possible_types_contain_type = TypeOfFieldIsPossibleType(field);
+  if (field.is_autofilled()) {
+    return FieldFillingStatus::kAccepted;
+  }
+  if (field.previously_autofilled()) {
+    if (is_empty) {
+      return FieldFillingStatus::kCorrectedToEmpty;
+    }
+    if (possible_types_contain_type) {
+      return FieldFillingStatus::kCorrectedToSameType;
+    }
+    if (possible_types_empty) {
+      return FieldFillingStatus::kCorrectedToUnknownType;
+    }
+    return FieldFillingStatus::kCorrectedToDifferentType;
+  }
+  if (is_empty) {
+    return FieldFillingStatus::kLeftEmpty;
+  }
+  if (possible_types_contain_type) {
+    return FieldFillingStatus::kManuallyFilledToSameType;
+  }
+  if (possible_types_empty) {
+    return FieldFillingStatus::kManuallyFilledToUnknownType;
+  }
+  return FieldFillingStatus::kManuallyFilledToDifferentType;
+}
+
+void MergeFormGroupFillingStats(const FormGroupFillingStats& first,
+                                FormGroupFillingStats& second) {
+  second.num_accepted = first.num_accepted + second.num_accepted;
+  second.num_corrected_to_same_type =
+      first.num_corrected_to_same_type + second.num_corrected_to_same_type;
+  second.num_corrected_to_different_type =
+      first.num_corrected_to_different_type +
+      second.num_corrected_to_different_type;
+  second.num_corrected_to_unknown_type = first.num_corrected_to_unknown_type +
+                                         second.num_corrected_to_unknown_type;
+  second.num_corrected_to_empty =
+      first.num_corrected_to_empty + second.num_corrected_to_empty;
+  second.num_manually_filled_to_same_type =
+      first.num_manually_filled_to_same_type +
+      second.num_manually_filled_to_same_type;
+  second.num_manually_filled_to_different_type =
+      first.num_manually_filled_to_different_type +
+      second.num_manually_filled_to_different_type;
+  second.num_manually_filled_to_unknown_type =
+      first.num_manually_filled_to_unknown_type +
+      second.num_manually_filled_to_unknown_type;
+  second.num_left_empty = first.num_left_empty + second.num_left_empty;
+}
+
+autofill_metrics::FormGroupFillingStats GetFormFillingStatsForFormType(
+    FormType form_type,
+    const FormStructure& form_structure) {
+  autofill_metrics::FormGroupFillingStats filling_stats_for_form_type;
+
+  for (auto& field : form_structure) {
+    if (FieldTypeGroupToFormType(field->Type().group()) != form_type) {
+      continue;
+    }
+    filling_stats_for_form_type.AddFieldFillingStatus(
+        autofill_metrics::GetFieldFillingStatus(*field));
+  }
+  return filling_stats_for_form_type;
+}
+
+void LogFieldFillingStatsAndScore(const FormStructure& form) {
+  // Tracks how many fields are filled, unfilled or corrected.
+  autofill_metrics::FormGroupFillingStats address_field_stats;
+  autofill_metrics::FormGroupFillingStats cc_field_stats;
+  autofill_metrics::FormGroupFillingStats ac_unrecognized_address_field_stats;
+  // Same as above, but keyed by `FillingMethod`.
+  base::flat_map<FillingMethod, autofill_metrics::FormGroupFillingStats>
+      address_field_stats_by_filling_method;
+  for (const std::unique_ptr<AutofillField>& field : form) {
+    // For any field that belongs to either an address or a credit card form,
+    // collect the type-unspecific field filling statistics.
+    // Those are only emitted when autofill was used on at least one field of
+    // the form.
+    const FormType form_type_of_field =
+        FieldTypeGroupToFormType(field->Type().group());
+    const bool is_address_form_field =
+        form_type_of_field == FormType::kAddressForm;
+    const bool credit_card_form_field =
+        form_type_of_field == FormType::kCreditCardForm;
+    if (!is_address_form_field && !credit_card_form_field) {
+      continue;
+    }
+    // Address and credit cards fields are mutually exclusive.
+    autofill_metrics::FormGroupFillingStats& group_stats =
+        is_address_form_field ? address_field_stats : cc_field_stats;
+    // Get the filling status of this field and add it to the form group
+    // counter.
+    group_stats.AddFieldFillingStatus(
+        autofill_metrics::GetFieldFillingStatus(*field));
+    if (is_address_form_field &&
+        field->ShouldSuppressSuggestionsAndFillingByDefault()) {
+      ac_unrecognized_address_field_stats.AddFieldFillingStatus(
+          autofill_metrics::GetFieldFillingStatus(*field));
+    }
+    // For address forms we want to emit filling stats metrics per
+    // `FillingMethod`. Therefore, the stats generated are added to
+    // a map keyed by `FillingMethod`, so that later, metrics can
+    // emitted for each method used.
+    if (base::FeatureList::IsEnabled(
+            features::kAutofillGranularFillingAvailable) &
+        is_address_form_field) {
+      AddFillingStatsForFillingMethod(*field,
+                                      address_field_stats_by_filling_method);
+    }
+  }
+  LogFieldFillingStats(FormType::kAddressForm, address_field_stats);
+  LogFieldFillingStats(FormType::kCreditCardForm, cc_field_stats);
   LogAutocompleteUnrecognizedFieldFillingStats(
       FormType::kCreditCardForm, ac_unrecognized_address_field_stats);
 
-  LogFormFillingScore(FormType::kAddressForm, address_filling_stats);
-  LogFormFillingScore(FormType::kCreditCardForm, cc_filling_stats);
+  LogFormFillingScore(FormType::kAddressForm, address_field_stats);
+  LogFormFillingScore(FormType::kCreditCardForm, cc_field_stats);
 
-  LogFormFillingComplexScore(FormType::kAddressForm, address_filling_stats);
-  LogFormFillingComplexScore(FormType::kCreditCardForm, cc_filling_stats);
-}
+  LogFormFillingComplexScore(FormType::kAddressForm, address_field_stats);
+  LogFormFillingComplexScore(FormType::kCreditCardForm, cc_field_stats);
 
-void LogAddressFieldFillingStatsAndScoreByFillingMethod(
-    const base::flat_map<FillingMethod,
-                         autofill_metrics::FormGroupFillingStats>&
-        address_filling_stats_by_filling_method) {
+  // TODO(crbug.com/40274514): Remove these metrics on cleanup.
   autofill_metrics::FormGroupFillingStats any;
-  for (const auto& filling_stats : address_filling_stats_by_filling_method) {
+  for (const auto& filling_stats : address_field_stats_by_filling_method) {
     LogAddressFieldFillingStatsForFillingMethod(filling_stats.first,
                                                 filling_stats.second);
     MergeFormGroupFillingStats(filling_stats.second, any);
diff --git a/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h b/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h
index a59f732..8fe1d0b 100644
--- a/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h
+++ b/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h
@@ -10,6 +10,87 @@
 
 namespace autofill::autofill_metrics {
 
+// The filling status of an autofilled field.
+// These values are persisted to logs. Entries should not be renumbered and
+// numeric values should never be reused.
+enum class FieldFillingStatus {
+  // The field was filled and accepted.
+  kAccepted = 0,
+  // The field was filled and corrected to a value of the same type.
+  kCorrectedToSameType = 1,
+  // The field was filled and corrected to a value of a different type.
+  kCorrectedToDifferentType = 2,
+  // The field was filled and corrected to a value of an unknown type.
+  kCorrectedToUnknownType = 3,
+  // The field was filled and the value was cleared afterwards.
+  kCorrectedToEmpty = 4,
+  // The field was manually filled to a value of the same type as the
+  // field was predicted to.
+  kManuallyFilledToSameType = 5,
+  // The field was manually filled to a value of a different type as the field
+  // was predicted to.
+  kManuallyFilledToDifferentType = 6,
+  // The field was manually filled to a value of an unknown type.
+  kManuallyFilledToUnknownType = 7,
+  // The field was left empty.
+  kLeftEmpty = 8,
+  kMaxValue = kLeftEmpty
+};
+
+// Helper struct to count the `FieldFillingStatus` for a form group like
+// addresses and credit cards.
+struct FormGroupFillingStats {
+  // Please have a look at AutofillMetrics::FieldFillingStatus for the meaning
+  // of the different fields.
+  size_t num_accepted = 0;
+  size_t num_corrected_to_same_type = 0;
+  size_t num_corrected_to_different_type = 0;
+  size_t num_corrected_to_unknown_type = 0;
+  size_t num_corrected_to_empty = 0;
+  size_t num_manually_filled_to_same_type = 0;
+  size_t num_manually_filled_to_different_type = 0;
+  size_t num_manually_filled_to_unknown_type = 0;
+  size_t num_left_empty = 0;
+
+  size_t TotalCorrected() const {
+    return num_corrected_to_same_type + num_corrected_to_different_type +
+           num_corrected_to_unknown_type + num_corrected_to_empty;
+  }
+
+  size_t TotalManuallyFilled() const {
+    return num_manually_filled_to_different_type +
+           num_manually_filled_to_unknown_type +
+           num_manually_filled_to_same_type;
+  }
+
+  size_t TotalUnfilled() const {
+    return TotalManuallyFilled() + num_left_empty;
+  }
+
+  size_t TotalFilled() const { return num_accepted + TotalCorrected(); }
+
+  size_t Total() const { return TotalFilled() + TotalUnfilled(); }
+
+  void AddFieldFillingStatus(FieldFillingStatus status);
+};
+
+// Returns the filling status of `field`.
+FieldFillingStatus GetFieldFillingStatus(const AutofillField& field);
+
+// Merge `first` into `second` by summing each attribute from
+// `FormGroupFillingStats`.
+// TODO(crbug.com/40274514): Remove this on cleanup.
+void MergeFormGroupFillingStats(const FormGroupFillingStats& first,
+                                FormGroupFillingStats& second);
+
+// Returns the `FormGroupFillingStats` corresponding to the fields in
+// `form_structure` that match `form_type`. This method does not log to UMA but
+// only returns the statistics of a submitted form. `FormGroupFillingStats` is
+// UMA logged in `LogQualityMetrics()`.
+autofill_metrics::FormGroupFillingStats GetFormFillingStatsForFormType(
+    FormType form_type,
+    const FormStructure& form_structure);
+
 enum class FieldFillingStat {
   kAccepted = 0,
   kCorrected = 1,
@@ -22,16 +103,7 @@
 // `filling_stats` of ac=unrecognized fields. The filling status
 // consistent of the number of accepted, corrected or and unfilled fields. See
 // the .cc file for details.
-void LogFieldFillingStatsAndScore(
-    const FormGroupFillingStats& address_filling_stats,
-    const FormGroupFillingStats& cc_filling_stats,
-    const FormGroupFillingStats& ac_unrecognized_address_field_stats);
-
-// Same as above but keyed by `FillingMethod`.
-void LogAddressFieldFillingStatsAndScoreByFillingMethod(
-    const base::flat_map<FillingMethod,
-                         autofill_metrics::FormGroupFillingStats>&
-        address_filling_stats_by_filling_method);
+void LogFieldFillingStatsAndScore(const FormStructure& form);
 
 }  // namespace autofill::autofill_metrics
 
diff --git a/components/autofill/core/browser/metrics/granular_filling_metrics_utils.h b/components/autofill/core/browser/metrics/granular_filling_metrics_utils.h
index 298382c..843dd4b 100644
--- a/components/autofill/core/browser/metrics/granular_filling_metrics_utils.h
+++ b/components/autofill/core/browser/metrics/granular_filling_metrics_utils.h
@@ -9,7 +9,7 @@
 
 #include "base/containers/flat_map.h"
 #include "components/autofill/core/browser/autofill_granular_filling_utils.h"
-#include "components/autofill/core/browser/metrics/autofill_metrics_utils.h"
+#include "components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h"
 
 // Helper methods specific for granular filling metrics.
 namespace autofill {
@@ -24,6 +24,7 @@
 
 // Computes and adds the `FillingStats` of `field` to the correct key
 // (`FillingMethod`) in `field_stats_by_filling_method`.
+// TODO(crbug.com/40274514): Remove this on cleanup.
 void AddFillingStatsForFillingMethod(
     const AutofillField& field,
     base::flat_map<FillingMethod, FormGroupFillingStats>&
diff --git a/components/autofill/core/browser/metrics/quality_metrics.cc b/components/autofill/core/browser/metrics/quality_metrics.cc
index b8d39fb2..41ec97e 100644
--- a/components/autofill/core/browser/metrics/quality_metrics.cc
+++ b/components/autofill/core/browser/metrics/quality_metrics.cc
@@ -5,6 +5,7 @@
 #include "components/autofill/core/browser/metrics/quality_metrics.h"
 
 #include <memory>
+#include <utility>
 
 #include "base/containers/contains.h"
 #include "base/containers/flat_map.h"
@@ -13,6 +14,7 @@
 #include "components/autofill/core/browser/autofill_field.h"
 #include "components/autofill/core/browser/field_type_utils.h"
 #include "components/autofill/core/browser/field_types.h"
+#include "components/autofill/core/browser/filling_product.h"
 #include "components/autofill/core/browser/form_structure.h"
 #include "components/autofill/core/browser/metrics/autofill_metrics_utils.h"
 #include "components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h"
@@ -57,33 +59,39 @@
 }
 
 void LogPerfectFillingMetric(const FormStructure& form) {
-  bool form_has_autofilled_fields = base::ranges::any_of(
-      form, [](const auto& field) { return field->is_autofilled(); });
-  bool form_has_previously_autofilled_fields = base::ranges::any_of(
-      form, [](const auto& field) { return field->previously_autofilled(); });
+  // Denotes whether for a given FillingProduct, the form has a field which was
+  // last filled with this product (and maybe user/JS edited afterwards).
+  const base::flat_map<FillingProduct, bool> filling_product_was_used =
+      base::MakeFlatMap<FillingProduct, bool>(
+          std::vector<FillingProduct>{FillingProduct::kAddress,
+                                      FillingProduct::kCreditCard},
+          {}, [&form](FillingProduct filling_product) {
+            return std::make_pair(
+                filling_product,
+                base::ranges::any_of(
+                    form, [&filling_product](const auto& field) {
+                      return field->filling_product() == filling_product;
+                    }));
+          });
+  // A perfectly filled form is submitted as it was filled from Autofill
+  // without subsequent changes. This means that in a perfect filling
+  // scenario, a field is either autofilled, empty, has value at page load or
+  // has value set by JS.
+  const bool perfect_filling =
+      base::ranges::none_of(form, [](const auto& field) {
+        return field->is_user_edited() && !field->is_autofilled();
+      });
   // The perfect filling metric is only recorded if Autofill was used on at
   // least one field. This conditions this metric on Assistance, Readiness and
-  // Acceptance.
-  if (form_has_autofilled_fields || form_has_previously_autofilled_fields) {
-    // A perfectly filled form is submitted as it was filled from Autofill
-    // without subsequent changes. This means that in a perfect filling
-    // scenario, a field is either autofilled, empty, has value at page load or
-    // has value set by JS.
-    bool perfect_filling = base::ranges::none_of(form, [](const auto& field) {
-      return field->is_user_edited() && !field->is_autofilled();
-    });
-    // Perfect filling is recorded for addresses and credit cards separately.
-    // Note that a form can be both an address and a credit card form
-    // simultaneously.
-    DenseSet<FormType> form_types = form.GetFormTypes();
-    if (base::Contains(form_types, FormType::kAddressForm)) {
-      AutofillMetrics::LogAutofillPerfectFilling(/*is_address=*/true,
-                                                 perfect_filling);
-    }
-    if (base::Contains(form_types, FormType::kCreditCardForm)) {
-      AutofillMetrics::LogAutofillPerfectFilling(/*is_address=*/false,
-                                                 perfect_filling);
-    }
+  // Acceptance. Perfect filling is recorded for addresses and credit cards
+  // separately.
+  if (filling_product_was_used.at(FillingProduct::kAddress)) {
+    AutofillMetrics::LogAutofillPerfectFilling(/*is_address=*/true,
+                                               perfect_filling);
+  }
+  if (filling_product_was_used.at(FillingProduct::kCreditCard)) {
+    AutofillMetrics::LogAutofillPerfectFilling(/*is_address=*/false,
+                                               perfect_filling);
   }
 }
 
@@ -111,61 +119,6 @@
   }
 }
 
-void LogFieldFillingStatsAndScoreMetrics(const FormStructure& form) {
-  // Tracks how many fields are filled, unfilled or corrected.
-  autofill_metrics::FormGroupFillingStats address_field_stats;
-  autofill_metrics::FormGroupFillingStats cc_field_stats;
-  autofill_metrics::FormGroupFillingStats ac_unrecognized_address_field_stats;
-  // Same as above, but keyed by `FillingMethod`.
-  base::flat_map<FillingMethod, autofill_metrics::FormGroupFillingStats>
-      address_field_stats_by_filling_method;
-  for (const std::unique_ptr<AutofillField>& field : form) {
-    // For any field that belongs to either an address or a credit card form,
-    // collect the type-unspecific field filling statistics.
-    // Those are only emitted when autofill was used on at least one field of
-    // the form.
-    const FormType form_type_of_field =
-        FieldTypeGroupToFormType(field->Type().group());
-    const bool is_address_form_field =
-        form_type_of_field == FormType::kAddressForm;
-    const bool credit_card_form_field =
-        form_type_of_field == FormType::kCreditCardForm;
-    if (!is_address_form_field && !credit_card_form_field) {
-      continue;
-    }
-    // Address and credit cards fields are mutually exclusive.
-    autofill_metrics::FormGroupFillingStats& group_stats =
-        is_address_form_field ? address_field_stats : cc_field_stats;
-    // Get the filling status of this field and add it to the form group
-    // counter.
-    group_stats.AddFieldFillingStatus(
-        autofill_metrics::GetFieldFillingStatus(*field));
-    if (is_address_form_field &&
-        field->ShouldSuppressSuggestionsAndFillingByDefault()) {
-      ac_unrecognized_address_field_stats.AddFieldFillingStatus(
-          autofill_metrics::GetFieldFillingStatus(*field));
-    }
-    // For address forms we want to emit filling stats metrics per
-    // `FillingMethod`. Therefore, the stats generated are added to
-    // a map keyed by `FillingMethod`, so that later, metrics can
-    // emitted for each method used.
-    if (base::FeatureList::IsEnabled(
-            features::kAutofillGranularFillingAvailable) &
-        is_address_form_field) {
-      AddFillingStatsForFillingMethod(*field,
-                                      address_field_stats_by_filling_method);
-    }
-  }
-  // Log the field filling statistics if autofill was used.
-  // The metrics are only emitted if there was at least one field in the
-  // corresponding form group that is or was filled by autofill.
-  // TODO(crbug.com/40274514): Remove this metric on cleanup.
-  autofill_metrics::LogFieldFillingStatsAndScore(
-      address_field_stats, cc_field_stats, ac_unrecognized_address_field_stats);
-  LogAddressFieldFillingStatsAndScoreByFillingMethod(
-      address_field_stats_by_filling_method);
-}
-
 // Logs metrics related to how long it took the user from load/interaction time
 // till form submission.
 void LogDurationMetrics(const FormStructure& form,
@@ -265,7 +218,7 @@
   }
   LogPerfectFillingMetric(form);
   LogPreFillMetrics(form);
-  LogFieldFillingStatsAndScoreMetrics(form);
+  autofill_metrics::LogFieldFillingStatsAndScore(form);
 
   FieldTypeSet autofilled_field_types;
   for (const std::unique_ptr<AutofillField>& field : form) {
@@ -327,19 +280,4 @@
   }
 }
 
-autofill_metrics::FormGroupFillingStats GetFormFillingStatsForFormType(
-    FormType form_type,
-    const FormStructure& form_structure) {
-  autofill_metrics::FormGroupFillingStats filling_stats_for_form_type;
-
-  for (auto& field : form_structure) {
-    if (FieldTypeGroupToFormType(field->Type().group()) != form_type) {
-      continue;
-    }
-    filling_stats_for_form_type.AddFieldFillingStatus(
-        autofill_metrics::GetFieldFillingStatus(*field));
-  }
-  return filling_stats_for_form_type;
-}
-
 }  // namespace autofill::autofill_metrics
diff --git a/components/autofill/core/browser/metrics/quality_metrics.h b/components/autofill/core/browser/metrics/quality_metrics.h
index e49045c..bc0cab2c 100644
--- a/components/autofill/core/browser/metrics/quality_metrics.h
+++ b/components/autofill/core/browser/metrics/quality_metrics.h
@@ -20,8 +20,6 @@
 // `observed_submission` indicates whether this method is called as a result of
 // observing a submission event (otherwise, it may be that an upload was
 // triggered after a form was unfocused or a navigation occurred).
-// TODO(crbug.com/40100455): More than quality metrics are logged. Consider
-// renaming or splitting the function.
 void LogQualityMetrics(
     const FormStructure& form_structure,
     const base::TimeTicks& load_time,
@@ -37,14 +35,6 @@
     const FormStructure& form_structure,
     AutofillMetrics::FormInteractionsUkmLogger* form_interactions_ukm_logger);
 
-// Returns the `FormGroupFillingStats` corresponding to the fields in
-// `form_structure` that match `form_type`. This method does not log to UMA but
-// only returns the statistics of a submitted form. `FormGroupFillingStats` is
-// UMA logged in `LogQualityMetrics()`.
-autofill_metrics::FormGroupFillingStats GetFormFillingStatsForFormType(
-    FormType form_type,
-    const FormStructure& form_structure);
-
 }  // namespace autofill::autofill_metrics
 
 #endif  // COMPONENTS_AUTOFILL_CORE_BROWSER_METRICS_QUALITY_METRICS_H_
diff --git a/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc b/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc
index e14566b..4b04625 100644
--- a/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc
+++ b/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc
@@ -241,7 +241,8 @@
                                     ? CreditCard::RecordType::kMaskedServerCard
                                     : CreditCard::RecordType::kFullServerCard);
     server_card.set_server_id(server_id);
-    personal_data().AddServerCreditCard(server_card);
+    personal_data().test_payments_data_manager().AddServerCreditCard(
+        server_card);
     return personal_data().payments_data_manager().GetCreditCardByGUID(guid);
   }
 
@@ -745,7 +746,8 @@
        MandatoryReauth_FetchLocalCard) {
   base::HistogramTester histogram_tester;
   CreateLocalCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   card->set_cvc(kTestCvc16);
 
   credit_card_access_manager().PrepareToFetchCreditCard();
@@ -815,7 +817,8 @@
        MandatoryReauth_FetchVirtualCard) {
   base::HistogramTester histogram_tester;
   CreateServerCard(kTestGUID, kTestNumber, /*masked=*/false, kTestServerId);
-  CreditCard* virtual_card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* virtual_card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   virtual_card->set_record_type(CreditCard::RecordType::kVirtualCard);
 
   credit_card_access_manager().FetchCreditCard(
@@ -904,7 +907,7 @@
   base::HistogramTester histogram_tester;
   CreateServerCard(kTestGUID, test_number, /*masked=*/true, kTestServerId);
   CreditCard* masked_server_card =
-      personal_data().GetCreditCardByGUID(kTestGUID);
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
 
   credit_card_access_manager().FetchCreditCard(
       masked_server_card, base::BindOnce(&TestAccessor::OnCreditCardFetched,
@@ -1021,7 +1024,8 @@
        MandatoryReauth_FetchLocalCard_CvcFillWorksCorrectly) {
   base::HistogramTester histogram_tester;
   CreateLocalCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
 
   credit_card_access_manager().PrepareToFetchCreditCard();
   WaitForCallbacks();
@@ -1047,7 +1051,8 @@
        MandatoryReauth_FetchLocalCard_NoCvcFillWorksCorrectly) {
   base::HistogramTester histogram_tester;
   CreateLocalCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   card->set_cvc(u"");
 
   credit_card_access_manager().PrepareToFetchCreditCard();
@@ -1074,7 +1079,7 @@
   std::string test_number = "4444333322221111";
   CreateServerCard(kTestGUID, test_number, /*masked=*/true, kTestServerId);
   CreditCard* masked_server_card =
-      personal_data().GetCreditCardByGUID(kTestGUID);
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
 
   credit_card_access_manager().PrepareToFetchCreditCard();
   WaitForCallbacks();
@@ -1109,7 +1114,7 @@
   std::string test_number = "4444333322221111";
   CreateServerCard(kTestGUID, test_number, /*masked=*/true, kTestServerId);
   CreditCard* masked_server_card =
-      personal_data().GetCreditCardByGUID(kTestGUID);
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   masked_server_card->set_cvc(u"");
 
   credit_card_access_manager().PrepareToFetchCreditCard();
@@ -1407,7 +1412,8 @@
       "Autofill.BetterAuth.FlowEvents.Fido";
 
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
   payments_network_interface().AddFidoEligibleCard(
@@ -1458,9 +1464,10 @@
   base::HistogramTester histogram_tester;
 
   CreditCard server_card = test::WithCvc(test::GetMaskedServerCard());
-  personal_data().AddServerCreditCard(server_card);
+  personal_data().test_payments_data_manager().AddServerCreditCard(server_card);
   CreditCard* card =
-      personal_data().GetCreditCardByInstrumentId(server_card.instrument_id());
+      personal_data().payments_data_manager().GetCreditCardByInstrumentId(
+          server_card.instrument_id());
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
   payments_network_interface().AddFidoEligibleCard(
@@ -1492,9 +1499,10 @@
 
   CreditCard server_card = test::GetMaskedServerCard();
   server_card.set_cvc(u"");
-  personal_data().AddServerCreditCard(server_card);
+  personal_data().test_payments_data_manager().AddServerCreditCard(server_card);
   CreditCard* card =
-      personal_data().GetCreditCardByInstrumentId(server_card.instrument_id());
+      personal_data().payments_data_manager().GetCreditCardByInstrumentId(
+          server_card.instrument_id());
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
   payments_network_interface().AddFidoEligibleCard(
@@ -1525,8 +1533,10 @@
        LogCvcFillingWithoutInteractiveAuthentication) {
   base::HistogramTester histogram_tester;
   CreditCard local_card = test::WithCvc(test::GetCreditCard());
-  personal_data().AddCreditCard(local_card);
-  CreditCard* card = personal_data().GetCreditCardByGUID(local_card.guid());
+  personal_data().payments_data_manager().AddCreditCard(local_card);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(
+          local_card.guid());
 
   credit_card_access_manager().PrepareToFetchCreditCard();
   WaitForCallbacks();
@@ -1546,8 +1556,10 @@
        DoNotLogCvcFillingWithoutInteractiveAuthentication) {
   base::HistogramTester histogram_tester;
   CreditCard local_card = test::GetCreditCard();
-  personal_data().AddCreditCard(local_card);
-  CreditCard* card = personal_data().GetCreditCardByGUID(local_card.guid());
+  personal_data().payments_data_manager().AddCreditCard(local_card);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(
+          local_card.guid());
 
   credit_card_access_manager().PrepareToFetchCreditCard();
   WaitForCallbacks();
@@ -1571,8 +1583,9 @@
                           "1", u"");
   server_card.set_guid(kTestGUID);
   server_card.set_record_type(CreditCard::RecordType::kMaskedServerCard);
-  personal_data().AddServerCreditCard(server_card);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  personal_data().test_payments_data_manager().AddServerCreditCard(server_card);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
   payments_network_interface().AddFidoEligibleCard(
@@ -1604,7 +1617,8 @@
 
   // General setup.
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   payments_network_interface().AddFidoEligibleCard(
       card->server_id(), kCredentialId, kGooglePaymentsRpid);
@@ -1643,7 +1657,8 @@
       "Autofill.BetterAuth.FlowEvents.CvcFallbackFromFido";
 
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
   payments_network_interface().AddFidoEligibleCard(
@@ -1703,7 +1718,8 @@
       "Autofill.BetterAuth.WebauthnResult.ImmediateAuthentication";
 
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
   payments_network_interface().AddFidoEligibleCard(
@@ -1748,7 +1764,8 @@
 TEST_F(CreditCardAccessManagerTest,
        FetchServerCardBadRequestOptionsCVCFallback) {
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
   // Don't set Credential ID.
@@ -1780,7 +1797,8 @@
 // Payments times out.
 TEST_F(CreditCardAccessManagerTest, FetchServerCardFIDOTimeoutCVCFallback) {
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
 
@@ -1806,8 +1824,10 @@
   std::string local_guid = "00000000-0000-0000-0000-000000000003";
   CreateServerCard(server_guid, "4594299181086168");
   CreateLocalCard(local_guid, "4409763681177079");
-  CreditCard* server_card = personal_data().GetCreditCardByGUID(server_guid);
-  CreditCard* local_card = personal_data().GetCreditCardByGUID(local_guid);
+  CreditCard* server_card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(server_guid);
+  CreditCard* local_card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(local_guid);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
 
   for (bool user_is_opted_in : {true, false}) {
@@ -1894,7 +1914,8 @@
   // Setting up a FIDO-enabled user with a local card and a server card.
   std::string server_guid = "00000000-0000-0000-0000-000000000001";
   CreateServerCard(server_guid, "4594299181086168");
-  CreditCard* server_card = personal_data().GetCreditCardByGUID(server_guid);
+  CreditCard* server_card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(server_guid);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
   payments_network_interface().ShouldReturnUnmaskDetailsImmediately(false);
@@ -1971,7 +1992,8 @@
       "Autofill.BetterAuth.FlowEvents.CvcThenFido";
 
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   OptUserInToFido();
 
   credit_card_access_manager().PrepareToFetchCreditCard();
@@ -2025,7 +2047,8 @@
   // Creating an expired server card and opting the user in with authorized
   // card.
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   card->SetExpirationYearFromString(u"2010");
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
@@ -2056,7 +2079,8 @@
       "Autofill.BetterAuth.WebauthnResult.CheckoutOptIn";
 
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(false);
 
@@ -2110,7 +2134,8 @@
       "Autofill.BetterAuth.WebauthnResult.CheckoutOptIn";
 
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(false);
 
@@ -2153,7 +2178,8 @@
 // Ensures that enrollment does not happen if the server returns a failure.
 TEST_F(CreditCardAccessManagerTest, FIDOOptInServerFailure) {
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(false);
 
@@ -2193,7 +2219,8 @@
 // checkbox.
 TEST_F(CreditCardAccessManagerTest, FIDOOptIn_CheckboxDeclined) {
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(false);
 
@@ -2223,7 +2250,8 @@
 // opt-in request the next time the user downstreams a card.
 TEST_F(CreditCardAccessManagerTest, FIDOSettingsPageOptInSuccess_Android) {
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
 
   // Setting the local opt-in state as true and implying that Payments servers
@@ -2268,7 +2296,8 @@
 
   ClearStrikes();
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(false);
   payments_network_interface().AllowFidoRegistration(true);
@@ -2329,7 +2358,8 @@
 
   ClearStrikes();
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(false);
   payments_network_interface().AllowFidoRegistration(true);
@@ -2368,7 +2398,8 @@
 
   ClearStrikes();
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(false);
   payments_network_interface().AllowFidoRegistration(true);
@@ -2408,7 +2439,8 @@
 
   ClearStrikes();
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(false);
   payments_network_interface().AllowFidoRegistration(true);
@@ -2457,7 +2489,8 @@
       "Autofill.BetterAuth.OptInCalled.FromCheckoutFlow";
 
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(false);
   payments_network_interface().AllowFidoRegistration(true);
@@ -2645,7 +2678,8 @@
   }
 
   CreditCard* GetCreditCard() {
-    return personal_data().GetCreditCardByGUID(kTestGUID);
+    return personal_data().payments_data_manager().GetCreditCardByGUID(
+        kTestGUID);
   }
 
  private:
@@ -2770,7 +2804,8 @@
   base::HistogramTester histogram_tester;
   // Setting up a FIDO-enabled user with a server card.
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   // The user is FIDO-enabled from Payments.
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
@@ -2817,7 +2852,8 @@
 TEST_F(CreditCardAccessManagerTest, IntentToOptOut_OptOutAfterUnmaskSucceeds) {
   // Setting up a FIDO-enabled user with a server card.
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   // The user is FIDO-enabled from Payments.
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
@@ -2855,7 +2891,8 @@
 TEST_F(CreditCardAccessManagerTest, IntentToOptOut_OptOutAfterUnmaskFails) {
   // Setting up a FIDO-enabled user with a server card.
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   // The user is FIDO-enabled from Payments.
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
@@ -2892,7 +2929,8 @@
 TEST_F(CreditCardAccessManagerTest, IntentToOptOut_OptOutFailure) {
   // Setting up a FIDO-enabled user with a server card.
   CreateServerCard(kTestGUID, kTestNumber);
-  CreditCard* card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   // The user is FIDO-enabled from Payments.
   GetFIDOAuthenticator()->SetUserVerifiable(true);
   SetCreditCardFIDOAuthEnabled(true);
@@ -4029,7 +4067,8 @@
        RiskBasedVirtualCardUnmasking_AuthenticationRequired_FidoOnly) {
   base::HistogramTester histogram_tester;
   CreateServerCard(kTestGUID, kTestNumber, /*masked=*/false, kTestServerId);
-  CreditCard* virtual_card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* virtual_card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   virtual_card->set_record_type(CreditCard::RecordType::kVirtualCard);
   // TODO(crbug.com/40197696): Switch to SetUserVerifiable after moving all
   // is_user_veriable_ related logic from CreditCardAccessManager to
@@ -4089,7 +4128,8 @@
     RiskBasedVirtualCardUnmasking_AuthenticationRequired_FidoAndOtp_PrefersFido) {
   base::HistogramTester histogram_tester;
   CreateServerCard(kTestGUID, kTestNumber, /*masked=*/false, kTestServerId);
-  CreditCard* virtual_card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* virtual_card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   virtual_card->set_record_type(CreditCard::RecordType::kVirtualCard);
   // TODO(crbug.com/40197696): Switch to SetUserVerifiable after moving all
   // is_user_veriable_ related logic from CreditCardAccessManager to
@@ -4213,7 +4253,8 @@
     RiskBasedVirtualCardUnmasking_AuthenticationRequired_FidoOnly_FidoNotOptedIn) {
   base::HistogramTester histogram_tester;
   CreateServerCard(kTestGUID, kTestNumber, /*masked=*/false, kTestServerId);
-  CreditCard* virtual_card = personal_data().GetCreditCardByGUID(kTestGUID);
+  CreditCard* virtual_card =
+      personal_data().payments_data_manager().GetCreditCardByGUID(kTestGUID);
   virtual_card->set_record_type(CreditCard::RecordType::kVirtualCard);
   // TODO(crbug.com/40197696): Switch to SetUserVerifiable after moving all
   // is_user_veriable_ related logic from CreditCardAccessManager to
diff --git a/components/autofill/core/browser/payments/credit_card_fido_authenticator_unittest.cc b/components/autofill/core/browser/payments/credit_card_fido_authenticator_unittest.cc
index dcb2357..717430b1 100644
--- a/components/autofill/core/browser/payments/credit_card_fido_authenticator_unittest.cc
+++ b/components/autofill/core/browser/payments/credit_card_fido_authenticator_unittest.cc
@@ -33,6 +33,7 @@
 #include "components/autofill/core/browser/data_model/credit_card.h"
 #include "components/autofill/core/browser/metrics/form_events/form_events.h"
 #include "components/autofill/core/browser/metrics/payments/better_auth_metrics.h"
+#include "components/autofill/core/browser/payments/payments_service_url.h"
 #include "components/autofill/core/browser/payments/test_authentication_requester.h"
 #include "components/autofill/core/browser/payments/test_credit_card_fido_authenticator.h"
 #include "components/autofill/core/browser/payments/test_internal_authenticator.h"
@@ -41,6 +42,7 @@
 #include "components/autofill/core/browser/test_autofill_client.h"
 #include "components/autofill/core/browser/test_autofill_clock.h"
 #include "components/autofill/core/browser/test_autofill_driver.h"
+#include "components/autofill/core/browser/test_payments_data_manager.h"
 #include "components/autofill/core/browser/test_personal_data_manager.h"
 #include "components/autofill/core/browser/validation.h"
 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
@@ -66,8 +68,6 @@
 #include "ui/gfx/geometry/rect.h"
 #include "url/gurl.h"
 
-#include "components/autofill/core/browser/payments/payments_service_url.h"
-
 namespace autofill {
 namespace {
 
@@ -123,7 +123,8 @@
         CreditCard::RecordType::kMaskedServerCard);
 
     personal_data_manager().test_payments_data_manager().ClearCreditCards();
-    personal_data_manager().AddServerCreditCard(masked_server_card);
+    personal_data_manager().test_payments_data_manager().AddServerCreditCard(
+        masked_server_card);
 
     return masked_server_card;
   }
diff --git a/components/autofill/core/browser/payments/mandatory_reauth_manager_unittest.cc b/components/autofill/core/browser/payments/mandatory_reauth_manager_unittest.cc
index 66ec54f..d548ed2 100644
--- a/components/autofill/core/browser/payments/mandatory_reauth_manager_unittest.cc
+++ b/components/autofill/core/browser/payments/mandatory_reauth_manager_unittest.cc
@@ -3,13 +3,14 @@
 // found in the LICENSE file.
 
 #include "components/autofill/core/browser/payments/mandatory_reauth_manager.h"
-#include "base/strings/utf_string_conversions.h"
 
 #include "base/memory/scoped_refptr.h"
+#include "base/strings/utf_string_conversions.h"
 #include "base/test/metrics/histogram_tester.h"
 #include "base/test/mock_callback.h"
 #include "base/test/task_environment.h"
 #include "components/autofill/core/browser/autofill_test_utils.h"
+#include "components/autofill/core/browser/payments_data_manager.h"
 #include "components/autofill/core/browser/test_autofill_client.h"
 #include "components/autofill/core/browser/test_personal_data_manager.h"
 #include "components/autofill/core/common/autofill_payments_features.h"
@@ -133,7 +134,9 @@
   feature_list.InitAndEnableFeature(
       features::kAutofillEnablePaymentsMandatoryReauth);
 
-  autofill_client_->GetPersonalDataManager()->AddCreditCard(local_card_);
+  autofill_client_->GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(local_card_);
 
   EXPECT_TRUE(mandatory_reauth_manager_->ShouldOfferOptin(
       NonInteractivePaymentMethodType::kLocalCard));
@@ -148,7 +151,9 @@
   feature_list.InitAndDisableFeature(
       features::kAutofillEnablePaymentsMandatoryReauth);
 
-  autofill_client_->GetPersonalDataManager()->AddCreditCard(local_card_);
+  autofill_client_->GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(local_card_);
 
   EXPECT_FALSE(mandatory_reauth_manager_->ShouldOfferOptin(
       NonInteractivePaymentMethodType::kLocalCard));
@@ -161,7 +166,9 @@
   base::test::ScopedFeatureList feature_list(
       features::kAutofillEnablePaymentsMandatoryReauth);
 
-  autofill_client_->GetPersonalDataManager()->AddCreditCard(local_card_);
+  autofill_client_->GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(local_card_);
 
   autofill_client_->set_is_off_the_record(true);
 
@@ -226,7 +233,9 @@
 
   mandatory_reauth_manager_->OnUserCancelledOptInPrompt();
 
-  autofill_client_->GetPersonalDataManager()->AddCreditCard(local_card_);
+  autofill_client_->GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(local_card_);
 
   EXPECT_FALSE(mandatory_reauth_manager_->ShouldOfferOptin(
       NonInteractivePaymentMethodType::kLocalCard));
@@ -252,7 +261,9 @@
   ON_CALL(device_authenticator(), CanAuthenticateWithBiometricOrScreenLock)
       .WillByDefault(testing::Return(false));
 
-  autofill_client_->GetPersonalDataManager()->AddCreditCard(local_card_);
+  autofill_client_->GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(local_card_);
 
   EXPECT_FALSE(mandatory_reauth_manager_->ShouldOfferOptin(
       NonInteractivePaymentMethodType::kLocalCard));
@@ -278,7 +289,9 @@
   base::test::ScopedFeatureList feature_list(
       features::kAutofillEnablePaymentsMandatoryReauth);
 
-  autofill_client_->GetPersonalDataManager()->AddCreditCard(local_card_);
+  autofill_client_->GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(local_card_);
 
   // 'card_identifier_if_non_interactive_authentication_flow_completed' is not
   // present, implying interactive authentication happened.
@@ -305,7 +318,9 @@
   base::test::ScopedFeatureList feature_list(
       features::kAutofillEnablePaymentsMandatoryReauth);
 
-  autofill_client_->GetPersonalDataManager()->AddCreditCard(local_card_);
+  autofill_client_->GetPersonalDataManager()
+      ->payments_data_manager()
+      .AddCreditCard(local_card_);
 
   // Test that if the last filled card is the matching local card, we offer
   // re-auth opt-in.
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index df61f803..d7e95f6 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -110,32 +110,6 @@
   observers_.RemoveObserver(observer);
 }
 
-void PersonalDataManager::AddProfile(const AutofillProfile& profile) {
-  address_data_manager_->AddProfile(profile);
-}
-
-void PersonalDataManager::UpdateProfile(const AutofillProfile& profile) {
-  address_data_manager_->UpdateProfile(profile);
-}
-
-void PersonalDataManager::AddCreditCard(const CreditCard& credit_card) {
-  payments_data_manager_->AddCreditCard(credit_card);
-}
-
-void PersonalDataManager::UpdateCreditCard(const CreditCard& credit_card) {
-  payments_data_manager_->UpdateCreditCard(credit_card);
-}
-
-void PersonalDataManager::ClearAllServerDataForTesting() {
-  payments_data_manager_->ClearAllServerDataForTesting();  // IN-TEST
-}
-
-void PersonalDataManager::AddServerCreditCardForTest(
-    std::unique_ptr<CreditCard> credit_card) {
-  payments_data_manager_->AddServerCreditCardForTest(
-      std::move(credit_card));  // IN-TEST
-}
-
 void PersonalDataManager::SetSyncServiceForTest(
     syncer::SyncService* sync_service) {
   address_data_manager_->SetSyncServiceForTest(sync_service);   // IN-TEST
@@ -148,41 +122,11 @@
   }
 }
 
-CreditCard* PersonalDataManager::GetCreditCardByGUID(const std::string& guid) {
-  return payments_data_manager_->GetCreditCardByGUID(guid);
-}
-
-CreditCard* PersonalDataManager::GetCreditCardByInstrumentId(
-    int64_t instrument_id) {
-  return payments_data_manager_->GetCreditCardByInstrumentId(instrument_id);
-}
-
-CreditCard* PersonalDataManager::GetCreditCardByServerId(
-    const std::string& server_id) {
-  return payments_data_manager_->GetCreditCardByServerId(server_id);
-}
-
 bool PersonalDataManager::IsDataLoaded() const {
   return address_data_manager_->has_initial_load_finished() &&
          payments_data_manager_->is_payments_data_loaded();
 }
 
-std::vector<AutofillProfile*> PersonalDataManager::GetProfiles(
-    AddressDataManager::ProfileOrder order) const {
-  return address_data_manager_->GetProfiles(order);
-}
-
-std::vector<CreditCard*> PersonalDataManager::GetCreditCards() const {
-  return payments_data_manager_->GetCreditCards();
-}
-
-std::vector<const AutofillOfferData*>
-PersonalDataManager::GetActiveAutofillPromoCodeOffersForOrigin(
-    GURL origin) const {
-  return payments_data_manager_->GetActiveAutofillPromoCodeOffersForOrigin(
-      origin);
-}
-
 void PersonalDataManager::SetSyncingForTest(bool is_syncing_for_test) {
   payments_data_manager_->SetSyncingForTest(is_syncing_for_test);
 }
@@ -192,10 +136,6 @@
   payments_data_manager_->Refresh();
 }
 
-std::vector<CreditCard*> PersonalDataManager::GetCreditCardsToSuggest() const {
-  return payments_data_manager_->GetCreditCardsToSuggest();
-}
-
 bool PersonalDataManager::IsAutofillEnabled() const {
   return address_data_manager_->IsAutofillProfileEnabled() ||
          payments_data_manager_->IsAutofillPaymentMethodsEnabled();
diff --git a/components/autofill/core/browser/personal_data_manager.h b/components/autofill/core/browser/personal_data_manager.h
index d69a1cc..ac39e6b 100644
--- a/components/autofill/core/browser/personal_data_manager.h
+++ b/components/autofill/core/browser/personal_data_manager.h
@@ -157,27 +157,8 @@
   // Returns whether the personal data has been loaded from the web database.
   virtual bool IsDataLoaded() const;
 
-  // All of the following functions simply forward the call to a function of the
-  // same name in the `address_data_manager()` or the `payments_data_manager().
-  // They should not be used anymore. Instead, callers should use the function
-  // in the address/payments data manager instead.
-  // TODO(b/322170538): Migrate existing callers.
-  void AddProfile(const AutofillProfile& profile);
-  void UpdateProfile(const AutofillProfile& profile);
-  void AddCreditCard(const CreditCard& credit_card);
-  void UpdateCreditCard(const CreditCard& credit_card);
-  void ClearAllServerDataForTesting();
-  void AddServerCreditCardForTest(std::unique_ptr<CreditCard> credit_card);
-  CreditCard* GetCreditCardByGUID(const std::string& guid);
-  CreditCard* GetCreditCardByInstrumentId(int64_t instrument_id);
-  CreditCard* GetCreditCardByServerId(const std::string& server_id);
-  std::vector<AutofillProfile*> GetProfiles(
-      AddressDataManager::ProfileOrder order =
-          AddressDataManager::ProfileOrder::kNone) const;
-  std::vector<CreditCard*> GetCreditCards() const;
-  std::vector<const AutofillOfferData*>
-  GetActiveAutofillPromoCodeOffersForOrigin(GURL origin) const;
-  std::vector<CreditCard*> GetCreditCardsToSuggest() const;
+  // TODO(b/322170538): This function simply forwards to the payments data
+  // manager. Migrate existing callers to go through `payments_data_manager()`.
   void SetSyncingForTest(bool is_syncing_for_test);
 
   // Re-loads profiles, credit cards, and IBANs from the WebDatabase
diff --git a/components/autofill/core/browser/ui/suggestion.cc b/components/autofill/core/browser/ui/suggestion.cc
index 5441fdf..a9c9509c 100644
--- a/components/autofill/core/browser/ui/suggestion.cc
+++ b/components/autofill/core/browser/ui/suggestion.cc
@@ -8,7 +8,6 @@
 #include <utility>
 
 #include "base/strings/utf_string_conversions.h"
-#include "base/types/cxx23_to_underlying.h"
 #include "components/autofill/core/browser/data_model/credit_card.h"
 #include "components/autofill/core/browser/ui/suggestion_type.h"
 
@@ -164,8 +163,8 @@
 
 void PrintTo(const Suggestion& suggestion, std::ostream* os) {
   *os << std::endl
-      << "Suggestion (type:" << base::to_underlying(suggestion.type)
-      << ", main_text:\"" << suggestion.main_text.value << "\""
+      << "Suggestion (type:" << suggestion.type << ", main_text:\""
+      << suggestion.main_text.value << "\""
       << (suggestion.main_text.is_primary ? "(Primary)" : "(Not Primary)")
       << ", minor_text:\"" << suggestion.minor_text.value << "\""
       << (suggestion.minor_text.is_primary ? "(Primary)" : "(Not Primary)")
diff --git a/components/autofill/core/common/autofill_features.cc b/components/autofill/core/common/autofill_features.cc
index 19853ab..90ef9c4 100644
--- a/components/autofill/core/common/autofill_features.cc
+++ b/components/autofill/core/common/autofill_features.cc
@@ -80,6 +80,13 @@
              "AutofillDefaultToCityAndNumber",
              base::FEATURE_ENABLED_BY_DEFAULT);
 
+// If enabled, no prefix matching is applied to filter credit card number
+// suggestions.
+// TODO(crbug.com/338932642): Clean up if launched.
+BASE_FEATURE(kAutofillDontPrefixMatchCreditCardNumbers,
+             "AutofillDontPrefixMatchCreditCardNumbers",
+             base::FEATURE_DISABLED_BY_DEFAULT);
+
 // FormStructure::RetrieveFromCache used to preserve an AutofillField's
 // is_autofilled from the cache of previously parsed forms. This makes little
 // sense because the renderer sends us the autofill state and has the most
diff --git a/components/autofill/core/common/autofill_features.h b/components/autofill/core/common/autofill_features.h
index 81f314c..e07343f 100644
--- a/components/autofill/core/common/autofill_features.h
+++ b/components/autofill/core/common/autofill_features.h
@@ -38,6 +38,8 @@
 COMPONENT_EXPORT(AUTOFILL)
 BASE_DECLARE_FEATURE(kAutofillDisambiguateContradictingFieldTypes);
 COMPONENT_EXPORT(AUTOFILL)
+BASE_DECLARE_FEATURE(kAutofillDontPrefixMatchCreditCardNumbers);
+COMPONENT_EXPORT(AUTOFILL)
 BASE_DECLARE_FEATURE(kAutofillDontPreserveAutofillState);
 COMPONENT_EXPORT(AUTOFILL)
 BASE_DECLARE_FEATURE(kAutofillEnableAddressFieldParserNG);
diff --git a/components/autofill/core/common/autofill_regex_constants.h b/components/autofill/core/common/autofill_regex_constants.h
index f871712..5b772f0 100644
--- a/components/autofill/core/common/autofill_regex_constants.h
+++ b/components/autofill/core/common/autofill_regex_constants.h
@@ -123,7 +123,8 @@
     u"|국가|나라"                         // ko-KR
     u"|(\\b|_)(ülke|ulce|ulke)(\\b|_)"    // tr
     u"|کشور"                              // fa
-    u"|negara";                           // id
+    u"|negara"                            // id
+    u"|(?<!o)kraj|pa[nń]stwo";            // pl
 inline constexpr char16_t kCountryLocationRe[] = u"location";
 inline constexpr char16_t kZipCodeRe[] =
     u"((?<!\\.))zip"  // .zip indicates a file extension
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ContentSettingException.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ContentSettingException.java
index bddf109f..353fe3c 100644
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ContentSettingException.java
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ContentSettingException.java
@@ -11,6 +11,7 @@
 
 import org.chromium.components.content_settings.ContentSettingValues;
 import org.chromium.components.content_settings.ContentSettingsType;
+import org.chromium.components.content_settings.ProviderType;
 import org.chromium.content_public.browser.BrowserContextHandle;
 
 import java.io.Serializable;
@@ -22,7 +23,7 @@
     private final String mSecondaryPattern;
     // TODO(crbug.com/40231949): Convert {@link #mSource} to enum to enable merging {@link #mSource}
     // and {@link #mIsEmbargoed}.
-    private final String mSource;
+    private final @ProviderType.EnumType int mSource;
     private final Integer mExpirationInDays;
     private final boolean mIsEmbargoed;
     private @ContentSettingValues @Nullable Integer mContentSetting;
@@ -42,7 +43,7 @@
             String primaryPattern,
             String secondaryPattern,
             @ContentSettingValues @Nullable Integer setting,
-            String source,
+            @ProviderType.EnumType int source,
             final Integer expirationInDays,
             boolean isEmbargoed) {
         mContentSettingType = type;
@@ -61,7 +62,7 @@
             @ContentSettingsType.EnumType int type,
             String primaryPattern,
             @ContentSettingValues @Nullable Integer setting,
-            String source,
+            @ProviderType.EnumType int source,
             boolean isEmbargoed) {
         this(
                 type,
@@ -85,7 +86,7 @@
         return (mSecondaryPattern == null) ? SITE_WILDCARD : mSecondaryPattern;
     }
 
-    public String getSource() {
+    public @ProviderType.EnumType int getSource() {
         return mSource;
     }
 
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
index 494817b46..cd36af7 100644
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
@@ -72,6 +72,7 @@
 import org.chromium.components.content_settings.ContentSettingValues;
 import org.chromium.components.content_settings.ContentSettingsType;
 import org.chromium.components.content_settings.CookieControlsMode;
+import org.chromium.components.content_settings.ProviderType;
 import org.chromium.components.embedder_support.util.UrlUtilities;
 import org.chromium.components.prefs.PrefService;
 import org.chromium.components.user_prefs.UserPrefs;
@@ -1626,8 +1627,8 @@
                         websitePref
                                 .site()
                                 .getContentSettingException(mCategory.getContentSettingsType());
-                if (exception != null && exception.getSource() != null) {
-                    return exception.getSource().equals(POLICY);
+                if (exception != null) {
+                    return exception.getSource() == ProviderType.POLICY_PROVIDER;
                 }
                 return false;
             }
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java
index 4352961c..6e6b410 100644
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java
@@ -12,6 +12,7 @@
 import org.chromium.components.browser_ui.site_settings.WebsitePreferenceBridge.StorageInfoClearedCallback;
 import org.chromium.components.content_settings.ContentSettingValues;
 import org.chromium.components.content_settings.ContentSettingsType;
+import org.chromium.components.content_settings.ProviderType;
 import org.chromium.components.url_formatter.UrlFormatter;
 import org.chromium.content_public.browser.BrowserContextHandle;
 import org.chromium.url.GURL;
@@ -281,7 +282,7 @@
                                 ContentSettingsType.ADS,
                                 getAddress().getOrigin(),
                                 ContentSettingValues.BLOCK,
-                                "",
+                                ProviderType.NONE,
                                 /* isEmbargoed= */ false);
                 setContentSettingException(type, exception);
             }
@@ -295,7 +296,7 @@
                                 ContentSettingsType.JAVASCRIPT,
                                 getAddress().getHost(),
                                 value,
-                                "",
+                                ProviderType.NONE,
                                 /* isEmbargoed= */ false);
                 setContentSettingException(type, exception);
             }
@@ -315,7 +316,7 @@
                                 ContentSettingsType.SOUND,
                                 getAddress().getHost(),
                                 value,
-                                "",
+                                ProviderType.NONE,
                                 /* isEmbargoed= */ false);
                 setContentSettingException(type, exception);
             }
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java
index ea74e4d..06988ed 100644
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java
@@ -10,6 +10,7 @@
 import org.chromium.base.Callback;
 import org.chromium.components.content_settings.ContentSettingValues;
 import org.chromium.components.content_settings.ContentSettingsType;
+import org.chromium.components.content_settings.ProviderType;
 import org.chromium.components.content_settings.SessionModel;
 import org.chromium.components.location.LocationUtils;
 import org.chromium.content_public.browser.BrowserContextHandle;
@@ -134,7 +135,7 @@
 
         List<ContentSettingException> managedExceptions = new ArrayList<ContentSettingException>();
         for (ContentSettingException exception : exceptions) {
-            if (exception.getSource().equals("policy")) {
+            if (exception.getSource() == ProviderType.POLICY_PROVIDER) {
                 managedExceptions.add(exception);
             }
         }
@@ -219,18 +220,17 @@
             String primaryPattern,
             String secondaryPattern,
             int contentSetting,
-            String source,
+            @ProviderType.EnumType int source,
             final boolean hasExpiration,
             final int expirationInDays,
             boolean isEmbargoed) {
-        String nonNullSource = (source == null) ? "" : source;
         ContentSettingException exception =
                 new ContentSettingException(
                         contentSettingsType,
                         primaryPattern,
                         secondaryPattern,
                         contentSetting,
-                        nonNullSource,
+                        source,
                         hasExpiration ? expirationInDays : null,
                         isEmbargoed);
         list.add(exception);
diff --git a/components/browser_ui/site_settings/android/website_preference_bridge.cc b/components/browser_ui/site_settings/android/website_preference_bridge.cc
index ff067e8..7e5e886b 100644
--- a/components/browser_ui/site_settings/android/website_preference_bridge.cc
+++ b/components/browser_ui/site_settings/android/website_preference_bridge.cc
@@ -1016,7 +1016,9 @@
     Java_WebsitePreferenceBridge_addContentSettingExceptionToList(
         env, list, content_settings_type, ConvertUTF8ToJavaString(env, origin),
         ConvertUTF8ToJavaString(env, entry.secondary_pattern.ToString()),
-        entry.GetContentSetting(), ConvertUTF8ToJavaString(env, entry.source),
+        entry.GetContentSetting(),
+        static_cast<int>(
+            HostContentSettingsMap::GetProviderTypeFromSource(entry.source)),
         hasExpiration, expirationInDays,
         /*is_embargoed=*/false);
   }
@@ -1036,7 +1038,8 @@
     Java_WebsitePreferenceBridge_addContentSettingExceptionToList(
         env, list, content_settings_type,
         ConvertUTF8ToJavaString(env, embargoed_origin_pattern), jembedder,
-        CONTENT_SETTING_BLOCK, /*source=*/ScopedJavaLocalRef<jstring>(),
+        CONTENT_SETTING_BLOCK,
+        static_cast<int>(content_settings::ProviderType::kNone),
         /*isTemporary=*/false,
         /*expiration=*/0, /*is_embargoed=*/true);
   }
diff --git a/components/certificate_transparency/data/log_list.json b/components/certificate_transparency/data/log_list.json
index 27d2589..edcd461 100644
--- a/components/certificate_transparency/data/log_list.json
+++ b/components/certificate_transparency/data/log_list.json
@@ -1,6 +1,6 @@
 {
-  "version": "34.7",
-  "log_list_timestamp": "2024-05-05T12:54:56Z",
+  "version": "34.8",
+  "log_list_timestamp": "2024-05-06T12:54:57Z",
   "operators": [
     {
       "name": "Google",
diff --git a/components/commerce/core/compare/cluster_manager.cc b/components/commerce/core/compare/cluster_manager.cc
index 6b5913b..0931bd3 100644
--- a/components/commerce/core/compare/cluster_manager.cc
+++ b/components/commerce/core/compare/cluster_manager.cc
@@ -168,6 +168,7 @@
 }
 
 void ClusterManager::OnProductSpecificationsSetUpdate(
+    const ProductSpecificationsSet& before,
     const ProductSpecificationsSet& product_specifications_set) {
   OnProductSpecificationsSetAdded(product_specifications_set);
 }
diff --git a/components/commerce/core/compare/cluster_manager.h b/components/commerce/core/compare/cluster_manager.h
index e30badf..25cee3d 100644
--- a/components/commerce/core/compare/cluster_manager.h
+++ b/components/commerce/core/compare/cluster_manager.h
@@ -41,6 +41,7 @@
   void OnProductSpecificationsSetAdded(
       const ProductSpecificationsSet& product_specifications_set) override;
   void OnProductSpecificationsSetUpdate(
+      const ProductSpecificationsSet& before,
       const ProductSpecificationsSet& product_specifications_set) override;
   void OnProductSpecificationsSetRemoved(const base::Uuid& uuid) override;
 
diff --git a/components/commerce/core/product_specifications/product_specifications_service_unittest.cc b/components/commerce/core/product_specifications/product_specifications_service_unittest.cc
index 555901b..228980b 100644
--- a/components/commerce/core/product_specifications/product_specifications_service_unittest.cc
+++ b/components/commerce/core/product_specifications/product_specifications_service_unittest.cc
@@ -168,7 +168,8 @@
 
   MOCK_METHOD(void,
               OnProductSpecificationsSetUpdate,
-              (const ProductSpecificationsSet& set),
+              (const ProductSpecificationsSet& before,
+               const ProductSpecificationsSet& after),
               (override));
 
   MOCK_METHOD(void,
@@ -298,8 +299,9 @@
 
   const base::Uuid uuid_to_modify = specifications[0].uuid();
 
-  EXPECT_CALL(*observer(),
-              OnProductSpecificationsSetUpdate(IsSetWithUuid(uuid_to_modify)))
+  EXPECT_CALL(*observer(), OnProductSpecificationsSetUpdate(
+                               HasAllProductSpecs(kCompareSpecifics[0]),
+                               IsSetWithUuid(uuid_to_modify)))
       .Times(1);
 
   const std::vector<GURL> new_urls = {GURL("http://example.com/updated")};
@@ -325,8 +327,9 @@
 
   const base::Uuid uuid_to_modify = specifications[0].uuid();
 
-  EXPECT_CALL(*observer(),
-              OnProductSpecificationsSetUpdate(IsSetWithUuid(uuid_to_modify)))
+  EXPECT_CALL(*observer(), OnProductSpecificationsSetUpdate(
+                               HasAllProductSpecs(kCompareSpecifics[0]),
+                               IsSetWithUuid(uuid_to_modify)))
       .Times(1);
 
   const std::string new_name = "updated name";
@@ -353,7 +356,8 @@
   const base::Uuid uuid_to_modify =
       base::Uuid::ParseLowercase("90000000-0000-0000-0000-000000000000");
 
-  EXPECT_CALL(*observer(), OnProductSpecificationsSetUpdate(testing::_))
+  EXPECT_CALL(*observer(),
+              OnProductSpecificationsSetUpdate(testing::_, testing::_))
       .Times(0);
 
   const std::vector<GURL> new_urls = {GURL("http://example.com/updated")};
@@ -388,9 +392,11 @@
       noupdate_specifics.uuid(), MakeEntityData(noupdate_specifics)));
 
   EXPECT_CALL(*observer(), OnProductSpecificationsSetUpdate(
+                               HasAllProductSpecs(kCompareSpecifics[0]),
                                HasAllProductSpecs(new_specifics)))
       .Times(1);
   EXPECT_CALL(*observer(), OnProductSpecificationsSetUpdate(
+                               HasAllProductSpecs(kCompareSpecifics[1]),
                                HasAllProductSpecs(noupdate_specifics)))
       .Times(0);
   bridge()->ApplyIncrementalSyncChanges(
diff --git a/components/commerce/core/product_specifications/product_specifications_set.h b/components/commerce/core/product_specifications/product_specifications_set.h
index c995106..8524df07 100644
--- a/components/commerce/core/product_specifications/product_specifications_set.h
+++ b/components/commerce/core/product_specifications/product_specifications_set.h
@@ -26,8 +26,11 @@
     virtual void OnProductSpecificationsSetAdded(
         const ProductSpecificationsSet& product_specifications_set) {}
 
+    // Invoked when a ProductSpecificationsSet is updated and provides the
+    // current and preious values.
     virtual void OnProductSpecificationsSetUpdate(
-        const ProductSpecificationsSet& product_specifications_set) {}
+        const ProductSpecificationsSet& before,
+        const ProductSpecificationsSet& after) {}
 
     virtual void OnProductSpecificationsSetRemoved(const base::Uuid& uuid) {}
 
diff --git a/components/commerce/core/product_specifications/product_specifications_sync_bridge.cc b/components/commerce/core/product_specifications/product_specifications_sync_bridge.cc
index 6772327..bb564ed 100644
--- a/components/commerce/core/product_specifications/product_specifications_sync_bridge.cc
+++ b/components/commerce/core/product_specifications/product_specifications_sync_bridge.cc
@@ -76,13 +76,14 @@
       case syncer::EntityChange::ACTION_UPDATE: {
         auto local_specifics = entries_.find(change->storage_key());
         if (local_specifics != entries_.end()) {
+          sync_pb::CompareSpecifics before = local_specifics->second;
           // Overwrite if specifics from sync are more recent.
           if (specifics.update_time_unix_epoch_micros() >
               local_specifics->second.update_time_unix_epoch_micros()) {
             entries_[change->storage_key()] = specifics;
             batch->WriteData(change->storage_key(),
                              specifics.SerializeAsString());
-            OnSpecificsUpdated(specifics);
+            OnSpecificsUpdated(before, specifics);
           }
         }
         break;
@@ -171,6 +172,7 @@
   // Sync is mandatory for this feature to be usable.
   CHECK(change_processor()->IsTrackingMetadata());
 
+  sync_pb::CompareSpecifics before = it->second;
   sync_pb::CompareSpecifics& specifics = it->second;
   specifics.set_update_time_unix_epoch_micros(
       base::Time::Now().InMillisecondsSinceUnixEpoch());
@@ -190,7 +192,7 @@
 
   batch->WriteData(specifics.uuid(), specifics.SerializeAsString());
   Commit(std::move(batch));
-  OnSpecificsUpdated(specifics);
+  OnSpecificsUpdated(before, specifics);
   return specifics;
 }
 
@@ -292,10 +294,12 @@
 }
 
 void ProductSpecificationsSyncBridge::OnSpecificsUpdated(
-    const sync_pb::CompareSpecifics& compare_specifics) {
+    const sync_pb::CompareSpecifics& before,
+    const sync_pb::CompareSpecifics& after) {
   for (auto& observer : observers_) {
     observer.OnProductSpecificationsSetUpdate(
-        ProductSpecificationsSet::FromProto(compare_specifics));
+        ProductSpecificationsSet::FromProto(before),
+        ProductSpecificationsSet::FromProto(after));
   }
 }
 
diff --git a/components/commerce/core/product_specifications/product_specifications_sync_bridge.h b/components/commerce/core/product_specifications/product_specifications_sync_bridge.h
index 7d3482e..a4031b1 100644
--- a/components/commerce/core/product_specifications/product_specifications_sync_bridge.h
+++ b/components/commerce/core/product_specifications/product_specifications_sync_bridge.h
@@ -85,7 +85,8 @@
   void RemoveObserver(commerce::ProductSpecificationsSet::Observer* observer);
 
   void OnSpecificsAdded(const sync_pb::CompareSpecifics& compare_specifics);
-  void OnSpecificsUpdated(const sync_pb::CompareSpecifics& compare_specifics);
+  void OnSpecificsUpdated(const sync_pb::CompareSpecifics& before,
+                          const sync_pb::CompareSpecifics& compare_specifics);
   void OnSpecificsRemoved(const std::string& uuid);
 
   CompareSpecificsEntries entries_;
diff --git a/components/commerce/core/webui/shopping_service_handler.cc b/components/commerce/core/webui/shopping_service_handler.cc
index 9458e1e..bfc2ba1 100644
--- a/components/commerce/core/webui/shopping_service_handler.cc
+++ b/components/commerce/core/webui/shopping_service_handler.cc
@@ -746,6 +746,7 @@
 }
 
 void ShoppingServiceHandler::OnProductSpecificationsSetUpdate(
+    const ProductSpecificationsSet& before,
     const ProductSpecificationsSet& set) {
   remote_page_->OnProductSpecificationsSetUpdated(ProductSpecsSetToMojo(set));
 }
diff --git a/components/commerce/core/webui/shopping_service_handler.h b/components/commerce/core/webui/shopping_service_handler.h
index 75fb97d..cca2a8d 100644
--- a/components/commerce/core/webui/shopping_service_handler.h
+++ b/components/commerce/core/webui/shopping_service_handler.h
@@ -140,6 +140,7 @@
       const ProductSpecificationsSet& set) override;
 
   void OnProductSpecificationsSetUpdate(
+      const ProductSpecificationsSet& before,
       const ProductSpecificationsSet& set) override;
 
   void OnProductSpecificationsSetRemoved(const base::Uuid& uuid) override;
diff --git a/components/content_settings/core/browser/content_settings_uma_util.cc b/components/content_settings/core/browser/content_settings_uma_util.cc
index b5dd917..ad6118e 100644
--- a/components/content_settings/core/browser/content_settings_uma_util.cc
+++ b/components/content_settings/core/browser/content_settings_uma_util.cc
@@ -6,6 +6,7 @@
 
 #include "base/containers/fixed_flat_map.h"
 #include "base/metrics/histogram_functions.h"
+#include "base/notreached.h"
 #include "base/strings/strcat.h"
 #include "components/content_settings/core/common/content_settings.h"
 
@@ -179,6 +180,9 @@
       return "ProviderForTests";
     case ProviderType::kOtherProviderForTests:
       return "OtherProviderForTests";
+    case ProviderType::kNone:
+      NOTREACHED();
+      return "";
   }
 }
 
diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc
index ae83063..a0b3b69 100644
--- a/components/content_settings/core/browser/host_content_settings_map.cc
+++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -99,6 +99,7 @@
          {"one_time", SettingSource::kUser}},
         {ProviderType::kPrefProvider, {"preference", SettingSource::kUser}},
         {ProviderType::kDefaultProvider, {"default", SettingSource::kUser}},
+        {ProviderType::kNone, {"none", SettingSource::kNone}},
         {ProviderType::kProviderForTests, {"tests", SettingSource::kUser}},
         {ProviderType::kOtherProviderForTests,
          {"tests_other", SettingSource::kUser}},
diff --git a/components/content_settings/core/common/content_settings_enums.mojom b/components/content_settings/core/common/content_settings_enums.mojom
index 4894d9e..c16ae0c 100644
--- a/components/content_settings/core/common/content_settings_enums.mojom
+++ b/components/content_settings/core/common/content_settings_enums.mojom
@@ -59,6 +59,8 @@
 };
 
 // Identifies the content settings provider of a content setting.
+// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.components.content_settings
+// GENERATED_JAVA_CLASS_NAME_OVERRIDE: ProviderType
  enum ProviderType {
     kWebuiAllowlistProvider = 0,
     kPolicyProvider,
@@ -69,6 +71,7 @@
     kOneTimePermissionProvider,
     kPrefProvider,
     kDefaultProvider,
+    kNone,
 
     // The following providers are for tests only.
     kProviderForTests,
diff --git a/components/discardable_memory/client/client_discardable_shared_memory_manager.cc b/components/discardable_memory/client/client_discardable_shared_memory_manager.cc
index a4ea30b..1e4b148 100644
--- a/components/discardable_memory/client/client_discardable_shared_memory_manager.cc
+++ b/components/discardable_memory/client/client_discardable_shared_memory_manager.cc
@@ -146,7 +146,7 @@
     DCHECK(is_locked());
   }
 #endif
-  return reinterpret_cast<void*>(span_->start() * base::GetPageSize());
+  return span_->memory().data();
 }
 
 bool ClientDiscardableSharedMemoryManager::DiscardableMemoryImpl::is_locked()
@@ -284,9 +284,8 @@
     // Attempt to lock |free_span|. Delete span and search free lists again
     // if locking failed.
     if (free_span->shared_memory()->Lock(
-            free_span->start() * base::GetPageSize() -
-                reinterpret_cast<size_t>(free_span->shared_memory()->memory()),
-            free_span->length() * base::GetPageSize()) ==
+            free_span->first_block() * base::GetPageSize(),
+            free_span->num_blocks() * base::GetPageSize()) ==
         base::DiscardableSharedMemory::FAILED) {
       DCHECK(!free_span->shared_memory()->IsMemoryResident());
       // We have to release purged memory before |free_span| can be destroyed.
@@ -354,9 +353,8 @@
     std::unique_ptr<DiscardableSharedMemoryHeap::Span> leftover =
         heap_->Split(new_span.get(), pages);
     leftover->shared_memory()->Unlock(
-        leftover->start() * base::GetPageSize() -
-            reinterpret_cast<size_t>(leftover->shared_memory()->memory()),
-        leftover->length() * base::GetPageSize());
+        leftover->first_block() * base::GetPageSize(),
+        leftover->num_blocks() * base::GetPageSize());
     leftover->set_is_locked(false);
     heap_->MergeIntoFreeListsClean(std::move(leftover));
   }
@@ -486,9 +484,8 @@
   if (!span->shared_memory())
     return false;
 
-  size_t offset = span->start() * base::GetPageSize() -
-                  reinterpret_cast<size_t>(span->shared_memory()->memory());
-  size_t length = span->length() * base::GetPageSize();
+  size_t offset = span->first_block() * base::GetPageSize();
+  size_t length = span->num_blocks() * base::GetPageSize();
 
   switch (span->shared_memory()->Lock(offset, length)) {
     case base::DiscardableSharedMemory::SUCCESS:
@@ -509,9 +506,8 @@
 void ClientDiscardableSharedMemoryManager::UnlockSpan(
     DiscardableSharedMemoryHeap::Span* span) {
   DCHECK(span->shared_memory());
-  size_t offset = span->start() * base::GetPageSize() -
-                  reinterpret_cast<size_t>(span->shared_memory()->memory());
-  size_t length = span->length() * base::GetPageSize();
+  size_t offset = span->first_block() * base::GetPageSize();
+  size_t length = span->num_blocks() * base::GetPageSize();
 
   span->set_is_locked(false);
   return span->shared_memory()->Unlock(offset, length);
diff --git a/components/discardable_memory/common/discardable_shared_memory_heap.cc b/components/discardable_memory/common/discardable_shared_memory_heap.cc
index f7cfa44..37823f1 100644
--- a/components/discardable_memory/common/discardable_shared_memory_heap.cc
+++ b/components/discardable_memory/common/discardable_shared_memory_heap.cc
@@ -2,6 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#ifdef UNSAFE_BUFFERS_BUILD
+#pragma check_unsafe_buffers
+#endif
+
 #include "components/discardable_memory/common/discardable_shared_memory_heap.h"
 
 #include <bit>
@@ -32,14 +36,13 @@
 
 DiscardableSharedMemoryHeap::Span::Span(
     base::DiscardableSharedMemory* shared_memory,
-    size_t start,
-    size_t length,
+    size_t first_block,
+    size_t num_blocks,
     DiscardableSharedMemoryHeap::ScopedMemorySegment* memory_segment)
     : memory_segment_(memory_segment),
       shared_memory_(shared_memory),
-      start_(start),
-      length_(length),
-      is_locked_(false) {}
+      first_block_(first_block),
+      num_blocks_(num_blocks) {}
 
 DiscardableSharedMemoryHeap::ScopedMemorySegment::ScopedMemorySegment(
     DiscardableSharedMemoryHeap* heap,
@@ -53,6 +56,11 @@
       id_(id),
       deleted_callback_(std::move(deleted_callback)) {}
 
+base::span<uint8_t> DiscardableSharedMemoryHeap::Span::memory() const {
+  return shared_memory_->memory().subspan(first_block_ * base::GetPageSize(),
+                                          num_blocks_ * base::GetPageSize());
+}
+
 DiscardableSharedMemoryHeap::ScopedMemorySegment*
 DiscardableSharedMemoryHeap::Span::GetScopedMemorySegmentForTesting() const {
   return memory_segment_;
@@ -86,7 +94,7 @@
   base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(name);
   dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
                   base::trace_event::MemoryAllocatorDump::kUnitsBytes,
-                  static_cast<uint64_t>(span->length() * block_size));
+                  static_cast<uint64_t>(span->num_blocks_ * block_size));
 
   pmd->AddSuballocation(
       dump->guid(),
@@ -119,21 +127,19 @@
     int32_t id,
     base::OnceClosure deleted_callback) {
   // Memory must be aligned to block size.
-  DCHECK(base::IsAligned(shared_memory->memory(), block_size_));
+  DCHECK(base::IsAligned(shared_memory->memory().data(), block_size_));
   DCHECK(base::IsAligned(size, block_size_));
 
   auto* raw_shared_memory = shared_memory.get();
   auto scoped_memory_segment = std::make_unique<ScopedMemorySegment>(
       this, std::move(shared_memory), size, id, std::move(deleted_callback));
-  std::unique_ptr<Span> span(new Span(
-      raw_shared_memory,
-      reinterpret_cast<size_t>(raw_shared_memory->memory()) / block_size_,
-      size / block_size_, scoped_memory_segment.get()));
-  DCHECK(spans_.find(span->start_) == spans_.end());
-  DCHECK(spans_.find(span->start_ + span->length_ - 1) == spans_.end());
+  std::unique_ptr<Span> span(new Span(raw_shared_memory, 0u, size / block_size_,
+                                      scoped_memory_segment.get()));
+  CHECK(spans_.find(SpanBeginKey(*span)) == spans_.end());
+  CHECK(spans_.find(SpanEndKey(*span)) == spans_.end());
   RegisterSpan(span.get());
 
-  num_blocks_ += span->length_;
+  num_blocks_ += span->num_blocks_;
 
   // Start tracking if segment is resident by adding it to |memory_segments_|.
   memory_segments_.push_back(std::move(scoped_memory_segment));
@@ -151,31 +157,37 @@
   DCHECK(span->shared_memory_);
 
   // First add length of |span| to |num_free_blocks_|.
-  num_free_blocks_ += span->length_;
+  num_free_blocks_ += span->num_blocks_;
 
   // Merge with previous span if possible.
-  auto prev_it = spans_.find(span->start_ - 1);
+  auto begin_key = SpanBeginKey(*span);
+  begin_key.second -= 1u;
+  auto prev_it = spans_.find(begin_key);
   if (prev_it != spans_.end() && IsInFreeList(prev_it->second)) {
     std::unique_ptr<Span> prev = RemoveFromFreeList(prev_it->second);
-    DCHECK_EQ(prev->start_ + prev->length_, span->start_);
+    DCHECK_EQ(prev->first_block_ + prev->num_blocks_, span->first_block_);
     UnregisterSpan(prev.get());
-    if (span->length_ > 1)
-      spans_.erase(span->start_);
-    span->start_ -= prev->length_;
-    span->length_ += prev->length_;
-    spans_[span->start_] = span.get();
+    if (span->num_blocks_ > 1) {
+      spans_.erase(SpanBeginKey(*span));
+    }
+    span->first_block_ -= prev->num_blocks_;
+    span->num_blocks_ += prev->num_blocks_;
+    spans_[SpanBeginKey(*span)] = span.get();
   }
 
   // Merge with next span if possible.
-  auto next_it = spans_.find(span->start_ + span->length_);
+  auto end_key = SpanEndKey(*span);
+  end_key.second += 1u;
+  auto next_it = spans_.find(end_key);
   if (next_it != spans_.end() && IsInFreeList(next_it->second)) {
     std::unique_ptr<Span> next = RemoveFromFreeList(next_it->second);
-    DCHECK_EQ(next->start_, span->start_ + span->length_);
+    DCHECK_EQ(next->first_block_, span->first_block_ + span->num_blocks_);
     UnregisterSpan(next.get());
-    if (span->length_ > 1)
-      spans_.erase(span->start_ + span->length_ - 1);
-    span->length_ += next->length_;
-    spans_[span->start_ + span->length_ - 1] = span.get();
+    if (span->num_blocks_ > 1) {
+      spans_.erase(SpanEndKey(*span));
+    }
+    span->num_blocks_ += next->num_blocks_;
+    spans_[SpanEndKey(*span)] = span.get();
   }
 
   InsertIntoFreeList(std::move(span));
@@ -184,49 +196,51 @@
 std::unique_ptr<DiscardableSharedMemoryHeap::Span>
 DiscardableSharedMemoryHeap::Split(Span* span, size_t blocks) {
   DCHECK(blocks);
-  DCHECK_LT(blocks, span->length_);
+  CHECK_LT(blocks, span->num_blocks_);
 
   std::unique_ptr<Span> leftover(
-      new Span(span->shared_memory_, span->start_ + blocks,
-               span->length_ - blocks, span->memory_segment_));
-  DCHECK(leftover->length_ == 1 ||
-         spans_.find(leftover->start_) == spans_.end());
+      new Span(span->shared_memory_, span->first_block_ + blocks,
+               span->num_blocks_ - blocks, span->memory_segment_));
+  CHECK(leftover->num_blocks_ == 1u ||
+        spans_.find(SpanBeginKey(*leftover)) == spans_.end());
   RegisterSpan(leftover.get());
-  spans_[span->start_ + blocks - 1] = span;
-  span->length_ = blocks;
+  span->num_blocks_ = blocks;
+  spans_[SpanEndKey(*span)] = span;
   return leftover;
 }
 
 std::unique_ptr<DiscardableSharedMemoryHeap::Span>
 DiscardableSharedMemoryHeap::SearchFreeLists(size_t blocks, size_t slack) {
-  DCHECK(blocks);
+  CHECK(blocks);
 
   size_t length = blocks;
   size_t max_length = blocks + slack;
 
   // Search array of free lists for a suitable span.
-  while (length - 1 < std::size(free_spans_) - 1) {
-    const base::LinkedList<Span>& free_spans = free_spans_[length - 1];
+  while (length < std::size(free_spans_)) {
+    const base::LinkedList<Span>& free_spans = free_spans_[length - 1u];
     if (!free_spans.empty()) {
       // Return the most recently used span located in tail.
       return Carve(free_spans.tail()->value(), blocks);
     }
 
     // Return early after surpassing |max_length|.
-    if (++length > max_length)
+    if (++length > max_length) {
       return nullptr;
+    }
   }
 
   const base::LinkedList<Span>& overflow_free_spans =
-      free_spans_[std::size(free_spans_) - 1];
+      free_spans_[std::size(free_spans_) - 1u];
 
   // Search overflow free list for a suitable span. Starting with the most
   // recently used span located in tail and moving towards head.
   for (base::LinkNode<Span>* node = overflow_free_spans.tail();
        node != overflow_free_spans.end(); node = node->previous()) {
     Span* span = node->value();
-    if (span->length_ >= blocks && span->length_ <= max_length)
+    if (span->num_blocks_ >= blocks && span->num_blocks_ <= max_length) {
       return Carve(span, blocks);
+    }
   }
 
   return nullptr;
@@ -270,15 +284,13 @@
     for (base::LinkNode<Span>* curr = span_list.head(); curr != span_list.end();
          curr = curr->next()) {
       Span* free_span = curr->value();
-      // A given span over a piece of Shared Memory (which we will call
-      // |shared_memory|) has Span::start_ initialized to a value equivalent
-      // to reinterpret_cast<shared_memory->memory()) / block_size_.
-      void* mem = reinterpret_cast<void*>(free_span->start() * block_size_);
+      base::span<uint8_t> mem = free_span->memory();
       std::optional<size_t> resident_in_span =
-          base::trace_event::ProcessMemoryDump::CountResidentBytes(
-              mem, free_span->length() * base::GetPageSize());
-      if (!resident_in_span)
+          base::trace_event::ProcessMemoryDump::CountResidentBytes(mem.data(),
+                                                                   mem.size());
+      if (!resident_in_span) {
         return std::nullopt;
+      }
       resident_size += resident_in_span.value();
     }
   }
@@ -333,7 +345,7 @@
 void DiscardableSharedMemoryHeap::InsertIntoFreeList(
     std::unique_ptr<DiscardableSharedMemoryHeap::Span> span) {
   DCHECK(!IsInFreeList(span.get()));
-  size_t index = std::min(span->length_, std::size(free_spans_)) - 1;
+  size_t index = std::min(span->num_blocks_, std::size(free_spans_)) - 1;
 
   free_spans_[index].Append(span.release());
 }
@@ -349,13 +361,13 @@
 DiscardableSharedMemoryHeap::Carve(Span* span, size_t blocks) {
   std::unique_ptr<Span> serving = RemoveFromFreeList(span);
 
-  const size_t extra = serving->length_ - blocks;
+  const size_t extra = serving->num_blocks_ - blocks;
   if (extra) {
-    std::unique_ptr<Span> leftover(new Span(serving->shared_memory_,
-                                            serving->start_ + blocks, extra,
-                                            serving->memory_segment_));
+    std::unique_ptr<Span> leftover(new Span(serving->shared_memory_.get(),
+                                            serving->first_block_ + blocks,
+                                            extra, serving->memory_segment_));
     leftover->set_is_locked(false);
-    DCHECK(extra == 1 || spans_.find(leftover->start_) == spans_.end());
+    CHECK(extra == 1u || spans_.find(SpanBeginKey(*leftover)) == spans_.end());
     RegisterSpan(leftover.get());
 
     // No need to coalesce as the previous span of |leftover| was just split
@@ -363,46 +375,42 @@
     // |span|.
     InsertIntoFreeList(std::move(leftover));
 
-    serving->length_ = blocks;
-    spans_[serving->start_ + blocks - 1] = serving.get();
+    serving->num_blocks_ = blocks;
+    spans_[SpanEndKey(*serving)] = serving.get();
   }
 
   // |serving| is no longer in the free list, remove its length from
   // |num_free_blocks_|.
-  DCHECK_GE(num_free_blocks_, serving->length_);
-  num_free_blocks_ -= serving->length_;
+  CHECK_GE(num_free_blocks_, serving->num_blocks_);
+  num_free_blocks_ -= serving->num_blocks_;
 
   return serving;
 }
 
 void DiscardableSharedMemoryHeap::RegisterSpan(Span* span) {
-  spans_[span->start_] = span;
-  if (span->length_ > 1)
-    spans_[span->start_ + span->length_ - 1] = span;
+  spans_[SpanBeginKey(*span)] = span;
+  if (span->num_blocks_ > 1u) {
+    spans_[SpanEndKey(*span)] = span;
+  }
 }
 
 void DiscardableSharedMemoryHeap::UnregisterSpan(Span* span) {
-  DCHECK(spans_.find(span->start_) != spans_.end());
-  DCHECK_EQ(spans_[span->start_], span);
-  spans_.erase(span->start_);
-  if (span->length_ > 1) {
-    DCHECK(spans_.find(span->start_ + span->length_ - 1) != spans_.end());
-    DCHECK_EQ(spans_[span->start_ + span->length_ - 1], span);
-    spans_.erase(span->start_ + span->length_ - 1);
+  CHECK_EQ(spans_[SpanBeginKey(*span)], span);
+  spans_.erase(SpanBeginKey(*span));
+  if (span->num_blocks_ > 1u) {
+    CHECK_EQ(spans_[SpanEndKey(*span)], span);
+    spans_.erase(SpanEndKey(*span));
   }
 }
 
 bool DiscardableSharedMemoryHeap::IsMemoryUsed(
     const base::DiscardableSharedMemory* shared_memory,
     size_t size) {
-  size_t offset =
-      reinterpret_cast<size_t>(shared_memory->memory()) / block_size_;
-  size_t length = size / block_size_;
-  DCHECK(spans_.find(offset) != spans_.end());
-  Span* span = spans_[offset];
-  DCHECK_LE(span->length_, length);
+  size_t blocks = size / block_size_;
+  Span* span = spans_[{shared_memory, 0u}];
+  CHECK_LE(span->num_blocks_, blocks);
   // Memory is used if first span is not in free list or shorter than segment.
-  return !IsInFreeList(span) || span->length_ != length;
+  return !IsInFreeList(span) || span->num_blocks_ != blocks;
 }
 
 bool DiscardableSharedMemoryHeap::IsMemoryResident(
@@ -413,25 +421,22 @@
 void DiscardableSharedMemoryHeap::ReleaseMemory(
     const base::DiscardableSharedMemory* shared_memory,
     size_t size) {
-  size_t offset =
-      reinterpret_cast<size_t>(shared_memory->memory()) / block_size_;
-  size_t end = offset + size / block_size_;
+  size_t offset = 0u;
+  size_t end = size / block_size_;
   while (offset < end) {
-    DCHECK(spans_.find(offset) != spans_.end());
-    Span* span = spans_[offset];
-    DCHECK_EQ(span->shared_memory_, shared_memory);
-    span->shared_memory_ = nullptr;
+    Span* span = spans_[{shared_memory, offset}];
     UnregisterSpan(span);
+    span->shared_memory_ = nullptr;
 
-    offset += span->length_;
+    offset += span->num_blocks_;
 
-    DCHECK_GE(num_blocks_, span->length_);
-    num_blocks_ -= span->length_;
+    CHECK_GE(num_blocks_, span->num_blocks_);
+    num_blocks_ -= span->num_blocks_;
 
     // If |span| is in the free list, remove it and update |num_free_blocks_|.
     if (IsInFreeList(span)) {
-      DCHECK_GE(num_free_blocks_, span->length_);
-      num_free_blocks_ -= span->length_;
+      DCHECK_GE(num_free_blocks_, span->num_blocks_);
+      num_free_blocks_ -= span->num_blocks_;
       RemoveFromFreeList(span);
     }
   }
@@ -442,20 +447,19 @@
     size_t size,
     int32_t segment_id,
     base::trace_event::ProcessMemoryDump* pmd) {
-  size_t allocated_objects_count = 0;
-  size_t allocated_objects_size_in_blocks = 0;
-  size_t locked_objects_size_in_blocks = 0;
-  size_t offset =
-      reinterpret_cast<size_t>(shared_memory->memory()) / block_size_;
-  size_t end = offset + size / block_size_;
+  size_t allocated_objects_count = 0u;
+  size_t allocated_objects_size_in_blocks = 0u;
+  size_t locked_objects_size_in_blocks = 0u;
+  size_t offset = 0u;
+  size_t end = size / block_size_;
   while (offset < end) {
-    Span* span = spans_[offset];
+    Span* span = spans_[{shared_memory, offset}];
     if (!IsInFreeList(span)) {
-      allocated_objects_size_in_blocks += span->length_;
-      locked_objects_size_in_blocks += span->is_locked_ ? span->length_ : 0;
+      allocated_objects_size_in_blocks += span->num_blocks_;
+      locked_objects_size_in_blocks += span->is_locked_ ? span->num_blocks_ : 0;
       allocated_objects_count++;
     }
-    offset += span->length_;
+    offset += span->num_blocks_;
   }
   size_t allocated_objects_size_in_bytes =
       allocated_objects_size_in_blocks * block_size_;
@@ -505,8 +509,20 @@
       [span](const std::unique_ptr<ScopedMemorySegment>& segment) {
         return segment->ContainsSpan(span);
       });
-  DCHECK(it != memory_segments_.end());
+  CHECK(it != memory_segments_.end());
   return (*it)->CreateMemoryAllocatorDump(span, block_size_, name, pmd);
 }
 
+// static
+std::pair<const base::DiscardableSharedMemory*, size_t>
+DiscardableSharedMemoryHeap::SpanBeginKey(const Span& span) {
+  return {span.shared_memory_.get(), span.first_block_};
+}
+
+// static
+std::pair<const base::DiscardableSharedMemory*, size_t>
+DiscardableSharedMemoryHeap::SpanEndKey(const Span& span) {
+  return {span.shared_memory_.get(), span.first_block_ + span.num_blocks_ - 1u};
+}
+
 }  // namespace discardable_memory
diff --git a/components/discardable_memory/common/discardable_shared_memory_heap.h b/components/discardable_memory/common/discardable_shared_memory_heap.h
index bb677a46..7bdbc81 100644
--- a/components/discardable_memory/common/discardable_shared_memory_heap.h
+++ b/components/discardable_memory/common/discardable_shared_memory_heap.h
@@ -2,18 +2,24 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#ifdef UNSAFE_BUFFERS_BUILD
+#pragma check_unsafe_buffers
+#endif
+
 #ifndef COMPONENTS_DISCARDABLE_MEMORY_COMMON_DISCARDABLE_SHARED_MEMORY_HEAP_H_
 #define COMPONENTS_DISCARDABLE_MEMORY_COMMON_DISCARDABLE_SHARED_MEMORY_HEAP_H_
 
 #include <stddef.h>
 #include <stdint.h>
 
+#include <array>
 #include <memory>
 #include <optional>
 #include <unordered_map>
 #include <vector>
 
 #include "base/containers/linked_list.h"
+#include "base/containers/span.h"
 #include "base/feature_list.h"
 #include "base/functional/callback.h"
 #include "base/memory/raw_ptr.h"
@@ -44,17 +50,21 @@
     ~Span() = default;
 
     base::DiscardableSharedMemory* shared_memory() { return shared_memory_; }
-    size_t start() const { return start_; }
-    size_t length() const { return length_; }
     void set_is_locked(bool is_locked) { is_locked_ = is_locked; }
 
+    size_t first_block() const { return first_block_; }
+    size_t num_blocks() const { return num_blocks_; }
+
+    // The bytes of memory in `shared_memory()` that are covered by this Span.
+    base::span<uint8_t> memory() const;
+
     ScopedMemorySegment* GetScopedMemorySegmentForTesting() const;
 
    private:
     friend class DiscardableSharedMemoryHeap;
 
     Span(base::DiscardableSharedMemory* shared_memory,
-         size_t start,
+         size_t first_block,
          size_t length,
          DiscardableSharedMemoryHeap::ScopedMemorySegment* memory_segment);
 
@@ -62,9 +72,9 @@
                   DanglingUntriaged>
         memory_segment_;
     raw_ptr<base::DiscardableSharedMemory> shared_memory_;
-    size_t start_;
-    size_t length_;
-    bool is_locked_;
+    size_t first_block_;
+    size_t num_blocks_;
+    bool is_locked_ = false;
   };
 
   DiscardableSharedMemoryHeap();
@@ -185,6 +195,11 @@
                     int32_t segment_id,
                     base::trace_event::ProcessMemoryDump* pmd);
 
+  static std::pair<const base::DiscardableSharedMemory*, size_t> SpanBeginKey(
+      const Span& span);
+  static std::pair<const base::DiscardableSharedMemory*, size_t> SpanEndKey(
+      const Span& span);
+
   const size_t block_size_;
   size_t num_blocks_ = 0;
   size_t num_free_blocks_ = 0;
@@ -192,15 +207,17 @@
   // Vector of memory segments.
   std::vector<std::unique_ptr<ScopedMemorySegment>> memory_segments_;
 
-  // Mapping from first/last block of span to Span instance.
-  typedef std::unordered_map<size_t, Span*> SpanMap;
+  // Mapping from first/last block of region of DiscardableSharedMemory to a
+  // Span instance.
+  using SpanMap =
+      std::map<std::pair<const base::DiscardableSharedMemory*, size_t>, Span*>;
   SpanMap spans_;
 
   // Array of linked-lists with free discardable memory regions. For i < 256,
   // where the 1st entry is located at index 0 of the array, the kth entry
   // is a free list of runs that consist of k blocks. The 256th entry is a
   // free list of runs that have length >= 256 blocks.
-  base::LinkedList<Span> free_spans_[256];
+  std::array<base::LinkedList<Span>, 256> free_spans_;
 };
 
 }  // namespace discardable_memory
diff --git a/components/discardable_memory/common/discardable_shared_memory_heap_perftest.cc b/components/discardable_memory/common/discardable_shared_memory_heap_perftest.cc
index 36d8030a..78b6672c 100644
--- a/components/discardable_memory/common/discardable_shared_memory_heap_perftest.cc
+++ b/components/discardable_memory/common/discardable_shared_memory_heap_perftest.cc
@@ -5,7 +5,9 @@
 #include "components/discardable_memory/common/discardable_shared_memory_heap.h"
 
 #include <stddef.h>
+
 #include <algorithm>
+#include <array>
 #include <cmath>
 #include <cstdlib>
 #include <memory>
@@ -49,8 +51,8 @@
   srand(kSeed);
 
   // Pre-compute random values.
-  int random_span[kTimeCheckInterval];
-  size_t random_blocks[kTimeCheckInterval];
+  std::array<int, kTimeCheckInterval> random_span;
+  std::array<size_t, kTimeCheckInterval> random_blocks;
   for (int i = 0; i < kTimeCheckInterval; ++i) {
     random_span[i] = std::rand();
     // Exponentially distributed block size.
diff --git a/components/discardable_memory/service/discardable_shared_memory_manager.cc b/components/discardable_memory/service/discardable_shared_memory_manager.cc
index b351eddd..f5573aa 100644
--- a/components/discardable_memory/service/discardable_shared_memory_manager.cc
+++ b/components/discardable_memory/service/discardable_shared_memory_manager.cc
@@ -2,6 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#ifdef UNSAFE_BUFFERS_BUILD
+#pragma check_unsafe_buffers
+#endif
+
 #include "components/discardable_memory/service/discardable_shared_memory_manager.h"
 
 #include <algorithm>
@@ -129,7 +133,7 @@
   }
   void* data() const override {
     DCHECK(is_locked_);
-    return shared_memory_->memory();
+    return shared_memory_->memory().data();
   }
 
   void DiscardForTesting() override {
diff --git a/components/discardable_memory/service/discardable_shared_memory_manager.h b/components/discardable_memory/service/discardable_shared_memory_manager.h
index 7f16cff..8316564 100644
--- a/components/discardable_memory/service/discardable_shared_memory_manager.h
+++ b/components/discardable_memory/service/discardable_shared_memory_manager.h
@@ -2,6 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#ifdef UNSAFE_BUFFERS_BUILD
+#pragma check_unsafe_buffers
+#endif
+
 #ifndef COMPONENTS_DISCARDABLE_MEMORY_SERVICE_DISCARDABLE_SHARED_MEMORY_MANAGER_H_
 #define COMPONENTS_DISCARDABLE_MEMORY_SERVICE_DISCARDABLE_SHARED_MEMORY_MANAGER_H_
 
diff --git a/components/discardable_memory/service/discardable_shared_memory_manager_unittest.cc b/components/discardable_memory/service/discardable_shared_memory_manager_unittest.cc
index 8d3f863..988b34a 100644
--- a/components/discardable_memory/service/discardable_shared_memory_manager_unittest.cc
+++ b/components/discardable_memory/service/discardable_shared_memory_manager_unittest.cc
@@ -97,12 +97,12 @@
   bool rv = memory.Map(kDataSize);
   ASSERT_TRUE(rv);
 
-  memcpy(memory.memory(), data, kDataSize);
+  memory.memory().copy_from(data);
   memory.SetNow(base::Time::FromSecondsSinceUnixEpoch(1));
   memory.Unlock(0, 0);
 
   ASSERT_EQ(base::DiscardableSharedMemory::SUCCESS, memory.Lock(0, 0));
-  EXPECT_EQ(memcmp(data, memory.memory(), kDataSize), 0);
+  EXPECT_EQ(data, memory.memory());
   memory.Unlock(0, 0);
 }
 
diff --git a/components/facilitated_payments/core/browser/facilitated_payments_manager_unittest.cc b/components/facilitated_payments/core/browser/facilitated_payments_manager_unittest.cc
index e14c20b6..7b41b3fa 100644
--- a/components/facilitated_payments/core/browser/facilitated_payments_manager_unittest.cc
+++ b/components/facilitated_payments/core/browser/facilitated_payments_manager_unittest.cc
@@ -155,7 +155,8 @@
     api_client_ = nullptr;
     allowlist_decision_timer_.Stop();
     page_load_timer_.Stop();
-    personal_data_manager_->ClearAllServerDataForTesting();
+    personal_data_manager_->payments_data_manager()
+        .ClearAllServerDataForTesting();
     personal_data_manager_.reset();
   }
 
diff --git a/components/metrics/BUILD.gn b/components/metrics/BUILD.gn
index 7d80829..0c05342 100644
--- a/components/metrics/BUILD.gn
+++ b/components/metrics/BUILD.gn
@@ -139,6 +139,8 @@
       "histogram_controller.cc",
       "histogram_controller.h",
       "histogram_subscriber.h",
+      "install_date_provider.cc",
+      "install_date_provider.h",
       "log_decoder.cc",
       "log_decoder.h",
       "log_store.h",
diff --git a/components/metrics/install_date_provider.cc b/components/metrics/install_date_provider.cc
new file mode 100644
index 0000000..925da2a
--- /dev/null
+++ b/components/metrics/install_date_provider.cc
@@ -0,0 +1,36 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/metrics/install_date_provider.h"
+
+#include "base/logging.h"
+#include "components/metrics/metrics_pref_names.h"
+#include "components/prefs/pref_service.h"
+
+namespace metrics {
+
+namespace {
+
+// The following two methods are copied from metrics_state_manager.cc, but are
+// simple enough it's not really needed to reuse.
+int64_t ReadInstallDate(PrefService* local_state) {
+  return local_state->GetInt64(prefs::kInstallDate);
+}
+
+// Round a timestamp measured in seconds since epoch to one with a granularity
+// of an hour. This can be used before uploaded potentially sensitive
+// timestamps.
+int64_t RoundSecondsToHour(int64_t time_in_seconds) {
+  return 3600 * (time_in_seconds / 3600);
+}
+
+}  // namespace
+
+void InstallDateProvider::ProvideSystemProfileMetrics(
+    SystemProfileProto* system_profile_proto) {
+  system_profile_proto->set_install_date(
+      RoundSecondsToHour(ReadInstallDate(local_state_)));
+}
+
+}  // namespace metrics
diff --git a/components/metrics/install_date_provider.h b/components/metrics/install_date_provider.h
new file mode 100644
index 0000000..0c36ead
--- /dev/null
+++ b/components/metrics/install_date_provider.h
@@ -0,0 +1,45 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_METRICS_INSTALL_DATE_PROVIDER_H_
+#define COMPONENTS_METRICS_INSTALL_DATE_PROVIDER_H_
+
+#include "base/memory/raw_ptr.h"
+#include "components/metrics/metrics_provider.h"
+#include "third_party/metrics_proto/system_profile.pb.h"
+
+class PrefService;
+
+// NOTE: This Provider is unfortunately entwined with the MetricsStateManager.
+// The MetricsStateManager actually controls the state of the pref which keeps
+// track of the install state, and also will set it.
+// Since the MetricsStateManager does quite a bit of other work, and it is
+// complex to disentangle, this provider is available if we just want the
+// install_date to be set (currently for UKM).
+// This means this Provider is *NOT* used in UMA.
+// In the longer term, we should refactor MetricsStateManager such that
+// the parts that are eligible for UKM can be reused.
+namespace metrics {
+
+// Provides the install date.
+class InstallDateProvider : public MetricsProvider {
+ public:
+  explicit InstallDateProvider(PrefService* local_state)
+      : local_state_(local_state) {}
+
+  InstallDateProvider(const InstallDateProvider&) = delete;
+  InstallDateProvider& operator=(const InstallDateProvider&) = delete;
+
+  ~InstallDateProvider() override = default;
+
+  // MetricsProvider:
+  void ProvideSystemProfileMetrics(
+      SystemProfileProto* system_profile_proto) override;
+
+  raw_ptr<PrefService> local_state_;
+};
+
+}  // namespace metrics
+
+#endif  // COMPONENTS_METRICS_INSTALL_DATE_PROVIDER_H_
diff --git a/components/page_image_service/image_service_impl.cc b/components/page_image_service/image_service_impl.cc
index 87bd7f6..d095498 100644
--- a/components/page_image_service/image_service_impl.cc
+++ b/components/page_image_service/image_service_impl.cc
@@ -223,7 +223,8 @@
   switch (client_id) {
     case mojom::ClientId::Journeys:
     case mojom::ClientId::JourneysSidePanel:
-    case mojom::ClientId::NtpQuests: {
+    case mojom::ClientId::NtpQuests:
+    case mojom::ClientId::NtpTabResumption: {
       return history_consent_helper_->EnqueueRequest(std::move(callback),
                                                      client_id);
     }
@@ -357,7 +358,8 @@
       break;
     }
     case mojom::ClientId::NtpQuests:
-    case mojom::ClientId::NtpRealbox: {
+    case mojom::ClientId::NtpRealbox:
+    case mojom::ClientId::NtpTabResumption: {
       request_context = optimization_guide::proto::CONTEXT_NEW_TAB_PAGE;
       break;
     }
diff --git a/components/page_image_service/image_service_impl_unittest.cc b/components/page_image_service/image_service_impl_unittest.cc
index ef73213..e4383ca 100644
--- a/components/page_image_service/image_service_impl_unittest.cc
+++ b/components/page_image_service/image_service_impl_unittest.cc
@@ -172,6 +172,9 @@
             PageImageServiceConsentStatus::kTimedOut);
   EXPECT_EQ(GetConsentStatusToFetchImageAwaitResult(mojom::ClientId::Bookmarks),
             PageImageServiceConsentStatus::kTimedOut);
+  EXPECT_EQ(GetConsentStatusToFetchImageAwaitResult(
+                mojom::ClientId::NtpTabResumption),
+            PageImageServiceConsentStatus::kTimedOut);
 
   test_sync_service_->SetDownloadStatusFor(
       {syncer::ModelType::HISTORY_DELETE_DIRECTIVES},
@@ -191,6 +194,9 @@
             PageImageServiceConsentStatus::kSuccess);
   EXPECT_EQ(GetConsentStatusToFetchImageAwaitResult(mojom::ClientId::Bookmarks),
             PageImageServiceConsentStatus::kTimedOut);
+  EXPECT_EQ(GetConsentStatusToFetchImageAwaitResult(
+                mojom::ClientId::NtpTabResumption),
+            PageImageServiceConsentStatus::kSuccess);
 }
 
 TEST_F(ImageServiceImplTest, SyncInitialization) {
diff --git a/components/page_image_service/metrics_util.cc b/components/page_image_service/metrics_util.cc
index 78f28ca4..01e2db1 100644
--- a/components/page_image_service/metrics_util.cc
+++ b/components/page_image_service/metrics_util.cc
@@ -18,6 +18,8 @@
       return "NtpQuests";
     case mojom::ClientId::Bookmarks:
       return "Bookmarks";
+    case mojom::ClientId::NtpTabResumption:
+      return "NtpTabResumption";
       // No default case and no final statement, so that the compiler will force
       // developers to update this function if the ClientId enum is updated.
       // Developers must ALSO update the PageImageServiceClientId variants in
diff --git a/components/page_image_service/mojom/page_image_service.mojom b/components/page_image_service/mojom/page_image_service.mojom
index ca9d6956..f343027 100644
--- a/components/page_image_service/mojom/page_image_service.mojom
+++ b/components/page_image_service/mojom/page_image_service.mojom
@@ -17,6 +17,9 @@
 
   // Tracked at launch/4225832.
   Bookmarks,
+
+  // Tracked at launch/4279123.
+  NtpTabResumption,
 };
 
 // Options for image fetching.
diff --git a/components/password_manager/core/browser/hash_password_manager.cc b/components/password_manager/core/browser/hash_password_manager.cc
index a8e310c83..fd819d1 100644
--- a/components/password_manager/core/browser/hash_password_manager.cc
+++ b/components/password_manager/core/browser/hash_password_manager.cc
@@ -424,7 +424,9 @@
   base::Value::List& update_list = update.Get();
   base::Value::List& enterprise_update_list = enterprise_update.Get();
   for (auto it = update_list.begin(); it != update_list.end();) {
-    if (!IsGaiaPassword(*it)) {
+    if (!IsGaiaPassword(*it) &&
+        base::FeatureList::IsEnabled(
+            features::kLocalStateEnterprisePasswordHashes)) {
       enterprise_update_list.Append(std::move(it->GetDict()));
       it = update_list.erase(it);
       continue;
diff --git a/components/password_manager/core/browser/hash_password_manager_unittest.cc b/components/password_manager/core/browser/hash_password_manager_unittest.cc
index 5c3eb6f..5f5b0b23 100644
--- a/components/password_manager/core/browser/hash_password_manager_unittest.cc
+++ b/components/password_manager/core/browser/hash_password_manager_unittest.cc
@@ -436,6 +436,35 @@
 }
 
 TEST_F(HashPasswordManagerTest,
+       EnterprisePasswordHashesAreNotMigratedToLocalState) {
+  scoped_feature_list_.InitAndDisableFeature(
+      password_manager::features::kLocalStateEnterprisePasswordHashes);
+  HashPasswordManager hash_password_manager;
+  hash_password_manager.set_prefs(&prefs_);
+  hash_password_manager.set_local_prefs(&local_prefs_);
+
+  std::u16string password(u"password");
+  PasswordHashData phd1("user1", password, /*force_update=*/true);
+  PasswordHashData phd2("user2", password, /*force_update=*/true,
+                        /*is_gaia_password=*/false);
+  PasswordHashData phd3("user3", password, /*force_update=*/true);
+  PasswordHashData phd4("user4", password, /*force_update=*/true,
+                        /*is_gaia_password=*/false);
+  EncryptAndSave(phd1, &prefs_, prefs::kPasswordHashDataList);
+  EncryptAndSave(phd2, &prefs_, prefs::kPasswordHashDataList);
+  EncryptAndSave(phd3, &prefs_, prefs::kPasswordHashDataList);
+  EncryptAndSave(phd4, &prefs_, prefs::kPasswordHashDataList);
+
+  // Verify that all password hashes are saved under the profile pref.
+  EXPECT_EQ(4u, prefs_.GetList(prefs::kPasswordHashDataList).size());
+  // Try migrating enterprise password hashes to the local state pref.
+  hash_password_manager.MigrateEnterprisePasswordHashes();
+  // Verify that enterprise password hashes have not been moved.
+  EXPECT_EQ(4u, prefs_.GetList(prefs::kPasswordHashDataList).size());
+  EXPECT_EQ(0u, local_prefs_.GetList(prefs::kLocalPasswordHashDataList).size());
+}
+
+TEST_F(HashPasswordManagerTest,
        EnterprisePasswordHashesAreMigratedToLocalState) {
   scoped_feature_list_.InitAndEnableFeature(
       password_manager::features::kLocalStateEnterprisePasswordHashes);
diff --git a/components/password_manager/core/browser/password_suggestion_generator.cc b/components/password_manager/core/browser/password_suggestion_generator.cc
index 8774d8d..0fa16e8 100644
--- a/components/password_manager/core/browser/password_suggestion_generator.cc
+++ b/components/password_manager/core/browser/password_suggestion_generator.cc
@@ -27,6 +27,8 @@
 namespace {
 
 using affiliations::FacetURI;
+using autofill::Suggestion;
+using autofill::SuggestionType;
 
 constexpr char16_t kPasswordReplacementChar = 0x2022;
 
@@ -61,146 +63,138 @@
 // Returns a string representing the icon of either the account store or the
 // local password store.
 #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
-autofill::Suggestion::Icon CreateStoreIcon(bool for_account_store) {
-  return for_account_store ? autofill::Suggestion::Icon::kGoogle
-                           : autofill::Suggestion::Icon::kNoIcon;
+Suggestion::Icon CreateStoreIcon(bool for_account_store) {
+  return for_account_store ? Suggestion::Icon::kGoogle
+                           : Suggestion::Icon::kNoIcon;
 }
 #endif
 
 #if !BUILDFLAG(IS_ANDROID)
-autofill::Suggestion CreateWebAuthnEntry(bool listed_passkeys) {
-  autofill::Suggestion suggestion(l10n_util::GetStringUTF16(
-      listed_passkeys ? IDS_PASSWORD_MANAGER_USE_DIFFERENT_PASSKEY
-                      : IDS_PASSWORD_MANAGER_USE_PASSKEY));
-  suggestion.icon = autofill::Suggestion::Icon::kDevice;
-  suggestion.type = autofill::SuggestionType::kWebauthnSignInWithAnotherDevice;
-  return suggestion;
+Suggestion CreateWebAuthnEntry(bool listed_passkeys) {
+  return Suggestion(
+      l10n_util::GetStringUTF8(listed_passkeys
+                                   ? IDS_PASSWORD_MANAGER_USE_DIFFERENT_PASSKEY
+                                   : IDS_PASSWORD_MANAGER_USE_PASSKEY),
+      /*label=*/"", Suggestion::Icon::kDevice,
+      SuggestionType::kWebauthnSignInWithAnotherDevice);
 }
 #endif  // !BUILDFLAG(IS_ANDROID)
 
-autofill::Suggestion CreateGenerationEntry() {
-  autofill::Suggestion suggestion(
-      l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_GENERATE_PASSWORD));
+Suggestion CreateGenerationEntry() {
   // The UI code will pick up an icon from the resources based on the string.
-  suggestion.icon = autofill::Suggestion::Icon::kKey;
-  suggestion.type = autofill::SuggestionType::kGeneratePasswordEntry;
-  return suggestion;
+  return Suggestion(
+      l10n_util::GetStringUTF8(IDS_PASSWORD_MANAGER_GENERATE_PASSWORD),
+      /*label=*/"", Suggestion::Icon::kKey,
+      SuggestionType::kGeneratePasswordEntry);
 }
 
 // Entry for opting in to password account storage and then filling.
-autofill::Suggestion CreateEntryToOptInToAccountStorageThenFill() {
+Suggestion CreateEntryToOptInToAccountStorageThenFill() {
   bool has_passkey_sync = false;
 #if !BUILDFLAG(IS_ANDROID)
   has_passkey_sync =
       base::FeatureList::IsEnabled(syncer::kSyncWebauthnCredentials);
 #endif
-  autofill::Suggestion suggestion(l10n_util::GetStringUTF16(
-      has_passkey_sync
-          ? IDS_PASSWORD_MANAGER_OPT_INTO_ACCOUNT_STORE_WITH_PASSKEYS
-          : IDS_PASSWORD_MANAGER_OPT_INTO_ACCOUNT_STORE));
-  suggestion.type = autofill::SuggestionType::kPasswordAccountStorageOptIn;
-  suggestion.icon = autofill::Suggestion::Icon::kGoogle;
-  return suggestion;
+  return Suggestion(
+      l10n_util::GetStringUTF8(
+          has_passkey_sync
+              ? IDS_PASSWORD_MANAGER_OPT_INTO_ACCOUNT_STORE_WITH_PASSKEYS
+              : IDS_PASSWORD_MANAGER_OPT_INTO_ACCOUNT_STORE),
+      /*label=*/"", Suggestion::Icon::kGoogle,
+      SuggestionType::kPasswordAccountStorageOptIn);
 }
 
 // Entry for opting in to password account storage and then generating password.
-autofill::Suggestion CreateEntryToOptInToAccountStorageThenGenerate() {
-  autofill::Suggestion suggestion(
-      l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_GENERATE_PASSWORD));
-  suggestion.type =
-      autofill::SuggestionType::kPasswordAccountStorageOptInAndGenerate;
-  suggestion.icon = autofill::Suggestion::Icon::kKey;
-  return suggestion;
+Suggestion CreateEntryToOptInToAccountStorageThenGenerate() {
+  return Suggestion(
+      l10n_util::GetStringUTF8(IDS_PASSWORD_MANAGER_GENERATE_PASSWORD),
+      /*label=*/"", Suggestion::Icon::kKey,
+      SuggestionType::kPasswordAccountStorageOptInAndGenerate);
 }
 
 // Entry for sigining in again which unlocks the password account storage.
-autofill::Suggestion CreateEntryToReSignin() {
-  autofill::Suggestion suggestion(
-      l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_RE_SIGNIN_ACCOUNT_STORE));
-  suggestion.type = autofill::SuggestionType::kPasswordAccountStorageReSignin;
-  suggestion.icon = autofill::Suggestion::Icon::kGoogle;
-  return suggestion;
+Suggestion CreateEntryToReSignin() {
+  return Suggestion(
+      l10n_util::GetStringUTF8(IDS_PASSWORD_MANAGER_RE_SIGNIN_ACCOUNT_STORE),
+      /*label=*/"", Suggestion::Icon::kGoogle,
+      SuggestionType::kPasswordAccountStorageReSignin);
 }
 
-void MaybeAppendManagePasswordsEntry(
-    std::vector<autofill::Suggestion>* suggestions) {
+void MaybeAppendManagePasswordsEntry(std::vector<Suggestion>* suggestions) {
   bool has_no_fillable_suggestions = base::ranges::none_of(
       *suggestions,
-      [](autofill::SuggestionType id) {
-        return id == autofill::SuggestionType::kPasswordEntry ||
-               id == autofill::SuggestionType::kAccountStoragePasswordEntry ||
-               id == autofill::SuggestionType::kGeneratePasswordEntry ||
-               id == autofill::SuggestionType::kWebauthnCredential;
+      [](SuggestionType id) {
+        return id == SuggestionType::kPasswordEntry ||
+               id == SuggestionType::kAccountStoragePasswordEntry ||
+               id == SuggestionType::kGeneratePasswordEntry ||
+               id == SuggestionType::kWebauthnCredential;
       },
-      &autofill::Suggestion::type);
+      &Suggestion::type);
   if (has_no_fillable_suggestions) {
     return;
   }
 
   bool has_webauthn_credential = base::ranges::any_of(
       *suggestions,
-      [](autofill::SuggestionType type) {
-        return type == autofill::SuggestionType::kWebauthnCredential;
+      [](SuggestionType type) {
+        return type == SuggestionType::kWebauthnCredential;
       },
-      &autofill::Suggestion::type);
+      &Suggestion::type);
 
   // Add a separator before the manage option unless there are no suggestions
   // yet.
   if (!suggestions->empty()) {
-    suggestions->emplace_back(autofill::SuggestionType::kSeparator);
+    suggestions->emplace_back(SuggestionType::kSeparator);
   }
 
-  autofill::Suggestion suggestion(l10n_util::GetStringUTF16(
-      has_webauthn_credential
-          ? IDS_PASSWORD_MANAGER_MANAGE_PASSWORDS_AND_PASSKEYS
-          : IDS_PASSWORD_MANAGER_MANAGE_PASSWORDS));
-  suggestion.type = autofill::SuggestionType::kAllSavedPasswordsEntry;
-  suggestion.icon = autofill::Suggestion::Icon::kSettings;
+  Suggestion suggestion(
+      l10n_util::GetStringUTF8(
+          has_webauthn_credential
+              ? IDS_PASSWORD_MANAGER_MANAGE_PASSWORDS_AND_PASSKEYS
+              : IDS_PASSWORD_MANAGER_MANAGE_PASSWORDS),
+      /*label=*/"", Suggestion::Icon::kSettings,
+      SuggestionType::kAllSavedPasswordsEntry);
   // The UI code will pick up an icon from the resources based on the string.
-  suggestion.trailing_icon = autofill::Suggestion::Icon::kGooglePasswordManager;
+  suggestion.trailing_icon = Suggestion::Icon::kGooglePasswordManager;
   suggestions->emplace_back(std::move(suggestion));
 }
 
 // If |field_suggestion| matches |field_content|, creates a Suggestion out of it
 // and appends to |suggestions|.
-void AppendSuggestionIfMatching(
-    const std::u16string& field_suggestion,
-    const std::u16string& field_contents,
-    const gfx::Image& custom_icon,
-    const std::string& signon_realm,
-    bool from_account_store,
-    size_t password_length,
-    std::vector<autofill::Suggestion>* suggestions) {
+void AppendSuggestionIfMatching(const std::u16string& field_suggestion,
+                                const std::u16string& field_contents,
+                                const gfx::Image& custom_icon,
+                                const std::string& signon_realm,
+                                bool from_account_store,
+                                size_t password_length,
+                                std::vector<Suggestion>* suggestions) {
   std::u16string lower_suggestion = base::i18n::ToLower(field_suggestion);
   std::u16string lower_contents = base::i18n::ToLower(field_contents);
   if (base::StartsWith(lower_suggestion, lower_contents,
                        base::CompareCase::SENSITIVE)) {
     bool replaced_username;
-    autofill::Suggestion suggestion(
+    Suggestion suggestion(
         ReplaceEmptyUsername(field_suggestion, &replaced_username));
     suggestion.main_text.is_primary =
-        autofill::Suggestion::Text::IsPrimary(!replaced_username);
-    suggestion.labels = {
-        {autofill::Suggestion::Text(GetHumanReadableRealm(signon_realm))}};
+        Suggestion::Text::IsPrimary(!replaced_username);
     suggestion.additional_label =
         std::u16string(password_length, kPasswordReplacementChar);
     suggestion.voice_over = l10n_util::GetStringFUTF16(
         IDS_PASSWORD_MANAGER_PASSWORD_FOR_ACCOUNT, suggestion.main_text.value);
-    if (!suggestion.labels.empty()) {
+    if (!signon_realm.empty()) {
       // The domainname is only shown for passwords with a common eTLD+1
       // but different subdomain.
-      DCHECK_EQ(suggestion.labels.size(), 1U);
-      DCHECK_EQ(suggestion.labels[0].size(), 1U);
+      suggestion.labels = {
+          {Suggestion::Text(GetHumanReadableRealm(signon_realm))}};
       *suggestion.voice_over += u", ";
       *suggestion.voice_over += suggestion.labels[0][0].value;
     }
-    suggestion.type =
-        from_account_store
-            ? autofill::SuggestionType::kAccountStoragePasswordEntry
-            : autofill::SuggestionType::kPasswordEntry;
+    suggestion.type = from_account_store
+                          ? SuggestionType::kAccountStoragePasswordEntry
+                          : SuggestionType::kPasswordEntry;
     suggestion.custom_icon = custom_icon;
     // The UI code will pick up an icon from the resources based on the string.
-    suggestion.icon = autofill::Suggestion::Icon::kGlobe;
+    suggestion.icon = Suggestion::Icon::kGlobe;
 #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
     if (!base::FeatureList::IsEnabled(
             password_manager::features::kButterOnDesktopFollowup)) {
@@ -216,7 +210,7 @@
 void GetSuggestions(const autofill::PasswordFormFillData& fill_data,
                     const std::u16string& current_username,
                     const gfx::Image& custom_icon,
-                    std::vector<autofill::Suggestion>* suggestions) {
+                    std::vector<Suggestion>* suggestions) {
   AppendSuggestionIfMatching(
       fill_data.preferred_login.username_value, current_username, custom_icon,
       fill_data.preferred_login.realm,
@@ -232,69 +226,68 @@
   }
 
   std::sort(suggestions->begin() + prefered_match, suggestions->end(),
-            [](const autofill::Suggestion& a, const autofill::Suggestion& b) {
+            [](const Suggestion& a, const Suggestion& b) {
               return a.main_text.value < b.main_text.value;
             });
 }
 
 void AddPasswordUsernameChildSuggestion(const std::u16string& username,
-                                        autofill::Suggestion& suggestion) {
+                                        Suggestion& suggestion) {
   suggestion.children.emplace_back(
-      username, autofill::SuggestionType::kPasswordFieldByFieldFilling);
+      username, SuggestionType::kPasswordFieldByFieldFilling);
 }
 
-void AddFillPasswordChildSuggestion(autofill::Suggestion& suggestion,
+void AddFillPasswordChildSuggestion(Suggestion& suggestion,
                                     const CredentialUIEntry& credential,
                                     IsCrossDomain is_cross_origin) {
-  autofill::Suggestion fill_password(
+  Suggestion fill_password(
       l10n_util::GetStringUTF16(
           IDS_PASSWORD_MANAGER_MANUAL_FALLBACK_FILL_PASSWORD_ENTRY),
-      autofill::SuggestionType::kFillPassword);
-  fill_password.payload = autofill::Suggestion::PasswordSuggestionDetails(
+      SuggestionType::kFillPassword);
+  fill_password.payload = Suggestion::PasswordSuggestionDetails(
       credential.password,
       GetHumanReadableRealm(credential.GetFirstSignonRealm()),
       is_cross_origin.value());
   suggestion.children.emplace_back(std::move(fill_password));
 }
 
-void AddViewPasswordDetailsChildSuggestion(autofill::Suggestion& suggestion) {
-  autofill::Suggestion view_password_details(
+void AddViewPasswordDetailsChildSuggestion(Suggestion& suggestion) {
+  Suggestion view_password_details(
       l10n_util::GetStringUTF16(
           IDS_PASSWORD_MANAGER_MANUAL_FALLBACK_VIEW_DETAILS_ENTRY),
-      autofill::SuggestionType::kViewPasswordDetails);
-  view_password_details.icon = autofill::Suggestion::Icon::kKey;
+      SuggestionType::kViewPasswordDetails);
+  view_password_details.icon = Suggestion::Icon::kKey;
   suggestion.children.emplace_back(std::move(view_password_details));
 }
 
-void AppendManualFallbackSuggestions(
-    const CredentialUIEntry& credential,
-    IsTriggeredOnPasswordForm on_password_form,
-    IsCrossDomain is_cross_origin,
-    std::vector<autofill::Suggestion>* suggestions) {
+void AppendManualFallbackSuggestions(const CredentialUIEntry& credential,
+                                     IsTriggeredOnPasswordForm on_password_form,
+                                     IsCrossDomain is_cross_origin,
+                                     std::vector<Suggestion>* suggestions) {
   // A separate suggestion with the same (username, password) pair is displayed
   // for every affiliated domain. For example, if the credential was saved on
   // apple.com and icloud.com, there will be 2 suggestions for both of these
   // websites.
   for (const CredentialUIEntry::DomainInfo& domain_info :
        credential.GetAffiliatedDomains()) {
-    const std::u16string kDisplaySingonRealm =
-        base::UTF8ToUTF16(domain_info.name);
-    autofill::Suggestion suggestion(kDisplaySingonRealm,
-                                    autofill::SuggestionType::kPasswordEntry);
+    const std::string kDisplaySingonRealm = domain_info.name;
+    Suggestion suggestion(kDisplaySingonRealm, /*label=*/"",
+                          Suggestion::Icon::kGlobe,
+                          SuggestionType::kPasswordEntry);
     bool replaced;
     const std::u16string maybe_username =
         ReplaceEmptyUsername(credential.username, &replaced);
     suggestion.additional_label = maybe_username;
-    suggestion.icon = autofill::Suggestion::Icon::kGlobe;
-    suggestion.payload = autofill::Suggestion::PasswordSuggestionDetails(
-        credential.password, kDisplaySingonRealm, is_cross_origin.value());
+    suggestion.payload = Suggestion::PasswordSuggestionDetails(
+        credential.password, base::UTF8ToUTF16(kDisplaySingonRealm),
+        is_cross_origin.value());
     suggestion.is_acceptable = on_password_form.value();
 
     if (!replaced) {
       AddPasswordUsernameChildSuggestion(maybe_username, suggestion);
     }
     AddFillPasswordChildSuggestion(suggestion, credential, is_cross_origin);
-    suggestion.children.emplace_back(autofill::SuggestionType::kSeparator);
+    suggestion.children.emplace_back(SuggestionType::kSeparator);
     AddViewPasswordDetailsChildSuggestion(suggestion);
 
     suggestions->emplace_back(std::move(suggestion));
@@ -309,15 +302,14 @@
     : password_manager_driver_(password_manager_driver),
       password_client_{password_client} {}
 
-std::vector<autofill::Suggestion>
-PasswordSuggestionGenerator::GetSuggestionsForDomain(
+std::vector<Suggestion> PasswordSuggestionGenerator::GetSuggestionsForDomain(
     base::optional_ref<const autofill::PasswordFormFillData> fill_data,
     const gfx::Image& page_favicon,
     const std::u16string& username_filter,
     OffersGeneration offers_generation,
     ShowPasswordSuggestions show_password_suggestions,
     ShowWebAuthnCredentials show_webauthn_credentials) const {
-  std::vector<autofill::Suggestion> suggestions;
+  std::vector<Suggestion> suggestions;
   bool show_account_storage_optin =
       password_client_ && password_client_->GetPasswordFeatureManager()
                               ->ShouldShowAccountStorageOptIn();
@@ -342,14 +334,15 @@
     base::ranges::transform(
         *delegate->GetPasskeys(), std::back_inserter(suggestions),
         [&page_favicon](const auto& passkey) {
-          autofill::Suggestion suggestion(ToUsernameString(passkey.username()));
-          suggestion.icon = autofill::Suggestion::Icon::kGlobe;
-          suggestion.type = autofill::SuggestionType::kWebauthnCredential;
+          Suggestion suggestion(
+              base::UTF16ToUTF8(ToUsernameString(passkey.username())),
+              /*label=*/"", Suggestion::Icon::kGlobe,
+              SuggestionType::kWebauthnCredential);
           suggestion.custom_icon = page_favicon;
-          suggestion.payload = autofill::Suggestion::Guid(
-              base::Base64Encode(passkey.credential_id()));
+          suggestion.payload =
+              Suggestion::Guid(base::Base64Encode(passkey.credential_id()));
           suggestion.labels = {
-              {autofill::Suggestion::Text(passkey.GetAuthenticatorLabel())}};
+              {Suggestion::Text(passkey.GetAuthenticatorLabel())}};
           return suggestion;
         });
   }
@@ -399,19 +392,19 @@
   return suggestions;
 }
 
-std::vector<autofill::Suggestion>
+std::vector<Suggestion>
 PasswordSuggestionGenerator::GetManualFallbackSuggestions(
     base::span<const PasswordForm> suggested_credentials,
     base::span<const CredentialUIEntry> credentials,
     IsTriggeredOnPasswordForm on_password_form) const {
-  std::vector<autofill::Suggestion> suggestions;
+  std::vector<Suggestion> suggestions;
   const bool generate_sections =
       !suggested_credentials.empty() && !credentials.empty();
   if (generate_sections) {
     suggestions.emplace_back(
         l10n_util::GetStringUTF16(
             IDS_PASSWORD_MANAGER_MANUAL_FALLBACK_SUGGESTED_PASSWORDS_SECTION_TITLE),
-        autofill::SuggestionType::kTitle);
+        SuggestionType::kTitle);
   }
 
   std::set<std::string> suggested_signon_realms;
@@ -425,7 +418,7 @@
     suggestions.emplace_back(
         l10n_util::GetStringUTF16(
             IDS_PASSWORD_MANAGER_MANUAL_FALLBACK_ALL_PASSWORDS_SECTION_TITLE),
-        autofill::SuggestionType::kTitle);
+        SuggestionType::kTitle);
   }
 
   // Only the "All passwords" section should be sorted alphabetically.
@@ -445,11 +438,10 @@
                                     &suggestions);
   }
 
-  base::ranges::sort(suggestions.begin() + relevant_section_offset,
-                     suggestions.end(), base::ranges::less(),
-                     [](const autofill::Suggestion& suggestion) {
-                       return suggestion.main_text.value;
-                     });
+  base::ranges::sort(
+      suggestions.begin() + relevant_section_offset, suggestions.end(),
+      base::ranges::less(),
+      [](const Suggestion& suggestion) { return suggestion.main_text.value; });
 
   // Add "Manage all passwords" link to settings.
   MaybeAppendManagePasswordsEntry(&suggestions);
diff --git a/components/password_manager/core/browser/password_suggestion_generator_unittest.cc b/components/password_manager/core/browser/password_suggestion_generator_unittest.cc
index 0f86a54..32f17a4 100644
--- a/components/password_manager/core/browser/password_suggestion_generator_unittest.cc
+++ b/components/password_manager/core/browser/password_suggestion_generator_unittest.cc
@@ -6,13 +6,19 @@
 
 #include <vector>
 
+#include "base/base64.h"
+#include "base/strings/strcat.h"
 #include "components/autofill/core/browser/ui/suggestion.h"
 #include "components/autofill/core/browser/ui/suggestion_test_helpers.h"
 #include "components/autofill/core/common/autofill_test_utils.h"
 #include "components/autofill/core/common/password_form_fill_data.h"
+#include "components/password_manager/core/browser/features/password_features.h"
+#include "components/password_manager/core/browser/mock_password_feature_manager.h"
+#include "components/password_manager/core/browser/mock_webauthn_credentials_delegate.h"
 #include "components/password_manager/core/browser/password_manager_test_utils.h"
 #include "components/password_manager/core/browser/stub_password_manager_client.h"
 #include "components/password_manager/core/browser/stub_password_manager_driver.h"
+#include "components/sync/base/features.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "ui/gfx/image/image.h"
@@ -20,15 +26,68 @@
 
 namespace password_manager {
 
+namespace {
+
 using autofill::EqualsSuggestion;
+using autofill::PasswordAndMetadata;
 using autofill::PasswordFormFillData;
 using autofill::Suggestion;
 using autofill::SuggestionType;
 using testing::AllOf;
+using testing::Conditional;
 using testing::ElementsAre;
 using testing::Field;
+using testing::IsEmpty;
 using testing::Matcher;
+using testing::NiceMock;
+using testing::Return;
+using testing::ReturnRef;
 
+Matcher<Suggestion> EqualsDomainPasswordSuggestion(
+    SuggestionType id,
+    const std::u16string& main_text,
+    const std::u16string& additional_label,
+    const std::u16string& realm_label,
+    const gfx::Image& custom_icon,
+    Suggestion::Icon trailing_icon = Suggestion::Icon::kNoIcon) {
+  const std::u16string voice_over_suffix =
+      realm_label.empty() ? u"" : base::StrCat({u", ", realm_label});
+  return AllOf(
+      EqualsSuggestion(id, main_text, Suggestion::Icon::kGlobe),
+      Field("additional_label", &Suggestion::additional_label,
+            additional_label),
+      Field(
+          "labels", &Suggestion::labels,
+          Conditional(realm_label.empty(), IsEmpty(),
+                      ElementsAre(ElementsAre(Suggestion::Text(realm_label))))),
+      Field("voice_over", &Suggestion::voice_over,
+            Conditional(
+                realm_label.empty(),
+                l10n_util::GetStringFUTF16(
+                    IDS_PASSWORD_MANAGER_PASSWORD_FOR_ACCOUNT, main_text),
+                base::StrCat(
+                    {l10n_util::GetStringFUTF16(
+                         IDS_PASSWORD_MANAGER_PASSWORD_FOR_ACCOUNT, main_text),
+                     u", ", realm_label}))),
+      Field("custom_icon", &Suggestion::custom_icon, custom_icon),
+      Field("trailing_icon", &Suggestion::trailing_icon, trailing_icon));
+}
+
+Matcher<Suggestion> EqualsPasskeySuggestion(
+    const std::u16string& main_text,
+    const std::u16string& authenticator_label,
+    const gfx::Image& custom_icon,
+    const Suggestion::Payload& payload) {
+  return AllOf(
+      EqualsSuggestion(SuggestionType::kWebauthnCredential, main_text,
+                       Suggestion::Icon::kGlobe),
+      Field("labels", &Suggestion::labels,
+            ElementsAre(ElementsAre(Suggestion::Text(authenticator_label)))),
+      Field("custom_icon", &Suggestion::custom_icon, custom_icon),
+      Field("payload", &Suggestion::payload, payload));
+}
+
+#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
 Matcher<Suggestion> EqualsManualFallbackSuggestion(
     SuggestionType id,
     const std::u16string& main_text,
@@ -43,8 +102,42 @@
       Field("is_acceptable", &Suggestion::is_acceptable, is_acceptable),
       Field("payload", &Suggestion::payload, payload));
 }
+#endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
 
-Matcher<Suggestion> EqualsManageManagePasswordsSuggestion(
+Matcher<Suggestion> EqualsGeneratePasswordSuggestion() {
+  return EqualsSuggestion(
+      SuggestionType::kGeneratePasswordEntry,
+      l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_GENERATE_PASSWORD),
+      Suggestion::Icon::kKey);
+}
+
+Matcher<Suggestion> EqualsOptInToAccountThenGeneratePasswordSuggestion() {
+  return EqualsSuggestion(
+      SuggestionType::kPasswordAccountStorageOptInAndGenerate,
+      l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_GENERATE_PASSWORD),
+      Suggestion::Icon::kKey);
+}
+
+Matcher<Suggestion> EqualsEntryToOptInToAccountStorageThenFill(
+    bool has_passkey_sync) {
+  return EqualsSuggestion(
+      SuggestionType::kPasswordAccountStorageOptIn,
+      has_passkey_sync
+          ? l10n_util::GetStringUTF16(
+                IDS_PASSWORD_MANAGER_OPT_INTO_ACCOUNT_STORE_WITH_PASSKEYS)
+          : l10n_util::GetStringUTF16(
+                IDS_PASSWORD_MANAGER_OPT_INTO_ACCOUNT_STORE),
+      Suggestion::Icon::kGoogle);
+}
+
+Matcher<Suggestion> EqualsAccountStorageResignin() {
+  return EqualsSuggestion(
+      SuggestionType::kPasswordAccountStorageReSignin,
+      l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_RE_SIGNIN_ACCOUNT_STORE),
+      Suggestion::Icon::kGoogle);
+}
+
+Matcher<Suggestion> EqualsManagePasswordsSuggestion(
     bool has_webauthn_credential = false) {
   return AllOf(EqualsSuggestion(
                    SuggestionType::kAllSavedPasswordsEntry,
@@ -58,16 +151,46 @@
                      Suggestion::Icon::kGooglePasswordManager));
 }
 
-// TODO(b/323316649): Write more tests for password suggestion generation.
+class MockPasswordManagerClient : public StubPasswordManagerClient {
+ public:
+  MockPasswordManagerClient() = default;
+  ~MockPasswordManagerClient() override = default;
+
+  MOCK_METHOD(WebAuthnCredentialsDelegate*,
+              GetWebAuthnCredentialsDelegateForDriver,
+              (PasswordManagerDriver*),
+              (override));
+
+  const MockPasswordFeatureManager* GetPasswordFeatureManager() const override {
+    return &feature_manager_;
+  }
+
+  MockPasswordFeatureManager* GetPasswordFeatureManager() {
+    return &feature_manager_;
+  }
+
+ private:
+  NiceMock<MockPasswordFeatureManager> feature_manager_;
+};
+
+}  // namespace
+
 class PasswordSuggestionGeneratorTest : public testing::Test {
  public:
-  PasswordSuggestionGeneratorTest() : generator_(&driver(), &client()) {}
+  PasswordSuggestionGeneratorTest() : generator_(&driver(), &client()) {
+    ON_CALL(client_, GetWebAuthnCredentialsDelegateForDriver)
+        .WillByDefault(Return(&credentials_delegate()));
+  }
 
   const gfx::Image& favicon() const { return favicon_; }
 
   StubPasswordManagerDriver& driver() { return driver_; }
 
-  StubPasswordManagerClient& client() { return client_; }
+  MockPasswordManagerClient& client() { return client_; }
+
+  MockWebAuthnCredentialsDelegate& credentials_delegate() {
+    return credentials_delegate_;
+  }
 
   PasswordSuggestionGenerator& generator() { return generator_; }
 
@@ -90,6 +213,30 @@
     return CredentialUIEntry(password_form_no_username());
   }
 
+  PasswordFormFillData password_form_fill_data() const {
+    PasswordFormFillData fill_data;
+    fill_data.preferred_login.username_value = u"username";
+    fill_data.preferred_login.password_value = u"password";
+    fill_data.preferred_login.realm = "";
+    fill_data.preferred_login.uses_account_store = false;
+    return fill_data;
+  }
+
+  PasskeyCredential passkey_credential(PasskeyCredential::Source source,
+                                       const std::string& username) const {
+    return PasskeyCredential(
+        source, PasskeyCredential::RpId("gensokyo.com"),
+        PasskeyCredential::CredentialId(
+            std::vector<uint8_t>{'a', 'b', 'c', 'd'}),
+        PasskeyCredential::UserId(std::vector<uint8_t>{'i', 'j', 'k'}),
+        PasskeyCredential::Username(username),
+        PasskeyCredential::DisplayName("Display name"));
+  }
+
+  std::u16string password_label(size_t length) const {
+    return std::u16string(length, 0x2022);
+  }
+
   CredentialUIEntry android_credential_ui_entry() const {
     PasswordForm form;
     form.username_value = u"username@example.com";
@@ -134,18 +281,523 @@
  private:
   gfx::Image favicon_;
 
-  StubPasswordManagerClient client_;
+  NiceMock<MockPasswordManagerClient> client_;
+  NiceMock<MockWebAuthnCredentialsDelegate> credentials_delegate_;
   StubPasswordManagerDriver driver_;
   PasswordSuggestionGenerator generator_;
 };
 
 // Test that no suggestions are generated from an empty `PasswordFormFillData`.
-TEST_F(PasswordSuggestionGeneratorTest, NoPasswordFormFillData) {
+TEST_F(PasswordSuggestionGeneratorTest,
+       PasswordSuggestions_NoPasswordFormFillData) {
   std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
-      {}, favicon(), /*username_filter=*/u"", OffersGeneration(false),
+      /*fill_data=*/{}, favicon(), /*username_filter=*/u"",
+      OffersGeneration(false), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(false));
+
+  EXPECT_THAT(suggestions, IsEmpty());
+}
+
+// Verify that password suggestions are not generated when
+// `ShowPasswordSuggestions` is `false`.
+TEST_F(PasswordSuggestionGeneratorTest,
+       PasswordSuggestions_DontShowPasswordSuggestions) {
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      password_form_fill_data(), favicon(), /*username_filter=*/u"",
+      OffersGeneration(false), ShowPasswordSuggestions(false),
+      ShowWebAuthnCredentials(false));
+
+  EXPECT_THAT(suggestions, IsEmpty());
+}
+
+// Verify the suggestion content for the profile store credential.
+TEST_F(PasswordSuggestionGeneratorTest, PasswordSuggestions_FromProfileStore) {
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      password_form_fill_data(), favicon(), /*username_filter=*/u"",
+      OffersGeneration(false), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(false));
+
+  EXPECT_THAT(suggestions,
+              ElementsAre(EqualsDomainPasswordSuggestion(
+                              SuggestionType::kPasswordEntry, u"username",
+                              password_label(8u),
+                              /*realm_label=*/u"", favicon()),
+                          EqualsSuggestion(SuggestionType::kSeparator),
+                          EqualsManagePasswordsSuggestion()));
+}
+
+// Verify that suggestion for account store credential receives a different
+// `SuggestionType` and trailing icon.
+TEST_F(PasswordSuggestionGeneratorTest, PasswordSuggestions_FromAccountStore) {
+  PasswordFormFillData fill_data = password_form_fill_data();
+  fill_data.preferred_login.uses_account_store = true;
+
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      fill_data, favicon(), /*username_filter=*/u"", OffersGeneration(false),
       ShowPasswordSuggestions(true), ShowWebAuthnCredentials(false));
 
-  EXPECT_TRUE(suggestions.empty());
+  EXPECT_THAT(suggestions,
+              ElementsAre(EqualsDomainPasswordSuggestion(
+                              SuggestionType::kAccountStoragePasswordEntry,
+                              u"username", password_label(8u),
+                              /*realm_label=*/u"", favicon(),
+#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+                              Suggestion::Icon::kGoogle
+#else
+                              Suggestion::Icon::kNoIcon
+#endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+                              ),
+                          EqualsSuggestion(SuggestionType::kSeparator),
+                          EqualsManagePasswordsSuggestion()));
+}
+
+#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+// Verify that the trailing icon is not set for the account store credential if
+// the `kButterOnDesktopFollowup` is enabled.
+TEST_F(PasswordSuggestionGeneratorTest,
+       PasswordSuggestions_FromAccountStore_ButterFollowupEnabled) {
+  base::test::ScopedFeatureList feature_list(
+      password_manager::features::kButterOnDesktopFollowup);
+
+  PasswordFormFillData fill_data = password_form_fill_data();
+  fill_data.preferred_login.uses_account_store = true;
+
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      fill_data, favicon(), /*username_filter=*/u"", OffersGeneration(false),
+      ShowPasswordSuggestions(true), ShowWebAuthnCredentials(false));
+
+  EXPECT_THAT(suggestions,
+              ElementsAre(EqualsDomainPasswordSuggestion(
+                              SuggestionType::kAccountStoragePasswordEntry,
+                              u"username", password_label(8u),
+                              /*realm_label=*/u"", favicon(),
+                              Suggestion::Icon::kNoIcon),
+                          EqualsSuggestion(SuggestionType::kSeparator),
+                          EqualsManagePasswordsSuggestion()));
+}
+#endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+
+// Verify the realm label for the credential saved on a different domain.
+TEST_F(PasswordSuggestionGeneratorTest,
+       PasswordSuggestions_WithDifferentRealm) {
+  PasswordFormFillData fill_data = password_form_fill_data();
+  fill_data.preferred_login.realm = "https://example.com/login/data.html";
+
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      fill_data, favicon(), /*username_filter=*/u"", OffersGeneration(false),
+      ShowPasswordSuggestions(true), ShowWebAuthnCredentials(false));
+
+  EXPECT_THAT(suggestions,
+              ElementsAre(EqualsDomainPasswordSuggestion(
+                              SuggestionType::kPasswordEntry, u"username",
+                              password_label(8u),
+                              /*realm_label=*/u"example.com", favicon()),
+                          EqualsSuggestion(SuggestionType::kSeparator),
+                          EqualsManagePasswordsSuggestion()));
+}
+
+// Verify the suggestion content for the additional login.
+TEST_F(PasswordSuggestionGeneratorTest,
+       PasswordSuggestions_WithAdditionalLogin) {
+#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+  base::test::ScopedFeatureList feature_list;
+  feature_list.InitAndDisableFeature(syncer::kSyncWebauthnCredentials);
+#endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+  PasswordFormFillData fill_data = password_form_fill_data();
+  PasswordAndMetadata additional_login;
+  additional_login.username_value = u"additional_login";
+  additional_login.password_value = u"additional_password";
+  additional_login.realm = "https://additional.login.com";
+  additional_login.uses_account_store = true;
+  fill_data.additional_logins.emplace_back(std::move(additional_login));
+
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      fill_data, favicon(), /*username_filter=*/u"", OffersGeneration(false),
+      ShowPasswordSuggestions(true), ShowWebAuthnCredentials(false));
+  EXPECT_THAT(
+      suggestions,
+      ElementsAre(
+          EqualsDomainPasswordSuggestion(SuggestionType::kPasswordEntry,
+                                         u"username", password_label(8u),
+                                         /*realm_label=*/u"", favicon()),
+          EqualsDomainPasswordSuggestion(
+              SuggestionType::kAccountStoragePasswordEntry, u"additional_login",
+              password_label(19u),
+              /*realm_label=*/u"additional.login.com", favicon(),
+#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+              Suggestion::Icon::kGoogle
+#else
+              Suggestion::Icon::kNoIcon
+#endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+              ),
+          EqualsSuggestion(SuggestionType::kSeparator),
+          EqualsManagePasswordsSuggestion()));
+}
+
+// Verify that suggestions for additional logins are sorted by username.
+TEST_F(PasswordSuggestionGeneratorTest,
+       PasswordSuggestions_MultipleAdditionalLogins) {
+  PasswordFormFillData fill_data = password_form_fill_data();
+  PasswordAndMetadata foo_login;
+  foo_login.username_value = u"foo";
+  foo_login.password_value = u"foo_password";
+  fill_data.additional_logins.emplace_back(std::move(foo_login));
+  PasswordAndMetadata bar_login;
+  bar_login.username_value = u"bar";
+  bar_login.password_value = u"bar_password";
+  fill_data.additional_logins.emplace_back(std::move(bar_login));
+
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      fill_data, favicon(), /*username_filter=*/u"", OffersGeneration(false),
+      ShowPasswordSuggestions(true), ShowWebAuthnCredentials(false));
+
+  EXPECT_THAT(
+      suggestions,
+      ElementsAre(
+          EqualsDomainPasswordSuggestion(SuggestionType::kPasswordEntry,
+                                         u"username", password_label(8u),
+                                         /*realm_label=*/u"", favicon()),
+          EqualsDomainPasswordSuggestion(SuggestionType::kPasswordEntry, u"bar",
+                                         password_label(12u),
+                                         /*realm_label=*/u"", favicon()),
+          EqualsDomainPasswordSuggestion(SuggestionType::kPasswordEntry, u"foo",
+                                         password_label(12u),
+                                         /*realm_label=*/u"", favicon()),
+          EqualsSuggestion(SuggestionType::kSeparator),
+          EqualsManagePasswordsSuggestion()));
+}
+
+// Verify that no passkeys suggestions are generated when
+//  `ShowWebAuthnCredentials` is `true`, but there're not passkeys saved.
+TEST_F(PasswordSuggestionGeneratorTest, PasskeySuggestions_NoPasskeysSaved) {
+  std::optional<std::vector<PasskeyCredential>> passkeys = std::nullopt;
+  ON_CALL(credentials_delegate(), GetPasskeys)
+      .WillByDefault(ReturnRef(passkeys));
+
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      /*fill_data=*/{}, favicon(), /*username_filter=*/u"",
+      OffersGeneration(false), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(true));
+
+  EXPECT_THAT(suggestions, IsEmpty());
+}
+
+// Verify that no passkeys suggestions are generated when there're passkeys
+// saved but `ShowWebAuthnCredentials` is `false`.
+TEST_F(PasswordSuggestionGeneratorTest, PasskeySuggestions_DontShowPasskey) {
+  const auto passkeys =
+      std::optional(std::vector<PasskeyCredential>{passkey_credential(
+          PasskeyCredential::Source::kWindowsHello, "username")});
+  ON_CALL(credentials_delegate(), GetPasskeys)
+      .WillByDefault(ReturnRef(passkeys));
+
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      /*fill_data=*/{}, favicon(), /*username_filter=*/u"",
+      OffersGeneration(false), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(false));
+
+  EXPECT_THAT(suggestions, IsEmpty());
+}
+
+// Verify the passkey suggestion content.
+TEST_F(PasswordSuggestionGeneratorTest, PasskeySuggestions_SingleSavedPasskey) {
+  const auto passkey =
+      passkey_credential(PasskeyCredential::Source::kWindowsHello, "username");
+  const auto passkeys = std::optional(std::vector<PasskeyCredential>{passkey});
+  ON_CALL(credentials_delegate(), GetPasskeys)
+      .WillByDefault(ReturnRef(passkeys));
+
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      /*fill_data=*/{}, favicon(), /*username_filter=*/u"",
+      OffersGeneration(false), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(true));
+
+  EXPECT_THAT(
+      suggestions,
+      ElementsAre(
+          EqualsPasskeySuggestion(
+              u"username",
+              l10n_util::GetStringUTF16(
+                  IDS_PASSWORD_MANAGER_PASSKEY_FROM_WINDOWS_HELLO),
+              favicon(),
+              Suggestion::Guid(base::Base64Encode(passkey.credential_id()))),
+          EqualsSuggestion(SuggestionType::kSeparator),
+          EqualsManagePasswordsSuggestion(
+              /*has_webauthn_credential=*/true)));
+}
+
+// Verify that passkey suggestions are not sorted by username.
+TEST_F(PasswordSuggestionGeneratorTest,
+       PasskeySuggestions_MultipleSavedPasskeys) {
+  const auto foo_passkey =
+      passkey_credential(PasskeyCredential::Source::kTouchId, "foo");
+  const auto bar_passkey =
+      passkey_credential(PasskeyCredential::Source::kICloudKeychain, "bar");
+  const auto passkeys =
+      std::optional(std::vector<PasskeyCredential>{foo_passkey, bar_passkey});
+  ON_CALL(credentials_delegate(), GetPasskeys)
+      .WillByDefault(ReturnRef(passkeys));
+
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      /*fill_data=*/{}, favicon(), /*username_filter=*/u"",
+      OffersGeneration(false), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(true));
+
+  EXPECT_THAT(
+      suggestions,
+      ElementsAre(EqualsPasskeySuggestion(
+                      u"foo",
+                      l10n_util::GetStringUTF16(
+                          IDS_PASSWORD_MANAGER_PASSKEY_FROM_CHROME_PROFILE),
+                      favicon(),
+                      Suggestion::Guid(
+                          base::Base64Encode(foo_passkey.credential_id()))),
+                  EqualsPasskeySuggestion(
+                      u"bar",
+                      l10n_util::GetStringUTF16(
+                          IDS_PASSWORD_MANAGER_PASSKEY_FROM_ICLOUD_KEYCHAIN),
+                      favicon(),
+                      Suggestion::Guid(
+                          base::Base64Encode(bar_passkey.credential_id()))),
+                  EqualsSuggestion(SuggestionType::kSeparator),
+                  EqualsManagePasswordsSuggestion(
+                      /*has_webauthn_credential=*/true)));
+}
+
+// Test that the password generation suggestion is not added if there're no
+// saved credentials for the current domain.
+TEST_F(PasswordSuggestionGeneratorTest, GeneratePassword_NoCredentials) {
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      /*fill_data=*/{}, favicon(), /*username_filter=*/u"",
+      OffersGeneration(true), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(false));
+  EXPECT_THAT(suggestions, IsEmpty());
+}
+
+// Test that the password generation suggestion is added when the user has a
+// saved password for the current domain.
+TEST_F(PasswordSuggestionGeneratorTest, GeneratePassword_HasSavedPassword) {
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      password_form_fill_data(), favicon(), /*username_filter=*/u"",
+      OffersGeneration(true), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(false));
+
+  EXPECT_THAT(suggestions,
+              ElementsAre(EqualsDomainPasswordSuggestion(
+                              SuggestionType::kPasswordEntry, u"username",
+                              password_label(8u),
+                              /*realm_label=*/u"", favicon()),
+                          EqualsGeneratePasswordSuggestion(),
+                          EqualsSuggestion(SuggestionType::kSeparator),
+                          EqualsManagePasswordsSuggestion()));
+}
+
+// Test that the password generation suggestion is added when the user has a
+// saved passkey for the current domain.
+TEST_F(PasswordSuggestionGeneratorTest, GeneratePassword_HasSavedPasskey) {
+  const auto passkey =
+      passkey_credential(PasskeyCredential::Source::kWindowsHello, "username");
+  const auto passkeys = std::optional(std::vector<PasskeyCredential>{passkey});
+  ON_CALL(credentials_delegate(), GetPasskeys)
+      .WillByDefault(ReturnRef(passkeys));
+
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      /*fill_data=*/{}, favicon(), /*username_filter=*/u"",
+      OffersGeneration(true), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(true));
+
+  EXPECT_THAT(
+      suggestions,
+      ElementsAre(
+          EqualsPasskeySuggestion(
+              u"username",
+              l10n_util::GetStringUTF16(
+                  IDS_PASSWORD_MANAGER_PASSKEY_FROM_WINDOWS_HELLO),
+              favicon(),
+              Suggestion::Guid(base::Base64Encode(passkey.credential_id()))),
+          EqualsGeneratePasswordSuggestion(),
+          EqualsSuggestion(SuggestionType::kSeparator),
+          EqualsManagePasswordsSuggestion(
+              /*has_webauthn_credential=*/true)));
+}
+
+// Verifies the generate password suggestion content when account storage opt in
+// should be shown to the user.
+TEST_F(PasswordSuggestionGeneratorTest,
+       GeneratePassword_ShouldShowAccountStorageOptIn) {
+#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+  base::test::ScopedFeatureList feature_list;
+  feature_list.InitAndDisableFeature(syncer::kSyncWebauthnCredentials);
+#endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+  ON_CALL(*client().GetPasswordFeatureManager(), ShouldShowAccountStorageOptIn)
+      .WillByDefault(Return(true));
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      password_form_fill_data(), favicon(), /*username_filter=*/u"",
+      OffersGeneration(true), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(false));
+
+  EXPECT_THAT(suggestions,
+              ElementsAre(EqualsDomainPasswordSuggestion(
+                              SuggestionType::kPasswordEntry, u"username",
+                              password_label(8u),
+                              /*realm_label=*/u"", favicon()),
+                          EqualsOptInToAccountThenGeneratePasswordSuggestion(),
+                          EqualsEntryToOptInToAccountStorageThenFill(
+                              /*has_passkey_sync=*/false),
+                          EqualsSuggestion(SuggestionType::kSeparator),
+                          EqualsManagePasswordsSuggestion()));
+}
+
+// Verifies that opt into account storage suggestion is still shown if there're
+// no saved credentials for the current domain.
+TEST_F(PasswordSuggestionGeneratorTest,
+       OptInToAccountStorage_NoSavedCredentials) {
+#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+  base::test::ScopedFeatureList feature_list;
+  feature_list.InitAndDisableFeature(syncer::kSyncWebauthnCredentials);
+#endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+  ON_CALL(*client().GetPasswordFeatureManager(), ShouldShowAccountStorageOptIn)
+      .WillByDefault(Return(true));
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      /*fill_data=*/{}, favicon(), /*username_filter=*/u"",
+      OffersGeneration(false), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(false));
+
+  EXPECT_THAT(suggestions,
+              ElementsAre(EqualsEntryToOptInToAccountStorageThenFill(
+                  /*has_passkey_sync=*/false)));
+}
+
+#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+// Verifies the opt into account storage suggestion content when the
+// `kSyncWebauthnCredentials` feature is enabled.
+TEST_F(PasswordSuggestionGeneratorTest, OptInToAccountStorage_HasPasskeySync) {
+  base::test::ScopedFeatureList feature_list(syncer::kSyncWebauthnCredentials);
+  ON_CALL(*client().GetPasswordFeatureManager(), ShouldShowAccountStorageOptIn)
+      .WillByDefault(Return(true));
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      password_form_fill_data(), favicon(), /*username_filter=*/u"",
+      OffersGeneration(false), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(false));
+
+  EXPECT_THAT(suggestions,
+              ElementsAre(EqualsDomainPasswordSuggestion(
+                              SuggestionType::kPasswordEntry, u"username",
+                              password_label(8u),
+                              /*realm_label=*/u"", favicon()),
+                          EqualsEntryToOptInToAccountStorageThenFill(
+                              /*has_passkey_sync=*/true),
+                          EqualsSuggestion(SuggestionType::kSeparator),
+                          EqualsManagePasswordsSuggestion()));
+}
+#endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+
+// Test that account storage resignin suggestion is still shown if the there're
+// no credentials saved for the current domain.
+TEST_F(PasswordSuggestionGeneratorTest,
+       AccountStorageResignin_NoSavedCredentials) {
+  ON_CALL(*client().GetPasswordFeatureManager(),
+          ShouldShowAccountStorageReSignin)
+      .WillByDefault(Return(true));
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      /*fill_data=*/{}, favicon(), /*username_filter=*/u"",
+      OffersGeneration(false), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(false));
+
+  EXPECT_THAT(suggestions, ElementsAre(EqualsAccountStorageResignin()));
+}
+
+// Test the account storage resignin suggestion content.
+TEST_F(PasswordSuggestionGeneratorTest,
+       AccountStorageResignin_HasSavedPassword) {
+  ON_CALL(*client().GetPasswordFeatureManager(),
+          ShouldShowAccountStorageReSignin)
+      .WillByDefault(Return(true));
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      password_form_fill_data(), favicon(), /*username_filter=*/u"",
+      OffersGeneration(false), ShowPasswordSuggestions(true),
+      ShowWebAuthnCredentials(false));
+
+  EXPECT_THAT(suggestions,
+              ElementsAre(EqualsDomainPasswordSuggestion(
+                              SuggestionType::kPasswordEntry, u"username",
+                              password_label(8u),
+                              /*realm_label=*/u"", favicon()),
+                          EqualsAccountStorageResignin(),
+                          EqualsSuggestion(SuggestionType::kSeparator),
+                          EqualsManagePasswordsSuggestion()));
+}
+
+// Test the suggestion order when all possible suggestions should be generated.
+TEST_F(PasswordSuggestionGeneratorTest, DomainSuggestions_SuggestionOrder) {
+  // Configure saved password data.
+  PasswordFormFillData fill_data = password_form_fill_data();
+  PasswordAndMetadata foo_login;
+  foo_login.username_value = u"foo";
+  foo_login.password_value = u"foo_password";
+  fill_data.additional_logins.emplace_back(std::move(foo_login));
+  PasswordAndMetadata bar_login;
+  bar_login.username_value = u"bar";
+  bar_login.password_value = u"bar_password";
+  fill_data.additional_logins.emplace_back(std::move(bar_login));
+
+  // Configure saved passkeys.
+  const auto foo_passkey =
+      passkey_credential(PasskeyCredential::Source::kTouchId, "foo");
+  const auto bar_passkey =
+      passkey_credential(PasskeyCredential::Source::kICloudKeychain, "bar");
+  const auto passkeys =
+      std::optional(std::vector<PasskeyCredential>{foo_passkey, bar_passkey});
+  ON_CALL(credentials_delegate(), GetPasskeys)
+      .WillByDefault(ReturnRef(passkeys));
+
+#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+  base::test::ScopedFeatureList feature_list;
+  feature_list.InitAndDisableFeature(syncer::kSyncWebauthnCredentials);
+#endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+  ON_CALL(*client().GetPasswordFeatureManager(), ShouldShowAccountStorageOptIn)
+      .WillByDefault(Return(true));
+  ON_CALL(*client().GetPasswordFeatureManager(),
+          ShouldShowAccountStorageReSignin)
+      .WillByDefault(Return(true));
+
+  std::vector<Suggestion> suggestions = generator().GetSuggestionsForDomain(
+      fill_data, favicon(), /*username_filter=*/u"", OffersGeneration(true),
+      ShowPasswordSuggestions(true), ShowWebAuthnCredentials(true));
+
+  EXPECT_THAT(
+      suggestions,
+      ElementsAre(
+          EqualsPasskeySuggestion(
+              u"foo",
+              l10n_util::GetStringUTF16(
+                  IDS_PASSWORD_MANAGER_PASSKEY_FROM_CHROME_PROFILE),
+              favicon(),
+              Suggestion::Guid(
+                  base::Base64Encode(foo_passkey.credential_id()))),
+          EqualsPasskeySuggestion(
+              u"bar",
+              l10n_util::GetStringUTF16(
+                  IDS_PASSWORD_MANAGER_PASSKEY_FROM_ICLOUD_KEYCHAIN),
+              favicon(),
+              Suggestion::Guid(
+                  base::Base64Encode(bar_passkey.credential_id()))),
+          EqualsDomainPasswordSuggestion(SuggestionType::kPasswordEntry,
+                                         u"username", password_label(8u),
+                                         /*realm_label=*/u"", favicon()),
+          EqualsDomainPasswordSuggestion(SuggestionType::kPasswordEntry, u"bar",
+                                         password_label(12u),
+                                         /*realm_label=*/u"", favicon()),
+          EqualsDomainPasswordSuggestion(SuggestionType::kPasswordEntry, u"foo",
+                                         password_label(12u),
+                                         /*realm_label=*/u"", favicon()),
+          EqualsOptInToAccountThenGeneratePasswordSuggestion(),
+          EqualsEntryToOptInToAccountStorageThenFill(
+              /*has_passkey_sync=*/false),
+          EqualsAccountStorageResignin(),
+          EqualsSuggestion(SuggestionType::kSeparator),
+          EqualsManagePasswordsSuggestion(
+              /*has_webauthn_credential=*/true)));
 }
 
 // Manual fallback suggestions are only relevant for desktop platform.
@@ -155,7 +807,7 @@
   std::vector<Suggestion> suggestions = GenerateBothSections(
       std::vector<PasswordForm>(), std::vector<CredentialUIEntry>(),
       IsTriggeredOnPasswordForm(true));
-  EXPECT_TRUE(suggestions.empty());
+  EXPECT_THAT(suggestions, IsEmpty());
 }
 
 TEST_F(PasswordSuggestionGeneratorTest,
@@ -172,7 +824,7 @@
                                   u"password", u"google.com",
                                   /*is_cross_domain=*/false)),
                           EqualsSuggestion(SuggestionType::kSeparator),
-                          EqualsManageManagePasswordsSuggestion()));
+                          EqualsManagePasswordsSuggestion()));
 }
 
 TEST_F(PasswordSuggestionGeneratorTest,
@@ -189,7 +841,7 @@
                                   u"password", u"google.com",
                                   /*is_cross_domain=*/true)),
                           EqualsSuggestion(SuggestionType::kSeparator),
-                          EqualsManageManagePasswordsSuggestion()));
+                          EqualsManagePasswordsSuggestion()));
 }
 
 TEST_F(PasswordSuggestionGeneratorTest,
@@ -206,7 +858,7 @@
                       Suggestion::PasswordSuggestionDetails(
                           u"password", u"Netflix", /*is_cross_domain=*/true)),
                   EqualsSuggestion(SuggestionType::kSeparator),
-                  EqualsManageManagePasswordsSuggestion()));
+                  EqualsManagePasswordsSuggestion()));
 }
 
 TEST_F(PasswordSuggestionGeneratorTest,
@@ -225,7 +877,7 @@
               Suggestion::PasswordSuggestionDetails(u"password", u"google.com",
                                                     /*is_cross_domain=*/false)),
           EqualsSuggestion(SuggestionType::kSeparator),
-          EqualsManageManagePasswordsSuggestion()));
+          EqualsManagePasswordsSuggestion()));
 }
 
 TEST_F(PasswordSuggestionGeneratorTest,
@@ -244,7 +896,7 @@
               Suggestion::PasswordSuggestionDetails(u"password", u"google.com",
                                                     /*is_cross_domain=*/true)),
           EqualsSuggestion(SuggestionType::kSeparator),
-          EqualsManageManagePasswordsSuggestion()));
+          EqualsManagePasswordsSuggestion()));
 }
 
 TEST_F(PasswordSuggestionGeneratorTest,
@@ -261,7 +913,7 @@
                                   u"password", u"google.com",
                                   /*is_cross_domain=*/false)),
                           EqualsSuggestion(SuggestionType::kSeparator),
-                          EqualsManageManagePasswordsSuggestion()));
+                          EqualsManagePasswordsSuggestion()));
 }
 
 TEST_F(PasswordSuggestionGeneratorTest,
@@ -278,7 +930,7 @@
                                   u"password", u"google.com",
                                   /*is_cross_domain=*/true)),
                           EqualsSuggestion(SuggestionType::kSeparator),
-                          EqualsManageManagePasswordsSuggestion()));
+                          EqualsManagePasswordsSuggestion()));
 }
 
 TEST_F(PasswordSuggestionGeneratorTest,
@@ -310,7 +962,7 @@
               Suggestion::PasswordSuggestionDetails(u"password", u"google.com",
                                                     /*is_cross_domain=*/true)),
           EqualsSuggestion(SuggestionType::kSeparator),
-          EqualsManageManagePasswordsSuggestion()));
+          EqualsManagePasswordsSuggestion()));
 }
 
 TEST_F(PasswordSuggestionGeneratorTest,
@@ -364,7 +1016,7 @@
               Suggestion::PasswordSuggestionDetails(u"second", u"netflix.com",
                                                     /*is_cross_domain=*/true)),
           EqualsSuggestion(SuggestionType::kSeparator),
-          EqualsManageManagePasswordsSuggestion()));
+          EqualsManagePasswordsSuggestion()));
 }
 
 TEST_F(PasswordSuggestionGeneratorTest,
@@ -535,7 +1187,7 @@
               Suggestion::PasswordSuggestionDetails(u"first", u"microsoft.com",
                                                     /*is_cross_domain=*/false)),
           EqualsSuggestion(SuggestionType::kSeparator),
-          EqualsManageManagePasswordsSuggestion()));
+          EqualsManagePasswordsSuggestion()));
 }
 
 #endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
diff --git a/components/pdf/renderer/pdf_accessibility_tree_browsertest.cc b/components/pdf/renderer/pdf_accessibility_tree_browsertest.cc
index ee516eb..38ce3ee 100644
--- a/components/pdf/renderer/pdf_accessibility_tree_browsertest.cc
+++ b/components/pdf/renderer/pdf_accessibility_tree_browsertest.cc
@@ -2471,145 +2471,6 @@
   EXPECT_EQ(0u, inline_box->GetChildCount());
 }
 
-// TODO(crbug.com/40064422): Remove `CheckLiveRegionPoliteStatus` and
-// `CheckLiveRegionNotSetWhenInBackground` below once PDF OCR is launched
-// on Windows, Linux, and macOS as these tests will be replaced with
-// `PdfOcrTest.CheckLiveRegionPoliteStatus` and
-// `PdfOcrTest.CheckLiveRegionNotSetWhenInBackground`, respectively.
-#if !BUILDFLAG(IS_CHROMEOS)
-TEST_F(PdfAccessibilityTreeTest, CheckLiveRegionPoliteStatus) {
-  CreatePdfAccessibilityTree();
-
-  page_objects_.images.push_back(CreateMockInaccessibleImage());
-
-  // Get and use the underlying AXTree to create an AXEventGenerator. This
-  // event generator is usually instrumented in the test.
-  ui::AXTree& tree = pdf_accessibility_tree_->tree_for_testing();
-  ui::AXEventGenerator event_generator(&tree);
-  pdf_accessibility_tree_->SetAccessibilityViewportInfo(viewport_info_);
-  pdf_accessibility_tree_->SetAccessibilityDocInfo(doc_info_);
-  WaitForThreadTasks();
-
-  const ui::AXNode* root_node = pdf_accessibility_tree_->GetRoot();
-  ASSERT_NE(nullptr, root_node);
-  EXPECT_EQ(ax::mojom::Role::kPdfRoot, root_node->GetRole());
-  ASSERT_EQ(1u, root_node->GetChildCount());
-
-  const ui::AXNode* status_wrapper_node = root_node->GetChildAtIndex(0);
-  ASSERT_NE(nullptr, status_wrapper_node);
-  EXPECT_EQ(ax::mojom::Role::kBanner, status_wrapper_node->GetRole());
-  ASSERT_EQ(1u, status_wrapper_node->GetChildCount());
-
-  const ui::AXNode* status_node = status_wrapper_node->GetChildAtIndex(0);
-  ASSERT_NE(nullptr, status_node);
-  EXPECT_EQ(ax::mojom::Role::kStatus, status_node->GetRole());
-  EXPECT_EQ(1u, status_node->GetChildCount());
-  EXPECT_TRUE(
-      status_node->GetBoolAttribute(ax::mojom::BoolAttribute::kLiveAtomic));
-  constexpr char kDefaultLiveRegionRelevant[] = "additions text";
-  EXPECT_EQ(kDefaultLiveRegionRelevant,
-            status_node->GetStringAttribute(
-                ax::mojom::StringAttribute::kLiveRelevant));
-  constexpr char kStatusLiveRegion[] = "polite";
-  EXPECT_EQ(kStatusLiveRegion, status_node->GetStringAttribute(
-                                   ax::mojom::StringAttribute::kLiveStatus));
-  EXPECT_TRUE(status_node->GetBoolAttribute(
-      ax::mojom::BoolAttribute::kContainerLiveAtomic));
-  EXPECT_EQ(kDefaultLiveRegionRelevant,
-            status_node->GetStringAttribute(
-                ax::mojom::StringAttribute::kContainerLiveRelevant));
-  EXPECT_EQ(kStatusLiveRegion,
-            status_node->GetStringAttribute(
-                ax::mojom::StringAttribute::kContainerLiveStatus));
-
-  EXPECT_THAT(
-      event_generator,
-      UnorderedElementsAre(
-          HasEventAtNode(ui::AXEventGenerator::Event::SUBTREE_CREATED,
-                         root_node->id()),
-          HasEventAtNode(ui::AXEventGenerator::Event::LIVE_REGION_CREATED,
-                         status_node->id())));
-
-  page_info_.page_index = 0;
-  pdf_accessibility_tree_->SetAccessibilityPageInfo(page_info_, text_runs_,
-                                                    chars_, page_objects_);
-  WaitForThreadTasks();
-  // Wait for `PdfAccessibilityTree::UnserializeNodes()`, a delayed task.
-  WaitForThreadDelayedTasks();
-
-  EXPECT_EQ(root_node, pdf_accessibility_tree_->GetRoot());
-  CheckRootAndStatusNodes(root_node, doc_info_.page_count,
-                          /*is_pdf_ocr_test=*/false, /*is_ocr_completed=*/false,
-                          /*create_empty_ocr_results=*/false);
-
-  // Check if the status node's attributes have been cleared out.
-  EXPECT_FALSE(
-      status_node->HasBoolAttribute(ax::mojom::BoolAttribute::kLiveAtomic));
-  EXPECT_FALSE(status_node->HasStringAttribute(
-      ax::mojom::StringAttribute::kLiveRelevant));
-  EXPECT_FALSE(
-      status_node->HasStringAttribute(ax::mojom::StringAttribute::kLiveStatus));
-  EXPECT_FALSE(status_node->HasBoolAttribute(
-      ax::mojom::BoolAttribute::kContainerLiveAtomic));
-  EXPECT_FALSE(status_node->HasStringAttribute(
-      ax::mojom::StringAttribute::kContainerLiveRelevant));
-  EXPECT_FALSE(status_node->HasStringAttribute(
-      ax::mojom::StringAttribute::kContainerLiveStatus));
-  EXPECT_FALSE(
-      status_node->HasStringAttribute(ax::mojom::StringAttribute::kName));
-
-  ASSERT_GT(root_node->GetChildCount(), 1u);
-  const ui::AXNode* page_node = root_node->GetChildAtIndex(1);
-  ASSERT_NE(nullptr, page_node);
-  ASSERT_EQ(1u, page_node->GetChildCount());
-
-  const ui::AXNode* paragraph_node = page_node->GetChildAtIndex(0);
-  ASSERT_NE(nullptr, paragraph_node);
-  ASSERT_EQ(1u, paragraph_node->GetChildCount());
-
-  const ui::AXNode* image_node = paragraph_node->GetChildAtIndex(0);
-  ASSERT_NE(nullptr, image_node);
-}
-
-TEST_F(PdfAccessibilityTreeTest, CheckLiveRegionNotSetWhenInBackground) {
-  CreatePdfAccessibilityTree();
-  // Simulate going to the background.
-  pdf_accessibility_tree_->WasHidden();
-
-  page_objects_.images.push_back(CreateMockInaccessibleImage());
-  pdf_accessibility_tree_->SetAccessibilityViewportInfo(viewport_info_);
-  pdf_accessibility_tree_->SetAccessibilityDocInfo(doc_info_);
-  WaitForThreadTasks();
-
-  const ui::AXNode* root_node = pdf_accessibility_tree_->GetRoot();
-  ASSERT_NE(nullptr, root_node);
-  EXPECT_EQ(ax::mojom::Role::kPdfRoot, root_node->GetRole());
-  ASSERT_EQ(1u, root_node->GetChildCount());
-
-  const ui::AXNode* status_wrapper_node = root_node->GetChildAtIndex(0);
-  ASSERT_NE(nullptr, status_wrapper_node);
-  EXPECT_EQ(ax::mojom::Role::kBanner, status_wrapper_node->GetRole());
-  ASSERT_EQ(1u, status_wrapper_node->GetChildCount());
-
-  const ui::AXNode* status_node = status_wrapper_node->GetChildAtIndex(0);
-  ASSERT_NE(nullptr, status_node);
-  EXPECT_EQ(ax::mojom::Role::kStatus, status_node->GetRole());
-  EXPECT_EQ(1u, status_node->GetChildCount());
-  EXPECT_FALSE(
-      status_node->HasBoolAttribute(ax::mojom::BoolAttribute::kLiveAtomic));
-  EXPECT_FALSE(status_node->HasStringAttribute(
-      ax::mojom::StringAttribute::kLiveRelevant));
-  EXPECT_FALSE(
-      status_node->HasStringAttribute(ax::mojom::StringAttribute::kLiveStatus));
-  EXPECT_FALSE(status_node->HasBoolAttribute(
-      ax::mojom::BoolAttribute::kContainerLiveAtomic));
-  EXPECT_FALSE(status_node->HasStringAttribute(
-      ax::mojom::StringAttribute::kContainerLiveRelevant));
-  EXPECT_FALSE(status_node->HasStringAttribute(
-      ax::mojom::StringAttribute::kContainerLiveStatus));
-}
-#endif  // !BUILDFLAG(IS_CHROMEOS)
-
 #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
 struct PdfOcrHelperTestBatchData {
   uint32_t page_count;
diff --git a/components/permissions/pref_names.cc b/components/permissions/pref_names.cc
index 97b77f1..22463348 100644
--- a/components/permissions/pref_names.cc
+++ b/components/permissions/pref_names.cc
@@ -42,11 +42,12 @@
 
 // Boolean that specifies whether or not unused site permissions should be
 // revoked by Safety Hub. It is used only when kSafetyHub flag is on.
-// Conditioned because currently Safety Hub is available only on desktop.
-#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+// Conditioned because currently Safety Hub is available only on desktop and
+// Android.
+#if !BUILDFLAG(IS_IOS)
 const char kUnusedSitePermissionsRevocationEnabled[] =
     "safety_hub.unused_site_permissions_revocation.enabled";
-#endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+#endif  // !BUILDFLAG(IS_IOS)
 }  // namespace prefs
 
 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
diff --git a/components/permissions/pref_names.h b/components/permissions/pref_names.h
index 184e954..0478a4d 100644
--- a/components/permissions/pref_names.h
+++ b/components/permissions/pref_names.h
@@ -25,10 +25,10 @@
 extern const char kOneTimePermissionPromptsDecidedCount[];
 
 // The pref is used only when kSafetyHub flag is on.
-// Currently Safety Hub is available only on desktop.
-#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+// Currently Safety Hub is available only on desktop and Android.
+#if !BUILDFLAG(IS_IOS)
 extern const char kUnusedSitePermissionsRevocationEnabled[];
-#endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
+#endif  // !BUILDFLAG(IS_IOS)
 
 }  // namespace prefs
 
diff --git a/components/plus_addresses/affiliations/plus_address_affiliation_match_helper.cc b/components/plus_addresses/affiliations/plus_address_affiliation_match_helper.cc
index 4265993..f5ad64f 100644
--- a/components/plus_addresses/affiliations/plus_address_affiliation_match_helper.cc
+++ b/components/plus_addresses/affiliations/plus_address_affiliation_match_helper.cc
@@ -5,6 +5,7 @@
 #include "components/plus_addresses/affiliations/plus_address_affiliation_match_helper.h"
 
 #include "components/affiliations/core/browser/affiliation_service.h"
+#include "components/plus_addresses/features.h"
 #include "components/plus_addresses/plus_address_service.h"
 #include "components/plus_addresses/plus_address_types.h"
 
@@ -22,6 +23,12 @@
 void PlusAddressAffiliationMatchHelper::GetAffiliatedPlusProfiles(
     const PlusProfile& plus_profile,
     AffiliatedPlusProfilesCallback result_callback) {
+  if (!base::FeatureList::IsEnabled(
+          plus_addresses::features::kPlusAddressAffiliations)) {
+    std::move(result_callback).Run({plus_profile});
+    return;
+  }
+
   // TODO(b/324553908): Complete.
 }
 
diff --git a/components/power_bookmarks/storage/power_bookmark_sync_bridge.cc b/components/power_bookmarks/storage/power_bookmark_sync_bridge.cc
index 2f4b7b1..0cf4faa2 100644
--- a/components/power_bookmarks/storage/power_bookmark_sync_bridge.cc
+++ b/components/power_bookmarks/storage/power_bookmark_sync_bridge.cc
@@ -6,6 +6,7 @@
 
 #include "components/power_bookmarks/common/power.h"
 #include "components/power_bookmarks/storage/power_bookmark_sync_metadata_database.h"
+#include "components/sync/base/deletion_origin.h"
 #include "components/sync/model/in_memory_metadata_change_list.h"
 #include "components/sync/model/metadata_batch.h"
 #include "components/sync/model/metadata_change_list.h"
@@ -108,7 +109,7 @@
   if (!change_processor()->IsTrackingMetadata()) {
     return;
   }
-  change_processor()->Delete(guid,
+  change_processor()->Delete(guid, syncer::DeletionOrigin::Unspecified(),
                              CreateMetadataChangeListInTransaction().get());
 }
 
diff --git a/components/printing/test/print_render_frame_helper_browsertest.cc b/components/printing/test/print_render_frame_helper_browsertest.cc
index 85d1d2a..0c9055a 100644
--- a/components/printing/test/print_render_frame_helper_browsertest.cc
+++ b/components/printing/test/print_render_frame_helper_browsertest.cc
@@ -1317,6 +1317,27 @@
     preview_ui()->WaitUntilPreviewUpdate();
   }
 
+  // A function to set up the preview environment for `frame`. Done here to
+  // access private members of the test class.
+  void OnPrintPreviewForRenderFrame(WebLocalFrame* frame,
+                                    bool has_selection,
+                                    FakePrintPreviewUI* preview_ui) {
+    content::RenderFrame* render_frame =
+        content::RenderFrame::FromWebFrame(frame);
+    BindPrintManagerHost(render_frame);
+    PrintRenderFrameHelper* print_render_frame_helper =
+        GetPrintRenderFrameHelperForFrame(render_frame);
+    print_render_frame_helper->SetPrintPreviewUI(preview_ui->BindReceiver());
+    print_render_frame_helper->InitiatePrintPreview(
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+        mojo::NullAssociatedRemote(),
+#endif
+        has_selection);
+
+    print_render_frame_helper->PrintPreview(print_settings().Clone());
+    preview_ui->WaitUntilPreviewUpdate();
+  }
+
   void OnClosePrintPreviewDialog() {
     GetPrintRenderFrameHelper()->OnPrintPreviewDialogClosed();
   }
@@ -1363,10 +1384,12 @@
   }
 
   // `page_index` is 0-based.
-  void VerifyDidPreviewPage(bool expect_generated, uint32_t page_index) {
+  void VerifyDidPreviewPage(bool expect_generated,
+                            uint32_t page_index,
+                            FakePrintPreviewUI* preview_ui) {
     bool msg_found = false;
     uint32_t data_size = 0;
-    for (const auto& preview : preview_ui()->print_preview_pages()) {
+    for (const auto& preview : preview_ui->print_preview_pages()) {
       if (preview.index == page_index) {
         msg_found = true;
         data_size = preview.content_data_size;
@@ -1379,6 +1402,10 @@
       EXPECT_NE(0U, data_size) << "For page at index " << page_index;
   }
 
+  void VerifyDidPreviewPage(bool expect_generated, uint32_t page_index) {
+    VerifyDidPreviewPage(expect_generated, page_index, preview_ui());
+  }
+
   void VerifyDefaultPageLayout(
       int expected_content_width,
       int expected_content_height,
@@ -1492,6 +1519,32 @@
   OnClosePrintPreviewDialog();
 }
 
+TEST_F(PrintRenderFrameHelperPreviewTest, PrintPreviewWithSrcdocSelection) {
+  static const char kHTMLWithSrcdocChildFrame[] =
+      "<html><body>"
+      "<iframe name='srcdoc_frame' srcdoc='foo'></iframe>"
+      "</body></html>";
+  LoadHTML(kHTMLWithSrcdocChildFrame);
+
+  // Create selection in the child frame.
+  WebLocalFrame* srcdoc_frame =
+      GetMainFrame()->FindFrameByName("srcdoc_frame")->ToWebLocalFrame();
+  srcdoc_frame->ExecuteCommand("SelectAll");
+  print_settings().Set(kSettingShouldPrintSelectionOnly, true);
+
+  // Verify that print preview succeeds.
+
+  // The subframe will need its own preview UI. Declare it here so it can be
+  // passed to `VerifyDidPreviewPage` after `OnPrintPreviewForRenderFrame`
+  // completes.
+  std::unique_ptr<FakePrintPreviewUI> subframe_preview_ui =
+      std::make_unique<FakePrintPreviewUI>();
+
+  OnPrintPreviewForRenderFrame(srcdoc_frame, /*has_selection=*/true,
+                               subframe_preview_ui.get());
+  VerifyDidPreviewPage(true, 0, subframe_preview_ui.get());
+}
+
 TEST_F(PrintRenderFrameHelperPreviewTest, PrintPreviewHTMLWithPageMarginsCss) {
   // A simple web page with print margins css.
   static const char kHTMLWithPageMarginsCss[] =
diff --git a/components/safe_browsing/content/browser/client_side_detection_host.cc b/components/safe_browsing/content/browser/client_side_detection_host.cc
index 3c9f17e..33e8b5c 100644
--- a/components/safe_browsing/content/browser/client_side_detection_host.cc
+++ b/components/safe_browsing/content/browser/client_side_detection_host.cc
@@ -15,6 +15,7 @@
 #include "base/memory/ref_counted.h"
 #include "base/metrics/histogram_functions.h"
 #include "base/metrics/histogram_macros.h"
+#include "base/rand_util.h"
 #include "base/task/sequenced_task_runner_helpers.h"
 #include "base/task/thread_pool.h"
 #include "base/time/default_tick_clock.h"
@@ -72,6 +73,7 @@
 const char kCsdDebugFeatureDirectoryFlag[] = "csd-debug-feature-directory";
 const char kSkipCSDAllowlistOnPreclassification[] =
     "safe-browsing-skip-csd-allowlist";
+const float kProbabilityForSendingSampleRequest = 0.01;
 
 void WriteFeaturesToDisk(const ClientPhishingRequest& features,
                          const base::FilePath& base_path) {
@@ -351,7 +353,7 @@
                             PreClassificationCheckResult phishing_reason,
                             bool match_allowlist) {
     DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-    if (match_allowlist) {
+    if (match_allowlist && !CanSendSamplePing()) {
       phishing_reason =
           PreClassificationCheckResult::NO_CLASSIFY_MATCH_CSD_ALLOWLIST;
     }
@@ -418,6 +420,13 @@
     }
   }
 
+  bool CanSendSamplePing() {
+    return host_ && host_->delegate_->GetPrefs() &&
+           IsEnhancedProtectionEnabled(*host_->delegate_->GetPrefs()) &&
+           base::RandDouble() <= kProbabilityForSendingSampleRequest &&
+           base::FeatureList::IsEnabled(kClientSideDetectionSamplePing);
+  }
+
   const GURL url_;
   std::string mime_type_;
   net::IPEndPoint remote_endpoint_;
diff --git a/components/safe_browsing/content/browser/client_side_detection_host.h b/components/safe_browsing/content/browser/client_side_detection_host.h
index e9fd565..4e551af8 100644
--- a/components/safe_browsing/content/browser/client_side_detection_host.h
+++ b/components/safe_browsing/content/browser/client_side_detection_host.h
@@ -232,6 +232,9 @@
   void OnGotAccessToken(std::unique_ptr<ClientPhishingRequest> verdict,
                         const std::string& access_token);
 
+  // Check if sample ping can be sent to Safe Browsing.
+  bool CanSendSamplePing();
+
   // This pointer may be nullptr if client-side phishing detection is
   // disabled.
   base::WeakPtr<ClientSideDetectionService> csd_service_;
diff --git a/components/safe_browsing/core/common/features.cc b/components/safe_browsing/core/common/features.cc
index d5bc01b..c1d010d 100644
--- a/components/safe_browsing/core/common/features.cc
+++ b/components/safe_browsing/core/common/features.cc
@@ -42,6 +42,10 @@
              "ClientSideDetectionNotificationPrompt",
              base::FEATURE_DISABLED_BY_DEFAULT);
 
+BASE_FEATURE(kClientSideDetectionSamplePing,
+             "ClientSideDetectionSamplePing",
+             base::FEATURE_DISABLED_BY_DEFAULT);
+
 BASE_FEATURE(kCreateNotificationsAcceptedClientSafeBrowsingReports,
              "CreateNotificationsAcceptedClientSafeBrowsingReports",
              base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/components/safe_browsing/core/common/features.h b/components/safe_browsing/core/common/features.h
index 1216cc56..f96b4d1 100644
--- a/components/safe_browsing/core/common/features.h
+++ b/components/safe_browsing/core/common/features.h
@@ -37,6 +37,10 @@
 // occurs on the page.
 BASE_DECLARE_FEATURE(kClientSideDetectionNotificationPrompt);
 
+// Send a sample CSPP ping when a URL matches the CSD allowlist and all other
+// preclassification check conditions pass.
+BASE_DECLARE_FEATURE(kClientSideDetectionSamplePing);
+
 // Creates and sends CSBRRs when notification permissions are accepted for an
 // abusive site whose interstitial has been bypassed.
 BASE_DECLARE_FEATURE(kCreateNotificationsAcceptedClientSafeBrowsingReports);
diff --git a/components/signin/public/base/signin_feature_map.cc b/components/signin/public/base/signin_feature_map.cc
index 30dee71..ab540c0 100644
--- a/components/signin/public/base/signin_feature_map.cc
+++ b/components/signin/public/base/signin_feature_map.cc
@@ -17,10 +17,13 @@
 namespace {
 // Array of features exposed through the Java SigninFeatures API.
 const base::Feature* const kFeaturesExposedToJava[] = {
-    &switches::kSeedAccountsRevamp, &switches::kEnterprisePolicyOnSignin,
+    &switches::kSeedAccountsRevamp,
+    &switches::kEnterprisePolicyOnSignin,
     &switches::kRestoreSignedInAccountAndSettingsFromBackup,
     &switches::kMinorModeRestrictionsForHistorySyncOptIn,
-    &switches::kHideSettingsSignInPromo};
+    &switches::kHideSettingsSignInPromo,
+    &switches::kUpdateMetricsServicesStateInRestore,
+    &switches::kUseConsentLevelSigninForLegacyAccountEmailPref};
 
 // static
 base::android::FeatureMap* GetFeatureMap() {
diff --git a/components/signin/public/base/signin_switches.cc b/components/signin/public/base/signin_switches.cc
index 43f25e01..c2bad0c 100644
--- a/components/signin/public/base/signin_switches.cc
+++ b/components/signin/public/base/signin_switches.cc
@@ -27,6 +27,10 @@
 BASE_FEATURE(kHideSettingsSignInPromo,
              "HideSettingsSignInPromo",
              base::FEATURE_DISABLED_BY_DEFAULT);
+
+BASE_FEATURE(kUseConsentLevelSigninForLegacyAccountEmailPref,
+             "UseConsentLevelSigninForLegacyAccountEmailPref",
+             base::FEATURE_ENABLED_BY_DEFAULT);
 #endif
 
 // Clears the token service before using it. This allows simulating the
@@ -176,6 +180,15 @@
              base::FEATURE_DISABLED_BY_DEFAULT);
 #endif
 
+#if BUILDFLAG(IS_ANDROID)
+// Flag guarding the refresh of the metrics services states after the related
+// prefs are restored during the device restoration, to enable metrics upload
+// if it's allowed by those restored prefs.
+BASE_FEATURE(kUpdateMetricsServicesStateInRestore,
+             "UpdateMetricsServicesStateInRestore",
+             base::FEATURE_DISABLED_BY_DEFAULT);
+#endif
+
 }  // namespace switches
 
 #if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
diff --git a/components/signin/public/base/signin_switches.h b/components/signin/public/base/signin_switches.h
index 6e67b9cb..6f6c8ca 100644
--- a/components/signin/public/base/signin_switches.h
+++ b/components/signin/public/base/signin_switches.h
@@ -37,6 +37,9 @@
 // Feature flag to hide signin promo in settings page.
 COMPONENT_EXPORT(SIGNIN_SWITCHES)
 BASE_DECLARE_FEATURE(kHideSettingsSignInPromo);
+
+COMPONENT_EXPORT(SIGNIN_SWITCHES)
+BASE_DECLARE_FEATURE(kUseConsentLevelSigninForLegacyAccountEmailPref);
 #endif
 
 COMPONENT_EXPORT(SIGNIN_SWITCHES)
@@ -140,6 +143,11 @@
 BASE_DECLARE_FEATURE(kPreconnectAccountCapabilitiesPostSignin);
 #endif
 
+#if BUILDFLAG(IS_ANDROID)
+COMPONENT_EXPORT(SIGNIN_SWITCHES)
+BASE_DECLARE_FEATURE(kUpdateMetricsServicesStateInRestore);
+#endif
+
 }  // namespace switches
 
 // TODO(crbug.com/337879458): Move switches below into the switches namespace.
diff --git a/components/supervised_user/core/browser/list_family_members_service.cc b/components/supervised_user/core/browser/list_family_members_service.cc
index 0be2ed6..6f7ba7c 100644
--- a/components/supervised_user/core/browser/list_family_members_service.cc
+++ b/components/supervised_user/core/browser/list_family_members_service.cc
@@ -48,12 +48,6 @@
   return successful_fetch_repeating_consumers_.Add(callback);
 }
 
-base::CallbackListSubscription
-ListFamilyMembersService::SubscribeToNextSuccessfulFetch(
-    base::OnceCallback<SuccessfulFetchCallback> callback) {
-  return successful_fetch_disposable_consumers_.Add(std::move(callback));
-}
-
 void ListFamilyMembersService::Start() {
   fetcher_ = FetchListFamilyMembers(
       *identity_manager_, url_loader_factory_,
@@ -84,7 +78,6 @@
   }
 
   successful_fetch_repeating_consumers_.Notify(*response);
-  successful_fetch_disposable_consumers_.Notify(*response);
   ScheduleNextUpdate(NextUpdate(status));
 }
 
diff --git a/components/supervised_user/core/browser/list_family_members_service.h b/components/supervised_user/core/browser/list_family_members_service.h
index 23e594f6..cfd1ee3 100644
--- a/components/supervised_user/core/browser/list_family_members_service.h
+++ b/components/supervised_user/core/browser/list_family_members_service.h
@@ -51,13 +51,6 @@
   base::CallbackListSubscription SubscribeToSuccessfulFetches(
       base::RepeatingCallback<SuccessfulFetchCallback> callback);
 
-  // `callback` will receive only one next update of family members. Can be
-  // unsubscribed by destroying the `base::CallbackListSubscription` handle.
-  // After use, must be cleaned-up (see
-  // base::OnceCallbackList::null_callbacks_).
-  base::CallbackListSubscription SubscribeToNextSuccessfulFetch(
-      base::OnceCallback<SuccessfulFetchCallback> callback);
-
  private:
   void OnResponse(
       const ProtoFetcherStatus& status,
@@ -74,10 +67,6 @@
   base::RepeatingCallbackList<SuccessfulFetchCallback>
       successful_fetch_repeating_consumers_;
 
-  // One-shot consumers.
-  base::OnceCallbackList<SuccessfulFetchCallback>
-      successful_fetch_disposable_consumers_;
-
   // Attributes.
   std::unique_ptr<ProtoFetcher<kidsmanagement::ListMembersResponse>> fetcher_;
   base::OneShotTimer timer_;
diff --git a/components/supervised_user/core/browser/list_family_members_service_unittest.cc b/components/supervised_user/core/browser/list_family_members_service_unittest.cc
index ddd32b3..c3629e4 100644
--- a/components/supervised_user/core/browser/list_family_members_service_unittest.cc
+++ b/components/supervised_user/core/browser/list_family_members_service_unittest.cc
@@ -120,49 +120,3 @@
 
   test_list_family_members_service_->Cancel();
 }
-
-TEST_F(ListFamilyMembersServiceTest, OnceCallbacksAreDisposable) {
-  // Mock of supervised_user::FamilyPreferencesService::SetFamily, taking the
-  // list family response from fetches. We check if the response is correct at
-  // the last step with `hoh_username`.
-  std::string hoh_username;
-  auto extract_hoh_display_name_from_response = base::BindLambdaForTesting(
-      [&](const kidsmanagement::ListMembersResponse& response) {
-        ASSERT_FALSE(response.members().empty());
-        ASSERT_EQ("", hoh_username);
-        hoh_username = response.members().at(0).profile().display_name();
-      });
-
-  // Subscribe to the mock method.
-  base::CallbackListSubscription subscription =
-      test_list_family_members_service_->SubscribeToNextSuccessfulFetch(
-          extract_hoh_display_name_from_response);
-
-  // Test the `fetcher_`.
-  identity_test_env_.MakePrimaryAccountAvailable("user_child@gmail.com",
-                                                 signin::ConsentLevel::kSignin);
-  test_list_family_members_service_->Start();
-
-  // Perform the sequence of obtaining an access token, simulating response and
-  // verifying the result.
-  identity_test_env_.WaitForAccessTokenRequestIfNecessaryAndRespondWithToken(
-      "access_token", base::Time::Max());
-  ASSERT_EQ(1, test_url_loader_factory_.NumPending());
-  SimulateResponseForPendingRequest("username_hoh");
-  ASSERT_EQ(0, test_url_loader_factory_.NumPending());
-  EXPECT_EQ(hoh_username, "username_hoh");
-
-  task_environment_.FastForwardBy(base::Days(2));
-
-  // Perform another sequence of obtaining an access token, simulating response
-  // and verifying the result. This time, the `hoh_username` value will not be
-  // updated because the callback was disposed after first use.
-  identity_test_env_.WaitForAccessTokenRequestIfNecessaryAndRespondWithToken(
-      "access_token", base::Time::Max());
-  ASSERT_EQ(1, test_url_loader_factory_.NumPending());
-  SimulateResponseForPendingRequest("another_username_hoh");
-  ASSERT_EQ(0, test_url_loader_factory_.NumPending());
-  EXPECT_EQ(hoh_username, "username_hoh");
-
-  test_list_family_members_service_->Cancel();
-}
diff --git a/components/sync/BUILD.gn b/components/sync/BUILD.gn
index c81ab7d1..d59944b 100644
--- a/components/sync/BUILD.gn
+++ b/components/sync/BUILD.gn
@@ -268,6 +268,7 @@
     "service/sync_session_durations_metrics_recorder_unittest.cc",
     "service/sync_stopped_reporter_unittest.cc",
     "service/sync_user_settings_impl_unittest.cc",
+    "service/trusted_vault_synthetic_field_trial_unittest.cc",
   ]
 
   if (is_chromeos) {
diff --git a/components/sync/base/pref_names.h b/components/sync/base/pref_names.h
index de88c80..c484a136 100644
--- a/components/sync/base/pref_names.h
+++ b/components/sync/base/pref_names.h
@@ -109,6 +109,11 @@
 inline constexpr char kSyncCachedPassphraseType[] =
     "sync.cached_passphrase_type";
 
+// The user's AutoUpgradeDebugInfo, determined the first time the engine is
+// successfully initialized.
+inline constexpr char kSyncCachedTrustedVaultAutoUpgradeDebugInfo[] =
+    "sync.cached_trusted_vault_auto_upgrade_debug_info";
+
 // A string that can be used to restore sync encryption infrastructure on
 // startup so that the user doesn't need to provide credentials on each start.
 inline constexpr char kSyncEncryptionBootstrapToken[] =
diff --git a/components/sync/protocol/nigori_specifics.proto b/components/sync/protocol/nigori_specifics.proto
index d61bbae..e56a3442 100644
--- a/components/sync/protocol/nigori_specifics.proto
+++ b/components/sync/protocol/nigori_specifics.proto
@@ -31,6 +31,10 @@
   // The key version, used for key rotation.
   optional int32 version = 1;
   // Private key on Curve25519 (32 bytes).
+  // Encryption: Hybrid Public Key Encryption (HPKE)
+  // KEM: DHKEM_X25519_HKDF_SHA256
+  // KDF: HKDF_SHA256
+  // AEAD: CHACHA20_POLY1305
   optional bytes x25519_private_key = 2;
 }
 
@@ -38,6 +42,10 @@
   // The key version, used for key rotation and consensus.
   optional int32 version = 1;
   // Public key on Curve25519 (32 bytes).
+  // Encryption: Hybrid Public Key Encryption (HPKE)
+  // KEM: DHKEM_X25519_HKDF_SHA256
+  // KDF: HKDF_SHA256
+  // AEAD: CHACHA20_POLY1305
   optional bytes x25519_public_key = 2;
 }
 
diff --git a/components/sync/service/BUILD.gn b/components/sync/service/BUILD.gn
index 5e82992..4e0bed5e 100644
--- a/components/sync/service/BUILD.gn
+++ b/components/sync/service/BUILD.gn
@@ -74,6 +74,8 @@
     "syncable_service_based_model_type_controller.h",
     "trusted_vault_histograms.cc",
     "trusted_vault_histograms.h",
+    "trusted_vault_synthetic_field_trial.cc",
+    "trusted_vault_synthetic_field_trial.h",
   ]
 
   public_deps = [
diff --git a/components/sync/service/sync_client.h b/components/sync/service/sync_client.h
index 856ab2e..1d1d5ad 100644
--- a/components/sync/service/sync_client.h
+++ b/components/sync/service/sync_client.h
@@ -30,6 +30,7 @@
 class SyncApiComponentFactory;
 class SyncInvalidationsService;
 class SyncService;
+class TrustedVaultAutoUpgradeSyntheticFieldTrialGroup;
 
 // Interface for clients of the Sync API to plumb through necessary dependent
 // components. This interface is purely for abstracting dependencies, and
@@ -105,6 +106,12 @@
   // TODO(crbug.com/40065374): Mark as pure virtual once all implementations
   // have overridden this.
   virtual void TriggerLocalDataMigration(ModelTypeSet types);
+
+  // Registers synthetic field trials corresponding to autoupgrading users to
+  // trusted vault passphrase type. `group` must be valid. Must be invoked at
+  // most once.
+  virtual void RegisterTrustedVaultAutoUpgradeSyntheticFieldTrial(
+      const TrustedVaultAutoUpgradeSyntheticFieldTrialGroup& group) = 0;
 };
 
 }  // namespace syncer
diff --git a/components/sync/service/sync_prefs.cc b/components/sync/service/sync_prefs.cc
index 8f1e74d1..e7f0aa2c 100644
--- a/components/sync/service/sync_prefs.cc
+++ b/components/sync/service/sync_prefs.cc
@@ -6,6 +6,7 @@
 
 #include <utility>
 
+#include "base/base64.h"
 #include "base/check_op.h"
 #include "base/containers/contains.h"
 #include "base/feature_list.h"
@@ -66,6 +67,28 @@
 constexpr int kMigratedPart1ButNot2 = 1;
 constexpr int kMigratedPart2AndFullyDone = 2;
 
+// Encodes a protobuf instance of type
+// sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo in a way that can be safely
+// stored in prefs, i.e. using base64 encoding.
+std::string EncodeTrustedVaultAutoUpgradeDebugInfoToString(
+    const sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo& debug_info) {
+  return base::Base64Encode(debug_info.SerializeAsString());
+}
+
+// Does the opposite of EncodeTrustedVaultAutoUpgradeDebugInfoToString(), i.e.
+// transforms from a string representation to a protobuf instance.
+sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo
+DecodeTrustedVaultAutoUpgradeDebugInfoFromString(
+    const std::string& encoded_debug_info) {
+  sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo proto;
+  std::string serialized_proto;
+  if (!base::Base64Decode(encoded_debug_info, &serialized_proto)) {
+    return proto;
+  }
+  proto.ParseFromString(serialized_proto);
+  return proto;
+}
+
 }  // namespace
 
 SyncPrefObserver::~SyncPrefObserver() = default;
@@ -176,6 +199,10 @@
   registry->RegisterIntegerPref(
       prefs::internal::kSyncCachedPassphraseType,
       sync_pb::NigoriSpecifics_PassphraseType_UNKNOWN);
+  // The user's AutoUpgradeDebugInfo, determined the first time the engine is
+  // successfully initialized.
+  registry->RegisterStringPref(
+      prefs::internal::kSyncCachedTrustedVaultAutoUpgradeDebugInfo, "");
   // The encryption bootstrap token represents a user-entered passphrase.
   registry->RegisterStringPref(prefs::internal::kSyncEncryptionBootstrapToken,
                                std::string());
@@ -549,19 +576,48 @@
 }
 
 std::optional<PassphraseType> SyncPrefs::GetCachedPassphraseType() const {
+  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   return ProtoPassphraseInt32ToEnum(
       pref_service_->GetInteger(prefs::internal::kSyncCachedPassphraseType));
 }
 
 void SyncPrefs::SetCachedPassphraseType(PassphraseType passphrase_type) {
+  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   pref_service_->SetInteger(prefs::internal::kSyncCachedPassphraseType,
                             EnumPassphraseTypeToProto(passphrase_type));
 }
 
 void SyncPrefs::ClearCachedPassphraseType() {
+  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   pref_service_->ClearPref(prefs::internal::kSyncCachedPassphraseType);
 }
 
+std::optional<sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo>
+SyncPrefs::GetCachedTrustedVaultAutoUpgradeDebugInfo() const {
+  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+  const std::string& encoded_debug_info = pref_service_->GetString(
+      prefs::internal::kSyncCachedTrustedVaultAutoUpgradeDebugInfo);
+  if (encoded_debug_info.empty()) {
+    return std::nullopt;
+  }
+  return DecodeTrustedVaultAutoUpgradeDebugInfoFromString(encoded_debug_info);
+}
+
+void SyncPrefs::SetCachedTrustedVaultAutoUpgradeDebugInfo(
+    const sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo&
+        auto_upgrade_debug_info) {
+  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+  pref_service_->SetString(
+      prefs::internal::kSyncCachedTrustedVaultAutoUpgradeDebugInfo,
+      EncodeTrustedVaultAutoUpgradeDebugInfoToString(auto_upgrade_debug_info));
+}
+
+void SyncPrefs::ClearCachedTrustedVaultAutoUpgradeDebugInfo() {
+  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+  pref_service_->ClearPref(
+      prefs::internal::kSyncCachedTrustedVaultAutoUpgradeDebugInfo);
+}
+
 void SyncPrefs::ClearAllEncryptionBootstrapTokens() {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   pref_service_->ClearPref(prefs::internal::kSyncEncryptionBootstrapToken);
diff --git a/components/sync/service/sync_prefs.h b/components/sync/service/sync_prefs.h
index 2275d09..c7a2950 100644
--- a/components/sync/service/sync_prefs.h
+++ b/components/sync/service/sync_prefs.h
@@ -18,6 +18,7 @@
 #include "components/prefs/pref_member.h"
 #include "components/sync/base/passphrase_enums.h"
 #include "components/sync/base/user_selectable_type.h"
+#include "components/sync/protocol/nigori_specifics.pb.h"
 
 class PrefRegistrySimple;
 class PrefService;
@@ -201,6 +202,15 @@
   void SetCachedPassphraseType(PassphraseType passphrase_type);
   void ClearCachedPassphraseType();
 
+  // The user's AutoUpgradeDebugInfo, determined the first time the engine is
+  // successfully initialized.
+  std::optional<sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo>
+  GetCachedTrustedVaultAutoUpgradeDebugInfo() const;
+  void SetCachedTrustedVaultAutoUpgradeDebugInfo(
+      const sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo&
+          auto_upgrade_debug_info);
+  void ClearCachedTrustedVaultAutoUpgradeDebugInfo();
+
   // The encryption bootstrap token is used for explicit passphrase users
   // (usually custom passphrase) and represents a user-entered passphrase.
   // TODO(crbug.com/40282890): ClearAllEncryptionBootstrapTokens is only needed
diff --git a/components/sync/service/sync_prefs_unittest.cc b/components/sync/service/sync_prefs_unittest.cc
index 88ea9b09..42c21df 100644
--- a/components/sync/service/sync_prefs_unittest.cc
+++ b/components/sync/service/sync_prefs_unittest.cc
@@ -7,6 +7,7 @@
 #include <memory>
 #include <vector>
 
+#include "base/base64.h"
 #include "base/test/scoped_feature_list.h"
 #include "base/test/task_environment.h"
 #include "build/chromeos_buildflags.h"
@@ -115,6 +116,59 @@
   EXPECT_FALSE(sync_prefs_->GetCachedPassphraseType().has_value());
 }
 
+TEST_F(SyncPrefsTest, CachedTrustedVaultAutoUpgradeDebugInfo) {
+  const int kTestCohortId = 123;
+
+  EXPECT_FALSE(
+      sync_prefs_->GetCachedTrustedVaultAutoUpgradeDebugInfo().has_value());
+
+  sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo proto;
+  proto.set_auto_upgrade_cohort_id(kTestCohortId);
+  sync_prefs_->SetCachedTrustedVaultAutoUpgradeDebugInfo(proto);
+
+  EXPECT_TRUE(
+      sync_prefs_->GetCachedTrustedVaultAutoUpgradeDebugInfo().has_value());
+  EXPECT_EQ(kTestCohortId,
+            sync_prefs_->GetCachedTrustedVaultAutoUpgradeDebugInfo()
+                .value_or(sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo())
+                .auto_upgrade_cohort_id());
+
+  sync_prefs_->ClearCachedTrustedVaultAutoUpgradeDebugInfo();
+  EXPECT_FALSE(
+      sync_prefs_->GetCachedTrustedVaultAutoUpgradeDebugInfo().has_value());
+}
+
+TEST_F(SyncPrefsTest, CachedTrustedVaultAutoUpgradeDebugInfoCorrupt) {
+  // Populate with a corrupt, non-base64 value.
+  pref_service_.SetString(
+      prefs::internal::kSyncCachedTrustedVaultAutoUpgradeDebugInfo, "corrupt");
+  EXPECT_TRUE(
+      sync_prefs_->GetCachedTrustedVaultAutoUpgradeDebugInfo().has_value());
+  EXPECT_EQ(0, sync_prefs_->GetCachedTrustedVaultAutoUpgradeDebugInfo()
+                   .value_or(sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo())
+                   .auto_upgrade_cohort_id());
+  EXPECT_EQ(sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::
+                AUTO_UPGRADE_EXPERIMENT_GROUP_UNSPECIFIED,
+            sync_prefs_->GetCachedTrustedVaultAutoUpgradeDebugInfo()
+                .value_or(sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo())
+                .auto_upgrade_experiment_group());
+
+  // Populate with a corrupt, unparsable value after base64-decoding.
+  pref_service_.SetString(
+      prefs::internal::kSyncCachedTrustedVaultAutoUpgradeDebugInfo,
+      base::Base64Encode("corrupt"));
+  EXPECT_TRUE(
+      sync_prefs_->GetCachedTrustedVaultAutoUpgradeDebugInfo().has_value());
+  EXPECT_EQ(0, sync_prefs_->GetCachedTrustedVaultAutoUpgradeDebugInfo()
+                   .value_or(sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo())
+                   .auto_upgrade_cohort_id());
+  EXPECT_EQ(sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::
+                AUTO_UPGRADE_EXPERIMENT_GROUP_UNSPECIFIED,
+            sync_prefs_->GetCachedTrustedVaultAutoUpgradeDebugInfo()
+                .value_or(sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo())
+                .auto_upgrade_experiment_group());
+}
+
 class MockSyncPrefObserver : public SyncPrefObserver {
  public:
   MOCK_METHOD(void, OnSyncManagedPrefChange, (bool), (override));
diff --git a/components/sync/service/sync_service_impl.cc b/components/sync/service/sync_service_impl.cc
index d380c10..a872665 100644
--- a/components/sync/service/sync_service_impl.cc
+++ b/components/sync/service/sync_service_impl.cc
@@ -53,6 +53,7 @@
 #include "components/sync/service/sync_prefs_policy_handler.h"
 #include "components/sync/service/sync_service_utils.h"
 #include "components/sync/service/trusted_vault_histograms.h"
+#include "components/sync/service/trusted_vault_synthetic_field_trial.h"
 #include "google_apis/gaia/google_service_auth_error.h"
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 
@@ -264,6 +265,40 @@
   if (identity_manager_) {
     identity_manager_->AddObserver(this);
   }
+
+  // Based on the information cached in preferences, it might be required to
+  // register a synthetic field trial group. This should be done as early as
+  // possible to avoid untagged metrics if they get logged before other events
+  // like sync engine initialization, which could take arbitrarily long (e.g.
+  // persistent auth error).
+  RegisterTrustedVaultSyntheticFieldTrialsIfNecessary();
+}
+
+void SyncServiceImpl::RegisterTrustedVaultSyntheticFieldTrialsIfNecessary() {
+  const sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo debug_info =
+      sync_prefs_.GetCachedTrustedVaultAutoUpgradeDebugInfo().value_or(
+          sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo());
+
+  const TrustedVaultAutoUpgradeSyntheticFieldTrialGroup group =
+      TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::FromProto(
+          debug_info.auto_upgrade_experiment_group(),
+          debug_info.auto_upgrade_cohort_id());
+
+  if (trusted_vault_auto_upgrade_synthetic_field_trial_registered_) {
+    // Registration function already invoked. It cannot be invoked twice, as
+    // runtime changes to the group assignment is not supported (e.g. signout).
+    return;
+  }
+
+  if (!group.is_valid()) {
+    // Broadcasting an invalid group isn't allowed, as it would otherwise use
+    // the only chance to invoke the registration function below, which may only
+    // be invoked once.
+    return;
+  }
+
+  trusted_vault_auto_upgrade_synthetic_field_trial_registered_ = true;
+  sync_client_->RegisterTrustedVaultAutoUpgradeSyntheticFieldTrial(group);
 }
 
 SyncServiceImpl::~SyncServiceImpl() {
@@ -1026,6 +1061,10 @@
       signin::GaiaIdHash::FromGaiaId(GetAccountInfo().gaia),
       user_settings_->IsUsingExplicitPassphrase());
 
+  // Cache trusted vault debug info into prefs, to make it synchronously
+  // available upon future profile startups.
+  CacheTrustedVaultDebugInfoToPrefsFromEngine();
+
   if (CanConfigureDataTypes(/*bypass_setup_in_progress_check=*/false)) {
     // Datatype downloads on restart are generally due to newly supported
     // datatypes (although it's also possible we're picking up where a failed
@@ -1051,9 +1090,18 @@
 
 void SyncServiceImpl::OnSyncCycleCompleted(const SyncCycleSnapshot& snapshot) {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+  CHECK(engine_);
+  CHECK(engine_->IsInitialized());
 
   last_snapshot_ = snapshot;
 
+  // Cache trusted vault debug info into prefs, to make it synchronously
+  // available upon future profile startups. In most cases this will happen in
+  // OnEngineInitialized(), but it may also happen that the information was just
+  // populated server-side and downloaded, after (or long after) the engine is
+  // initialized.
+  CacheTrustedVaultDebugInfoToPrefsFromEngine();
+
   DVLOG(2) << "Notifying observers sync cycle completed";
   NotifySyncCycleCompleted();
 }
@@ -2112,9 +2160,22 @@
 }
 
 void SyncServiceImpl::OnPasswordSyncAllowedChanged() {
+  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   sync_prefs_.SetPasswordSyncAllowed(sync_client_->IsPasswordSyncAllowed());
 }
 
+void SyncServiceImpl::CacheTrustedVaultDebugInfoToPrefsFromEngine() {
+  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+  CHECK(engine_);
+  CHECK(engine_->IsInitialized());
+
+  sync_prefs_.SetCachedTrustedVaultAutoUpgradeDebugInfo(
+      engine_->GetDetailedStatus()
+          .trusted_vault_debug_info.auto_upgrade_debug_info());
+
+  RegisterTrustedVaultSyntheticFieldTrialsIfNecessary();
+}
+
 CoreAccountInfo SyncServiceImpl::GetAccountInfo() const {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   if (!auth_manager_) {
@@ -2207,8 +2268,9 @@
   sync_prefs_.ClearInitialSyncFeatureSetupComplete();
 #endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
   sync_prefs_.ClearPassphrasePromptMutedProductVersion();
-  // The passphrase type is now undefined again.
+  // Cached information provided by SyncEngine must be cleared.
   sync_prefs_.ClearCachedPassphraseType();
+  sync_prefs_.ClearCachedTrustedVaultAutoUpgradeDebugInfo();
   // If the migration didn't finish before StopAndClear() was called, mark it as
   // done so it doesn't trigger again if the user signs in later.
   sync_prefs_.MarkPartialSyncToSigninMigrationFullyDone();
diff --git a/components/sync/service/sync_service_impl.h b/components/sync/service/sync_service_impl.h
index bec0da0..e5527c1 100644
--- a/components/sync/service/sync_service_impl.h
+++ b/components/sync/service/sync_service_impl.h
@@ -410,6 +410,14 @@
 
   void OnPasswordSyncAllowedChanged();
 
+  // Updates PrefService (SyncPrefs) to cache the last known value for trusted
+  // vault AutoUpgradeDebugInfo. It also notifies SyncClient.
+  void CacheTrustedVaultDebugInfoToPrefsFromEngine();
+
+  // Exercises SyncClient to register synthetic field trials for trusted vault
+  // passphrase type.
+  void RegisterTrustedVaultSyntheticFieldTrialsIfNecessary();
+
   // This profile's SyncClient, which abstracts away non-Sync dependencies and
   // the Sync API component factory.
   const std::unique_ptr<SyncClient> sync_client_;
@@ -514,6 +522,10 @@
   // recorded or trusted vault passphrase type wasn't used on startup.
   bool should_record_trusted_vault_error_shown_on_startup_ = true;
 
+  // Whether or not SyncClient was exercised to register synthetic field trials
+  // related to trusted vault passphrase.
+  bool trusted_vault_auto_upgrade_synthetic_field_trial_registered_ = false;
+
   const bool sync_poll_immediately_on_every_startup_;
 
   // Whether we want to receive invalidations for the SESSIONS data type. This
diff --git a/components/sync/service/sync_service_impl_unittest.cc b/components/sync/service/sync_service_impl_unittest.cc
index 128a01b0..954c7231 100644
--- a/components/sync/service/sync_service_impl_unittest.cc
+++ b/components/sync/service/sync_service_impl_unittest.cc
@@ -36,9 +36,11 @@
 #include "components/sync/base/sync_util.h"
 #include "components/sync/base/user_selectable_type.h"
 #include "components/sync/engine/nigori/key_derivation_params.h"
+#include "components/sync/engine/sync_status.h"
 #include "components/sync/service/data_type_manager_impl.h"
 #include "components/sync/service/sync_service_observer.h"
 #include "components/sync/service/sync_token_status.h"
+#include "components/sync/service/trusted_vault_synthetic_field_trial.h"
 #include "components/sync/test/fake_model_type_controller.h"
 #include "components/sync/test/fake_sync_api_component_factory.h"
 #include "components/sync/test/fake_sync_engine.h"
@@ -59,17 +61,22 @@
 using testing::IsEmpty;
 using testing::IsNull;
 using testing::Not;
+using testing::NotNull;
 using testing::Return;
 
 namespace syncer {
 
 namespace {
 
+constexpr char kTestUser[] = "test_user@gmail.com";
+
 MATCHER_P(ContainsDataType, type, "") {
   return arg.Has(type);
 }
 
-constexpr char kTestUser[] = "test_user@gmail.com";
+MATCHER_P(IsValidFieldTrialGroupWithName, expected_name, "") {
+  return arg.is_valid() && arg.name() == expected_name;
+}
 
 SyncCycleSnapshot MakeDefaultSyncCycleSnapshot() {
   // It doesn't matter what exactly we set here, it's only relevant that the
@@ -2317,5 +2324,88 @@
   service()->RemoveObserver(&mock_sync_service_observer);
 }
 
+TEST_F(SyncServiceImplTest, ShouldCacheTrustedVaultAutoUpgradeDebugInfo) {
+  const int kTestCohortId1 = 11;
+  const int kTestCohortId2 = 22;
+
+  component_factory()->AllowFakeEngineInitCompletion(false);
+  InitializeService();
+  base::RunLoop().RunUntilIdle();
+  SignInWithSyncConsent();
+
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+  ASSERT_TRUE(
+      service()->GetUserSettings()->IsInitialSyncFeatureSetupComplete());
+#else   // BUILDFLAG(IS_CHROMEOS_ASH)
+  service()->GetUserSettings()->SetInitialSyncFeatureSetupComplete(
+      syncer::SyncFirstSetupCompleteSource::BASIC_FLOW);
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
+
+  base::RunLoop().RunUntilIdle();
+
+  ASSERT_EQ(SyncService::TransportState::INITIALIZING,
+            service()->GetTransportState());
+  ASSERT_THAT(engine(), NotNull());
+
+  {
+    SyncStatus sync_status;
+    sync_status.trusted_vault_debug_info.mutable_auto_upgrade_debug_info()
+        ->set_auto_upgrade_cohort_id(kTestCohortId1);
+    sync_status.trusted_vault_debug_info.mutable_auto_upgrade_debug_info()
+        ->set_auto_upgrade_experiment_group(
+            sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::CONTROL);
+    engine()->SetDetailedStatus(sync_status);
+  }
+
+  // Completing initialization should exercise SyncClient's field trial
+  // registration.
+  EXPECT_CALL(*sync_client(),
+              RegisterTrustedVaultAutoUpgradeSyntheticFieldTrial(
+                  IsValidFieldTrialGroupWithName("Control_11")));
+
+  base::RunLoop().RunUntilIdle();
+  engine()->TriggerInitializationCompletion(/*success=*/true);
+
+  ASSERT_EQ(SyncService::TransportState::ACTIVE,
+            service()->GetTransportState());
+
+  testing::Mock::VerifyAndClearExpectations(sync_client());
+
+  // Verify that the debug info has been cached in prefs.
+  SyncPrefs sync_prefs(prefs());
+  EXPECT_TRUE(
+      sync_prefs.GetCachedTrustedVaultAutoUpgradeDebugInfo().has_value());
+  EXPECT_EQ(sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::CONTROL,
+            sync_prefs.GetCachedTrustedVaultAutoUpgradeDebugInfo()
+                .value_or(sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo())
+                .auto_upgrade_experiment_group());
+  EXPECT_EQ(kTestCohortId1,
+            sync_prefs.GetCachedTrustedVaultAutoUpgradeDebugInfo()
+                .value_or(sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo())
+                .auto_upgrade_cohort_id());
+
+  // The SyncClient API should not be invoked for the second time.
+  EXPECT_CALL(*sync_client(),
+              RegisterTrustedVaultAutoUpgradeSyntheticFieldTrial)
+      .Times(0);
+
+  // Mimic another sync cycle that mutates the debug info.
+  {
+    SyncStatus sync_status;
+    sync_status.trusted_vault_debug_info.mutable_auto_upgrade_debug_info()
+        ->set_auto_upgrade_cohort_id(kTestCohortId2);
+    sync_status.trusted_vault_debug_info.mutable_auto_upgrade_debug_info()
+        ->set_auto_upgrade_experiment_group(
+            sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::CONTROL);
+    engine()->SetDetailedStatus(sync_status);
+    service()->OnSyncCycleCompleted(MakeDefaultSyncCycleSnapshot());
+  }
+
+  EXPECT_EQ(kTestCohortId2,
+            sync_prefs.GetCachedTrustedVaultAutoUpgradeDebugInfo()
+                .value_or(sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo())
+                .auto_upgrade_cohort_id());
+}
+
 }  // namespace
 }  // namespace syncer
diff --git a/components/sync/service/trusted_vault_synthetic_field_trial.cc b/components/sync/service/trusted_vault_synthetic_field_trial.cc
new file mode 100644
index 0000000..8cbe129
--- /dev/null
+++ b/components/sync/service/trusted_vault_synthetic_field_trial.cc
@@ -0,0 +1,87 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/sync/service/trusted_vault_synthetic_field_trial.h"
+
+#include <ostream>
+#include <string>
+
+#include "base/notreached.h"
+#include "base/strings/stringprintf.h"
+
+namespace syncer {
+namespace {
+
+// Arbitrary and generious limit for the cohort ID.
+constexpr int kMaxCohortId = 100;
+
+std::string GetGroupName(
+    sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::AutoUpgradeExperimentGroup
+        group,
+    int cohort_id) {
+  if (cohort_id <= 0 || cohort_id > kMaxCohortId) {
+    // Invalid cohort ID.
+    return std::string();
+  }
+
+  switch (group) {
+    case sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::
+        AUTO_UPGRADE_EXPERIMENT_GROUP_UNSPECIFIED:
+      return std::string();
+    case sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::TREATMENT:
+      return base::StringPrintf("Treatment_%d", cohort_id);
+    case sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::CONTROL:
+      return base::StringPrintf("Control_%d", cohort_id);
+    case sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::VALIDATION:
+      return base::StringPrintf("Validation_%d", cohort_id);
+  }
+
+  NOTREACHED_NORETURN();
+}
+
+}  // namespace
+
+// static
+TrustedVaultAutoUpgradeSyntheticFieldTrialGroup
+TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::FromProto(
+    sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::AutoUpgradeExperimentGroup
+        group,
+    int cohort_id) {
+  TrustedVaultAutoUpgradeSyntheticFieldTrialGroup instance;
+  instance.name_ = GetGroupName(group, cohort_id);
+  return instance;
+}
+
+TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::
+    TrustedVaultAutoUpgradeSyntheticFieldTrialGroup() = default;
+
+TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::
+    TrustedVaultAutoUpgradeSyntheticFieldTrialGroup(
+        const TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&) = default;
+
+TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::
+    TrustedVaultAutoUpgradeSyntheticFieldTrialGroup(
+        TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&&) = default;
+
+TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::
+    ~TrustedVaultAutoUpgradeSyntheticFieldTrialGroup() = default;
+
+TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&
+TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::operator=(
+    const TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&) = default;
+
+TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&
+TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::operator=(
+    TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&&) = default;
+
+void PrintTo(const TrustedVaultAutoUpgradeSyntheticFieldTrialGroup& group,
+             std::ostream* os) {
+  if (group.is_valid()) {
+    *os << group.name();
+  } else {
+    *os << "<invalid-group>";
+  }
+}
+
+}  // namespace syncer
diff --git a/components/sync/service/trusted_vault_synthetic_field_trial.h b/components/sync/service/trusted_vault_synthetic_field_trial.h
new file mode 100644
index 0000000..1a63fef
--- /dev/null
+++ b/components/sync/service/trusted_vault_synthetic_field_trial.h
@@ -0,0 +1,51 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_SYNC_SERVICE_TRUSTED_VAULT_SYNTHETIC_FIELD_TRIAL_H_
+#define COMPONENTS_SYNC_SERVICE_TRUSTED_VAULT_SYNTHETIC_FIELD_TRIAL_H_
+
+#include <iosfwd>
+#include <string>
+
+#include "components/sync/protocol/nigori_specifics.pb.h"
+
+namespace syncer {
+
+class TrustedVaultAutoUpgradeSyntheticFieldTrialGroup {
+ public:
+  // Constructs an instance from a protobuf. Returns an invalid instance,
+  // detectable via `is_valid()`, if the input is invalid.
+  static TrustedVaultAutoUpgradeSyntheticFieldTrialGroup FromProto(
+      sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::AutoUpgradeExperimentGroup
+          group,
+      int cohort_id);
+
+  // Constructs an invalid value.
+  TrustedVaultAutoUpgradeSyntheticFieldTrialGroup();
+  TrustedVaultAutoUpgradeSyntheticFieldTrialGroup(
+      const TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&);
+  TrustedVaultAutoUpgradeSyntheticFieldTrialGroup(
+      TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&&);
+  ~TrustedVaultAutoUpgradeSyntheticFieldTrialGroup();
+
+  TrustedVaultAutoUpgradeSyntheticFieldTrialGroup& operator=(
+      const TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&);
+  TrustedVaultAutoUpgradeSyntheticFieldTrialGroup& operator=(
+      TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&&);
+
+  bool is_valid() const { return !name_.empty(); }
+  const std::string& name() const { return name_; }
+
+ private:
+  // Empty if `this` is invalid.
+  std::string name_;
+};
+
+// gMock printer helper.
+void PrintTo(const TrustedVaultAutoUpgradeSyntheticFieldTrialGroup& group,
+             std::ostream* os);
+
+}  // namespace syncer
+
+#endif  // COMPONENTS_SYNC_SERVICE_TRUSTED_VAULT_SYNTHETIC_FIELD_TRIAL_H_
diff --git a/components/sync/service/trusted_vault_synthetic_field_trial_unittest.cc b/components/sync/service/trusted_vault_synthetic_field_trial_unittest.cc
new file mode 100644
index 0000000..d3fb470d
--- /dev/null
+++ b/components/sync/service/trusted_vault_synthetic_field_trial_unittest.cc
@@ -0,0 +1,68 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/sync/service/trusted_vault_synthetic_field_trial.h"
+
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace syncer {
+
+namespace {
+
+MATCHER(IsNotValid, "") {
+  return !arg.is_valid();
+}
+
+MATCHER_P(IsValidWithName, expected_name, "") {
+  return arg.is_valid() && arg.name() == expected_name;
+}
+
+TEST(TrustedVaultSyntheticFieldTrialTest, ShouldBuildInvalidGroup) {
+  EXPECT_THAT(TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::FromProto(
+                  sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::
+                      AUTO_UPGRADE_EXPERIMENT_GROUP_UNSPECIFIED,
+                  /*cohort_id=*/1),
+              IsNotValid());
+  EXPECT_THAT(TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::FromProto(
+                  sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::CONTROL,
+                  /*cohort_id=*/0),
+              IsNotValid());
+  EXPECT_THAT(TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::FromProto(
+                  sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::CONTROL,
+                  /*cohort_id=*/-1),
+              IsNotValid());
+  EXPECT_THAT(TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::FromProto(
+                  sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::CONTROL,
+                  /*cohort_id=*/101),
+              IsNotValid());
+}
+
+TEST(TrustedVaultSyntheticFieldTrialTest,
+     ShouldBuildInvalidGroupFromProtoDefaults) {
+  sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo debug_info;
+  EXPECT_THAT(TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::FromProto(
+                  debug_info.auto_upgrade_experiment_group(),
+                  debug_info.auto_upgrade_cohort_id()),
+              IsNotValid());
+}
+
+TEST(TrustedVaultSyntheticFieldTrialTest, ShouldGetValidGroupName) {
+  EXPECT_THAT(TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::FromProto(
+                  sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::TREATMENT,
+                  /*cohort_id=*/5),
+              IsValidWithName("Treatment_5"));
+  EXPECT_THAT(TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::FromProto(
+                  sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::CONTROL,
+                  /*cohort_id=*/6),
+              IsValidWithName("Control_6"));
+  EXPECT_THAT(TrustedVaultAutoUpgradeSyntheticFieldTrialGroup::FromProto(
+                  sync_pb::NigoriSpecifics::AutoUpgradeDebugInfo::VALIDATION,
+                  /*cohort_id=*/7),
+              IsValidWithName("Validation_7"));
+}
+
+}  // namespace
+
+}  // namespace syncer
diff --git a/components/sync/test/sync_client_mock.h b/components/sync/test/sync_client_mock.h
index 28f7e26..e261d09 100644
--- a/components/sync/test/sync_client_mock.h
+++ b/components/sync/test/sync_client_mock.h
@@ -64,6 +64,10 @@
               TriggerLocalDataMigration,
               (ModelTypeSet types),
               (override));
+  MOCK_METHOD(void,
+              RegisterTrustedVaultAutoUpgradeSyntheticFieldTrial,
+              (const TrustedVaultAutoUpgradeSyntheticFieldTrialGroup&),
+              (override));
 };
 
 }  // namespace syncer
diff --git a/components/test/data/autofill/heuristics-json/internal b/components/test/data/autofill/heuristics-json/internal
index c239a0f..9237eb7 160000
--- a/components/test/data/autofill/heuristics-json/internal
+++ b/components/test/data/autofill/heuristics-json/internal
@@ -1 +1 @@
-Subproject commit c239a0f3f47d7c2b4fa57d27344575be171d3099
+Subproject commit 9237eb78073f68624f87a51db70a1b5ae04b9537
diff --git a/content/browser/aggregation_service/aggregatable_report.cc b/content/browser/aggregation_service/aggregatable_report.cc
index 0531ae08..aca80a8 100644
--- a/content/browser/aggregation_service/aggregatable_report.cc
+++ b/content/browser/aggregation_service/aggregatable_report.cc
@@ -192,31 +192,31 @@
 void AppendEncodedContributionToCborArray(
     cbor::Value::ArrayValue& array,
     const blink::mojom::AggregatableReportHistogramContribution& contribution,
-    std::optional<size_t> filtering_id_byte_size) {
+    std::optional<size_t> filtering_id_max_bytes) {
   cbor::Value::MapValue map;
   map.emplace("bucket", U128ToBigEndian(contribution.bucket));
   map.emplace("value", base::numerics::U32ToBigEndian(contribution.value));
 
-  // Only include filtering ID in the format if byte size is non-null.
-  if (filtering_id_byte_size.has_value()) {
+  // Only include filtering ID in the format if max bytes is non-null.
+  if (filtering_id_max_bytes.has_value()) {
     uint64_t filtering_id = contribution.filtering_id.value_or(0);
     CHECK_LE(static_cast<size_t>(std::bit_width(filtering_id)),
-             kBitsPerByte * filtering_id_byte_size.value());
+             kBitsPerByte * filtering_id_max_bytes.value());
 
     static_assert(
-        AggregationServicePayloadContents::kMaximumFilteringIdByteSize == 8);
+        AggregationServicePayloadContents::kMaximumFilteringIdMaxBytes == 8);
     std::array<uint8_t, 8u> encoded_id;
     encoded_id.fill(0);
     base::make_span(encoded_id)
         .copy_from(base::numerics::U64ToBigEndian(filtering_id));
 
     // Note that the payload will have a length dependent on the choice of
-    // `filtering_id_byte_size` here. APIs using this field should ensure that
+    // `filtering_id_max_bytes` here. APIs using this field should ensure that
     // this value is not dependent on cross-site data (or only allow it to vary
     // in debug mode).
     map.emplace("id",
                 base::span(encoded_id)
-                    .last(static_cast<size_t>(filtering_id_byte_size.value())));
+                    .last(static_cast<size_t>(filtering_id_max_bytes.value())));
   } else {
     CHECK(!contribution.filtering_id.has_value());
   }
@@ -238,7 +238,7 @@
       [&](const blink::mojom::AggregatableReportHistogramContribution&
               contribution) {
         AppendEncodedContributionToCborArray(
-            data, contribution, payload_contents.filtering_id_byte_size);
+            data, contribution, payload_contents.filtering_id_max_bytes);
       });
 
   int number_of_null_contributions_to_add = 0;
@@ -257,7 +257,7 @@
         data,
         blink::mojom::AggregatableReportHistogramContribution(
             /*bucket=*/0, /*value=*/0, /*filtering_id=*/std::nullopt),
-        payload_contents.filtering_id_byte_size);
+        payload_contents.filtering_id_max_bytes);
   }
 
   value.emplace("data", std::move(data));
@@ -374,15 +374,15 @@
     max_contributions_allowed = contributions.size();
   }
 
-  std::optional<size_t> filtering_id_byte_size;
-  if (proto.has_filtering_id_byte_size()) {
-    filtering_id_byte_size = proto.filtering_id_byte_size();
+  std::optional<size_t> filtering_id_max_bytes;
+  if (proto.has_filtering_id_max_bytes()) {
+    filtering_id_max_bytes = proto.filtering_id_max_bytes();
   }
 
   return AggregationServicePayloadContents(
       operation, std::move(contributions), aggregation_mode,
       std::move(aggregation_coordinator_origin), max_contributions_allowed,
-      filtering_id_byte_size);
+      filtering_id_max_bytes);
 }
 
 std::optional<AggregatableReportSharedInfo> ConvertSharedInfoFromProto(
@@ -490,9 +490,9 @@
   out->set_max_contributions_allowed(
       payload_contents.max_contributions_allowed);
 
-  if (payload_contents.filtering_id_byte_size.has_value()) {
-    out->set_filtering_id_byte_size(
-        payload_contents.filtering_id_byte_size.value());
+  if (payload_contents.filtering_id_max_bytes.has_value()) {
+    out->set_filtering_id_max_bytes(
+        payload_contents.filtering_id_max_bytes.value());
   }
 }
 
@@ -544,16 +544,16 @@
 
 void MaybeVerifyPayloadLength(size_t max_contributions_allowed,
                               size_t payload_length,
-                              std::optional<size_t> filtering_id_byte_size) {
+                              std::optional<size_t> filtering_id_max_bytes) {
   // TODO(alexmt): Replace with a more general method to ensure that the payload
   // length is deterministic.
   // Note that the 747 byte expectation derives from the following:
   // 27 (baseline size with no contributions) + 20 * 36 (size per contribution)
-  // Adding filtering IDs adds 20 * (4 + filtering_id_byte_size.value()).
+  // Adding filtering IDs adds 20 * (4 + filtering_id_max_bytes.value()).
   if (max_contributions_allowed == 20) {
     size_t expected_payload_length = 747;
-    if (filtering_id_byte_size.has_value()) {
-      expected_payload_length += 80 + 20 * filtering_id_byte_size.value();
+    if (filtering_id_max_bytes.has_value()) {
+      expected_payload_length += 80 + 20 * filtering_id_max_bytes.value();
     }
     if (payload_length != expected_payload_length) {
       base::debug::DumpWithoutCrashing();
@@ -561,13 +561,13 @@
   }
 }
 
-// Note that null filtering IDs are considered to 'fit in' to all byte sizes and
-// only null filtering IDs are considered to 'fit in' to a null byte size.
-bool FilteringIdsFitInByteSize(
+// Note that null filtering IDs are considered to 'fit in' to all max bytes and
+// only null filtering IDs are considered to 'fit in' to a null max bytes.
+bool FilteringIdsFitInMaxBytes(
     std::vector<blink::mojom::AggregatableReportHistogramContribution>
         contributions,
-    std::optional<size_t> filtering_id_byte_size) {
-  if (!filtering_id_byte_size.has_value()) {
+    std::optional<size_t> filtering_id_max_bytes) {
+  if (!filtering_id_max_bytes.has_value()) {
     return base::ranges::none_of(
         contributions,
         [&](const blink::mojom::AggregatableReportHistogramContribution&
@@ -582,7 +582,7 @@
               contribution) {
         return static_cast<size_t>(
                    std::bit_width(contribution.filtering_id.value_or(0))) >
-               kBitsPerByte * filtering_id_byte_size.value();
+               kBitsPerByte * filtering_id_max_bytes.value();
       });
 }
 
@@ -603,13 +603,13 @@
     blink::mojom::AggregationServiceMode aggregation_mode,
     std::optional<url::Origin> aggregation_coordinator_origin,
     int max_contributions_allowed,
-    std::optional<size_t> filtering_id_byte_size)
+    std::optional<size_t> filtering_id_max_bytes)
     : operation(operation),
       contributions(std::move(contributions)),
       aggregation_mode(aggregation_mode),
       aggregation_coordinator_origin(std::move(aggregation_coordinator_origin)),
       max_contributions_allowed(max_contributions_allowed),
-      filtering_id_byte_size(filtering_id_byte_size) {}
+      filtering_id_max_bytes(filtering_id_max_bytes) {}
 
 AggregationServicePayloadContents::AggregationServicePayloadContents(
     const AggregationServicePayloadContents& other) = default;
@@ -779,20 +779,20 @@
 
   if (base::FeatureList::IsEnabled(
           kPrivacySandboxAggregationServiceFilteringIds)) {
-    if (payload_contents.filtering_id_byte_size.has_value() &&
-        (*payload_contents.filtering_id_byte_size <= 0 ||
-         *payload_contents.filtering_id_byte_size >
-             AggregationServicePayloadContents::kMaximumFilteringIdByteSize)) {
+    if (payload_contents.filtering_id_max_bytes.has_value() &&
+        (*payload_contents.filtering_id_max_bytes <= 0 ||
+         *payload_contents.filtering_id_max_bytes >
+             AggregationServicePayloadContents::kMaximumFilteringIdMaxBytes)) {
       return std::nullopt;
     }
 
-    if (!FilteringIdsFitInByteSize(payload_contents.contributions,
-                                   payload_contents.filtering_id_byte_size)) {
+    if (!FilteringIdsFitInMaxBytes(payload_contents.contributions,
+                                   payload_contents.filtering_id_max_bytes)) {
       return std::nullopt;
     }
   } else {
     // Ignore any values provided if the feature is disabled.
-    payload_contents.filtering_id_byte_size.reset();
+    payload_contents.filtering_id_max_bytes.reset();
     base::ranges::for_each(
         payload_contents.contributions,
         [](blink::mojom::AggregatableReportHistogramContribution&
@@ -949,7 +949,7 @@
         MaybeVerifyPayloadLength(
             report_request.payload_contents().max_contributions_allowed,
             /*payload_length=*/unencrypted_payloads[0].size(),
-            report_request.payload_contents().filtering_id_byte_size);
+            report_request.payload_contents().filtering_id_max_bytes);
       }
       break;
     }
diff --git a/content/browser/aggregation_service/aggregatable_report.h b/content/browser/aggregation_service/aggregatable_report.h
index c558015..74a832b 100644
--- a/content/browser/aggregation_service/aggregatable_report.h
+++ b/content/browser/aggregation_service/aggregatable_report.h
@@ -38,7 +38,7 @@
     kHistogram,
   };
 
-  static constexpr size_t kMaximumFilteringIdByteSize = 8;
+  static constexpr size_t kMaximumFilteringIdMaxBytes = 8;
 
   // The default aggregation coordinator origin will be used if
   // `aggregation_coordinator_origin` is `std::nullopt`.
@@ -53,7 +53,7 @@
       blink::mojom::AggregationServiceMode aggregation_mode,
       std::optional<url::Origin> aggregation_coordinator_origin,
       int max_contributions_allowed,
-      std::optional<size_t> filtering_id_byte_size);
+      std::optional<size_t> filtering_id_max_bytes);
 
   AggregationServicePayloadContents(
       const AggregationServicePayloadContents& other);
@@ -70,7 +70,7 @@
   blink::mojom::AggregationServiceMode aggregation_mode;
   std::optional<url::Origin> aggregation_coordinator_origin;
   int max_contributions_allowed;
-  std::optional<size_t> filtering_id_byte_size;
+  std::optional<size_t> filtering_id_max_bytes;
 };
 
 // Represents the information that will be provided to both the reporting
@@ -297,10 +297,10 @@
   // `failed_send_attempts` is negative or if
   // `payload_contents.max_contributions_allowed` is less than the number of
   // contributions. Also returns `std::nullopt` if
-  // `payload_contents.filtering_id_byte_size` is non-null and either
-  // non-positive or greater than `kMaximumFilteringIdByteSize`. Also returns
+  // `payload_contents.filtering_id_max_bytes` is non-null and either
+  // non-positive or greater than `kMaximumFilteringIdMaxBytes`. Also returns
   // `std::nullopt` if any contribution's filtering ID does not fit in the given
-  // `payload_contents.filtering_id_byte_size`; if the given byte size is null,
+  // `payload_contents.filtering_id_max_bytes`; if the given max bytes is null,
   // only null filtering IDs are considered to 'fit', i.e. any non-null value
   // will mean this returns `std::nullopt`.
   // TODO(alexmt): Add validation for scheduled_report_time being non-null/inf.
diff --git a/content/browser/aggregation_service/aggregatable_report_unittest.cc b/content/browser/aggregation_service/aggregatable_report_unittest.cc
index 932788b..8cc2861 100644
--- a/content/browser/aggregation_service/aggregatable_report_unittest.cc
+++ b/content/browser/aggregation_service/aggregatable_report_unittest.cc
@@ -180,22 +180,22 @@
           ASSERT_EQ(
               CborMapContainsKeyAndType(data_map, "id",
                                         cbor::Value::Type::BYTE_STRING),
-              expected_payload_contents.filtering_id_byte_size.has_value());
-          if (expected_payload_contents.filtering_id_byte_size.has_value()) {
-            size_t filtering_id_byte_size =
-                expected_payload_contents.filtering_id_byte_size.value();
+              expected_payload_contents.filtering_id_max_bytes.has_value());
+          if (expected_payload_contents.filtering_id_max_bytes.has_value()) {
+            size_t filtering_id_max_bytes =
+                expected_payload_contents.filtering_id_max_bytes.value();
 
             const cbor::Value::BinaryValue& filtering_id_byte_string =
                 data_map.at(cbor::Value("id")).GetBytestring();
-            ASSERT_EQ(filtering_id_byte_string.size(), filtering_id_byte_size);
+            ASSERT_EQ(filtering_id_byte_string.size(), filtering_id_max_bytes);
 
             std::array<uint8_t, 8u> padded_filtering_id_bytestring;
             padded_filtering_id_bytestring.fill(0);
             base::as_writable_byte_span(padded_filtering_id_bytestring)
-                .last(filtering_id_byte_size)
+                .last(filtering_id_max_bytes)
                 .copy_from(filtering_id_byte_string);
 
-            CHECK_LE(expected_payload_contents.filtering_id_byte_size.value(),
+            CHECK_LE(expected_payload_contents.filtering_id_max_bytes.value(),
                      8u);
             uint64_t filtering_id = base::numerics::U64FromBigEndian(
                 base::make_span(padded_filtering_id_bytestring));
@@ -497,13 +497,13 @@
 };
 
 TEST_P(AggregatableReportFilteringIdTest,
-       FilteringIdByteSizeSpecified_ValidReportReturned) {
+       FilteringIdMaxBytesSpecified_ValidReportReturned) {
   AggregatableReportRequest example_request =
       aggregation_service::CreateExampleRequest();
 
   AggregationServicePayloadContents payload_contents =
       example_request.payload_contents();
-  payload_contents.filtering_id_byte_size = 1;
+  payload_contents.filtering_id_max_bytes = 1;
 
   std::optional<AggregatableReportRequest> request =
       AggregatableReportRequest::Create(payload_contents,
@@ -541,7 +541,7 @@
   payload_contents.contributions.emplace_back(
       /*bucket=*/345, /*value=*/678, /*filtering_id=*/(1ULL << (5 * 8)) - 1);
 
-  payload_contents.filtering_id_byte_size = 5;
+  payload_contents.filtering_id_max_bytes = 5;
 
   std::optional<AggregatableReportRequest> request =
       AggregatableReportRequest::Create(payload_contents,
@@ -1104,26 +1104,26 @@
   EXPECT_EQ(report_json_string, kExpectedJsonString);
 }
 
-TEST_P(AggregatableReportFilteringIdTest, FilteringIdByteSizeNullopt) {
+TEST_P(AggregatableReportFilteringIdTest, FilteringIdMaxBytesNullopt) {
   AggregatableReportRequest example_request =
       aggregation_service::CreateExampleRequest();
 
   AggregationServicePayloadContents payload_contents =
       example_request.payload_contents();
-  payload_contents.filtering_id_byte_size.reset();
+  payload_contents.filtering_id_max_bytes.reset();
 
   AggregatableReportRequest request =
       AggregatableReportRequest::Create(payload_contents,
                                         example_request.shared_info().Clone())
           .value();
 
-  // The filtering_id_byte_size is correctly serialized and deserialized
+  // The filtering_id_max_bytes is correctly serialized and deserialized
   std::vector<uint8_t> proto = request.Serialize();
   std::optional<AggregatableReportRequest> parsed_request =
       AggregatableReportRequest::Deserialize(proto);
   EXPECT_FALSE(parsed_request.value()
                    .payload_contents()
-                   .filtering_id_byte_size.has_value());
+                   .filtering_id_max_bytes.has_value());
 
   // Trying to set any explicit filtering ID will cause an error
   payload_contents.contributions[0].filtering_id = 0;
@@ -1132,14 +1132,14 @@
                    .has_value());
 }
 
-TEST_P(AggregatableReportFilteringIdTest, FilteringIdByteSizeMax) {
+TEST_P(AggregatableReportFilteringIdTest, FilteringIdMaxBytesMax) {
   AggregatableReportRequest example_request =
       aggregation_service::CreateExampleRequest();
 
   AggregationServicePayloadContents payload_contents =
       example_request.payload_contents();
-  payload_contents.filtering_id_byte_size =
-      AggregationServicePayloadContents::kMaximumFilteringIdByteSize;
+  payload_contents.filtering_id_max_bytes =
+      AggregationServicePayloadContents::kMaximumFilteringIdMaxBytes;
 
   // Trying to set any explicit filtering ID (or none) should work.
   const std::optional<uint64_t> kTestCases[] = {
@@ -1157,21 +1157,21 @@
     std::vector<uint8_t> proto = request.Serialize();
     std::optional<AggregatableReportRequest> parsed_request =
         AggregatableReportRequest::Deserialize(proto);
-    EXPECT_EQ(parsed_request.value().payload_contents().filtering_id_byte_size,
-              AggregationServicePayloadContents::kMaximumFilteringIdByteSize);
+    EXPECT_EQ(parsed_request.value().payload_contents().filtering_id_max_bytes,
+              AggregationServicePayloadContents::kMaximumFilteringIdMaxBytes);
     EXPECT_EQ(
         parsed_request.value().payload_contents().contributions[0].filtering_id,
         test_case);
   }
 }
 
-TEST_P(AggregatableReportFilteringIdTest, FilteringIdByteSizeNotMax) {
+TEST_P(AggregatableReportFilteringIdTest, FilteringIdMaxBytesNotMax) {
   AggregatableReportRequest example_request =
       aggregation_service::CreateExampleRequest();
 
   AggregationServicePayloadContents payload_contents =
       example_request.payload_contents();
-  payload_contents.filtering_id_byte_size = 1;
+  payload_contents.filtering_id_max_bytes = 1;
 
   // The filtering ID needs to fit in the specified space to be accepted.
   const struct {
@@ -1200,7 +1200,7 @@
     std::vector<uint8_t> proto = request->Serialize();
     std::optional<AggregatableReportRequest> parsed_request =
         AggregatableReportRequest::Deserialize(proto);
-    EXPECT_EQ(parsed_request.value().payload_contents().filtering_id_byte_size,
+    EXPECT_EQ(parsed_request.value().payload_contents().filtering_id_max_bytes,
               1);
     EXPECT_EQ(
         parsed_request.value().payload_contents().contributions[0].filtering_id,
@@ -1219,10 +1219,10 @@
       example_request.payload_contents();
 
   // No matter what combination is used (even if typically invalid), the
-  // filtering IDs and byte sizes should be ignored.
+  // filtering IDs and max bytes should be ignored.
   const struct {
     std::optional<uint64_t> filtering_id;
-    std::optional<int> filtering_id_byte_size;
+    std::optional<int> filtering_id_max_bytes;
   } kTestCases[] = {
       {std::nullopt, std::nullopt},
       {0, std::nullopt},
@@ -1232,48 +1232,48 @@
       {std::numeric_limits<uint64_t>::max(), 1},
       {std::nullopt, -1},
       {std::nullopt,
-       AggregationServicePayloadContents::kMaximumFilteringIdByteSize + 1}};
+       AggregationServicePayloadContents::kMaximumFilteringIdMaxBytes + 1}};
 
   for (const auto& test_case : kTestCases) {
     payload_contents.contributions[0].filtering_id = test_case.filtering_id;
-    payload_contents.filtering_id_byte_size = test_case.filtering_id_byte_size;
+    payload_contents.filtering_id_max_bytes = test_case.filtering_id_max_bytes;
 
     AggregatableReportRequest request =
         AggregatableReportRequest::Create(payload_contents,
                                           example_request.shared_info().Clone())
             .value();
 
-    EXPECT_FALSE(request.payload_contents().filtering_id_byte_size.has_value());
+    EXPECT_FALSE(request.payload_contents().filtering_id_max_bytes.has_value());
     EXPECT_FALSE(
         request.payload_contents().contributions[0].filtering_id.has_value());
   }
 }
 
-TEST_P(AggregatableReportFilteringIdTest, FilteringIdByteSizeTooSmall) {
+TEST_P(AggregatableReportFilteringIdTest, FilteringIdMaxBytesTooSmall) {
   AggregatableReportRequest example_request =
       aggregation_service::CreateExampleRequest();
 
   AggregationServicePayloadContents payload_contents =
       example_request.payload_contents();
-  payload_contents.filtering_id_byte_size = 0;
+  payload_contents.filtering_id_max_bytes = 0;
   EXPECT_FALSE(AggregatableReportRequest::Create(
                    payload_contents, example_request.shared_info().Clone())
                    .has_value());
 
-  payload_contents.filtering_id_byte_size = -1;
+  payload_contents.filtering_id_max_bytes = -1;
   EXPECT_FALSE(AggregatableReportRequest::Create(
                    payload_contents, example_request.shared_info().Clone())
                    .has_value());
 }
 
-TEST_P(AggregatableReportFilteringIdTest, FilteringIdByteSizeTooLarge) {
+TEST_P(AggregatableReportFilteringIdTest, FilteringIdMaxBytesTooLarge) {
   AggregatableReportRequest example_request =
       aggregation_service::CreateExampleRequest();
 
   AggregationServicePayloadContents payload_contents =
       example_request.payload_contents();
-  payload_contents.filtering_id_byte_size =
-      AggregationServicePayloadContents::kMaximumFilteringIdByteSize + 1;
+  payload_contents.filtering_id_max_bytes =
+      AggregationServicePayloadContents::kMaximumFilteringIdMaxBytes + 1;
   EXPECT_FALSE(AggregatableReportRequest::Create(
                    payload_contents, example_request.shared_info().Clone())
                    .has_value());
@@ -1306,7 +1306,7 @@
               blink::mojom::AggregationServiceMode::kDefault,
               /*aggregation_coordinator_origin=*/std::nullopt,
               /*max_contributions_allowed=*/1,
-              /*filtering_id_byte_size=*/std::nullopt),
+              /*filtering_id_max_bytes=*/std::nullopt),
           AggregatableReportSharedInfo(
               base::Time::FromMillisecondsSinceUnixEpoch(1652984901234),
               base::Uuid::ParseLowercase(
@@ -1353,7 +1353,7 @@
               blink::mojom::AggregationServiceMode::kDefault,
               /*aggregation_coordinator_origin=*/std::nullopt,
               /*max_contributions_allowed=*/1,
-              /*filtering_id_byte_size=*/std::nullopt),
+              /*filtering_id_max_bytes=*/std::nullopt),
           AggregatableReportSharedInfo(
               base::Time::FromMillisecondsSinceUnixEpoch(1652984901234),
               base::Uuid::ParseLowercase(
@@ -1377,7 +1377,7 @@
     NoAdditionalFieldsOrAggregationCoordinatorOriginOrFilteringId_ParsesCorrectly) {
   // An `AggregatableReport` serialized before `additional_fields`,
   // `aggregataion_coordinator_origin`, `filtering_id` and
-  // `filtering_id_byte_size` were added to the proto definition.
+  // `filtering_id_max_bytes` were added to the proto definition.
   const char kHexEncodedOldProto[] =
       "0A071205107B18C803126208D0DA8693FDBECF17122431323334353637382D393061622D"
       "346364652D386631322D3334353637383930616263641A1368747470733A2F2F6578616D"
@@ -1401,7 +1401,7 @@
               blink::mojom::AggregationServiceMode::kDefault,
               /*aggregation_coordinator_origin=*/std::nullopt,
               /*max_contributions_allowed=*/1,
-              /*filtering_id_byte_size=*/std::nullopt),
+              /*filtering_id_max_bytes=*/std::nullopt),
           AggregatableReportSharedInfo(
               base::Time::FromMillisecondsSinceUnixEpoch(1652984901234),
               base::Uuid::ParseLowercase(
@@ -1468,7 +1468,7 @@
                 blink::mojom::AggregationServiceMode::kDefault,
                 test_case.aggregation_coordinator_origin,
                 /*max_contributions_allowed=*/20,
-                /*filtering_id_byte_size=*/std::nullopt),
+                /*filtering_id_max_bytes=*/std::nullopt),
             AggregatableReportSharedInfo(
                 /*scheduled_report_time=*/base::Time::Now(),
                 /*report_id=*/
diff --git a/content/browser/aggregation_service/aggregation_service_test_utils.cc b/content/browser/aggregation_service/aggregation_service_test_utils.cc
index a8257ee..0f3ef7c 100644
--- a/content/browser/aggregation_service/aggregation_service_test_utils.cc
+++ b/content/browser/aggregation_service/aggregation_service_test_utils.cc
@@ -257,7 +257,7 @@
                      /*filtering_id=*/std::nullopt)},
                  aggregation_mode, std::move(aggregation_coordinator_origin),
                  /*max_contributions_allowed=*/20,
-                 /*filtering_id_byte_size=*/std::nullopt),
+                 /*filtering_id_max_bytes=*/std::nullopt),
              AggregatableReportSharedInfo(
                  /*scheduled_report_time=*/report_time,
                  /*report_id=*/
diff --git a/content/browser/aggregation_service/proto/aggregatable_report.proto b/content/browser/aggregation_service/proto/aggregatable_report.proto
index 34c6ea8f..718c417 100644
--- a/content/browser/aggregation_service/proto/aggregatable_report.proto
+++ b/content/browser/aggregation_service/proto/aggregatable_report.proto
@@ -35,7 +35,7 @@
   AggregationServiceMode aggregation_mode = 3;
   int32 max_contributions_allowed = 5;
   optional string aggregation_coordinator_origin = 6;
-  optional uint32 filtering_id_byte_size = 7;
+  optional uint32 filtering_id_max_bytes = 7;
 
   reserved 4;
   reserved "aggregation_coordinator";
diff --git a/content/browser/attribution_reporting/aggregatable_attribution_utils.cc b/content/browser/attribution_reporting/aggregatable_attribution_utils.cc
index 0a0c8d6..3052f01d 100644
--- a/content/browser/attribution_reporting/aggregatable_attribution_utils.cc
+++ b/content/browser/attribution_reporting/aggregatable_attribution_utils.cc
@@ -210,7 +210,7 @@
               : std::nullopt,
           /*max_contributions_allowed=*/
           attribution_reporting::kMaxAggregationKeysPerSource,
-          /*filtering_id_byte_size=*/std::nullopt),
+          /*filtering_id_max_bytes=*/std::nullopt),
       AggregatableReportSharedInfo(
           report.initial_report_time(), report.external_report_id(),
           report.GetReportingOrigin(), debug_mode, std::move(additional_fields),
diff --git a/content/browser/compute_pressure/pressure_client_impl.h b/content/browser/compute_pressure/pressure_client_impl.h
index ff65a4c..a3e121d 100644
--- a/content/browser/compute_pressure/pressure_client_impl.h
+++ b/content/browser/compute_pressure/pressure_client_impl.h
@@ -17,7 +17,7 @@
 
 class PressureServiceBase;
 
-// PressureServiceImpl owns instances of this class for different
+// PressureServiceBase owns instances of this class for different
 // PressureSources.
 //
 // This class implements the "device::mojom::PressureClient" interface to
diff --git a/content/browser/compute_pressure/pressure_service_for_frame_unittest.cc b/content/browser/compute_pressure/pressure_service_for_frame_unittest.cc
index 7242d23..e375507a 100644
--- a/content/browser/compute_pressure/pressure_service_for_frame_unittest.cc
+++ b/content/browser/compute_pressure/pressure_service_for_frame_unittest.cc
@@ -204,7 +204,7 @@
             PressureStatus::kOk);
 
   // Simulate the renderer calling AddClient twice for the same PressureSource
-  // and wait for the PressureServiceImpl to finish the call.
+  // and wait for the PressureServiceBase to finish the call.
   FakePressureClient client2;
   mojo::test::BadMessageObserver bad_message_observer;
   pressure_manager_->AddClient(client2.BindNewPipeAndPassRemote(),
@@ -224,7 +224,7 @@
                               PressureSource::kCpu),
             PressureStatus::kOk);
 
-  // Simulate the renderer disconnecting and wait for the PressureServiceImpl
+  // Simulate the renderer disconnecting and wait for the PressureServiceBase
   // to observe the pipe close.
   pressure_manager_.reset();
   task_environment()->RunUntilIdle();
diff --git a/content/browser/private_aggregation/private_aggregation_host.cc b/content/browser/private_aggregation/private_aggregation_host.cc
index 59f1ee50..18c14e8 100644
--- a/content/browser/private_aggregation/private_aggregation_host.cc
+++ b/content/browser/private_aggregation/private_aggregation_host.cc
@@ -308,7 +308,7 @@
       blink::mojom::AggregationServiceMode::kDefault,
       std::move(aggregation_coordinator_origin), kMaxNumberOfContributions,
       // TODO(crbug.com/330744610): Allow this to be set.
-      /*filtering_id_byte_size=*/std::nullopt);
+      /*filtering_id_max_bytes=*/std::nullopt);
 
   CHECK(debug_mode_details);
   AggregatableReportSharedInfo shared_info(
diff --git a/content/browser/private_aggregation/private_aggregation_host_unittest.cc b/content/browser/private_aggregation/private_aggregation_host_unittest.cc
index 749d83a3..135e8ec4 100644
--- a/content/browser/private_aggregation/private_aggregation_host_unittest.cc
+++ b/content/browser/private_aggregation/private_aggregation_host_unittest.cc
@@ -167,7 +167,7 @@
               blink::mojom::AggregationServiceMode::kDefault,
               /*aggregation_coordinator_origin=*/std::nullopt,
               PrivateAggregationHost::kMaxNumberOfContributions,
-              /*filtering_id_byte_size=*/std::nullopt),
+              /*filtering_id_max_bytes=*/std::nullopt),
           AggregatableReportSharedInfo(
               validated_request->shared_info().scheduled_report_time,
               validated_request->shared_info().report_id,
diff --git a/content/browser/webid/federated_auth_request_impl.cc b/content/browser/webid/federated_auth_request_impl.cc
index d1075ac..f8c7634 100644
--- a/content/browser/webid/federated_auth_request_impl.cc
+++ b/content/browser/webid/federated_auth_request_impl.cc
@@ -98,7 +98,6 @@
     bool is_auto_reauthn,
     const RpMode& rp_mode,
     const std::vector<std::string>& scope,
-    const std::vector<std::string>& responseType,
     const base::flat_map<std::string, std::string>& params) {
   std::string query;
   if (!client_id.empty()) {
@@ -169,11 +168,6 @@
       query += "&scope=" + base::EscapeUrlEncodedData(
                                base::JoinString(scope, " "), /*use_plus=*/true);
     }
-    if (!responseType.empty()) {
-      query += "&response_type=" +
-               base::EscapeUrlEncodedData(base::JoinString(responseType, " "),
-                                          /*use_plus=*/true);
-    }
     for (const auto& pair : params) {
       // TODO(crbug.com/40262526): Should we use a prefix with these custom
       // parameters so that they don't collide with the standard ones?
@@ -2177,8 +2171,7 @@
           render_frame_host(), idp_origin, idp_info.provider->config->client_id,
           idp_info.provider->nonce, account_id, is_sign_in,
           identity_selection_type_ != kExplicit, rp_mode_,
-          idp_info.provider->scope, idp_info.provider->responseType,
-          idp_info.provider->params),
+          idp_info.provider->scope, idp_info.provider->params),
       base::BindOnce(&FederatedAuthRequestImpl::OnTokenResponseReceived,
                      weak_ptr_factory_.GetWeakPtr(),
                      idp_info.provider->Clone()),
diff --git a/content/browser/webid/webid_browsertest.cc b/content/browser/webid/webid_browsertest.cc
index 2339556..67b1ec7 100644
--- a/content/browser/webid/webid_browsertest.cc
+++ b/content/browser/webid/webid_browsertest.cc
@@ -1150,10 +1150,9 @@
             content += "account_id=not_real_account&";
             content += "disclosure_text_shown=false&";
             content += "is_auto_selected=false&";
-            // Asserts that the scope, response_type and params parameters
+            // Asserts that the scope and params parameters
             // were passed correctly to the id assertion endpoint.
             content += "scope=name+email+picture&";
-            content += "response_type=id_token+code&";
             content += "%3F+gets+://=%26+escaped+!&";
             content += "foo=bar&";
             content += "hello=world";
@@ -1192,10 +1191,6 @@
                   'email',
                   'picture',
                 ],
-                responseType: [
-                  'id_token',
-                  'code'
-                ],
                 params: {
                   'foo': 'bar',
                   'hello': 'world',
diff --git a/content/common/gpu_pre_sandbox_hook_linux.cc b/content/common/gpu_pre_sandbox_hook_linux.cc
index 2f6be946..f5df3c66 100644
--- a/content/common/gpu_pre_sandbox_hook_linux.cc
+++ b/content/common/gpu_pre_sandbox_hook_linux.cc
@@ -6,6 +6,7 @@
 
 #include <dlfcn.h>
 #include <errno.h>
+#include <stdlib.h>
 #include <sys/stat.h>
 
 #include <memory>
@@ -84,6 +85,10 @@
 #endif
 }
 
+#if BUILDFLAG(IS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
+static const char kMaliConfPath[] = "/etc/mali_platform.conf";
+#endif
+
 #if BUILDFLAG(IS_CHROMEOS) && defined(__aarch64__)
 static const char kLibGlesPath[] = "/usr/lib64/libGLESv2.so.2";
 static const char kLibEglPath[] = "/usr/lib64/libEGL.so.1";
@@ -195,6 +200,13 @@
 
   permissions->push_back(BrokerFilePermission::ReadWrite(kMali0Path));
 
+#if BUILDFLAG(IS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
+  // Files needed for protected DMA allocations.
+  static const char kDmaHeapPath[] = "/dev/dma_heap/restricted_mtk_cma";
+  permissions->push_back(BrokerFilePermission::ReadWrite(kDmaHeapPath));
+  permissions->push_back(BrokerFilePermission::ReadOnly(kMaliConfPath));
+#endif
+
   // Non-privileged render nodes for format enumeration.
   // https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#render-nodes
   base::FileEnumerator enumerator(
@@ -526,6 +538,16 @@
 }
 
 void LoadArmGpuLibraries() {
+#if BUILDFLAG(IS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
+  // This environmental variable needs to be set before we load libMali if we
+  // want to instantiate protected Vulkan device queues.
+  static const char kMaliConfVar[] = "MALI_PLATFORM_CONFIG";
+  // Note this function will only fail if we run out of memory entirely, in
+  // which case we would have much bigger problems, so we don't bother to check
+  // the return value.
+  setenv(kMaliConfVar, kMaliConfPath, 1);
+#endif
+
   // Preload the Mali library.
   if (UseChromecastSandboxAllowlist()) {
     for (const char* path : kAllowedChromecastPaths) {
diff --git a/content/public/test/browser_test_base.cc b/content/public/test/browser_test_base.cc
index 316dd70d..c7df8ff 100644
--- a/content/public/test/browser_test_base.cc
+++ b/content/public/test/browser_test_base.cc
@@ -431,6 +431,11 @@
 #if BUILDFLAG(IS_ANDROID)
   // On Android we always use hardware GL.
   use_software_gl = false;
+
+  if (disable_android_native_fence_sync_) {
+    command_line->AppendSwitch(
+        switches::kDisableAndroidNativeFenceSyncForTesting);
+  }
 #endif
 
 #if BUILDFLAG(IS_FUCHSIA)
@@ -1032,6 +1037,12 @@
 void BrowserTestBase::EnablePixelOutput(float force_device_scale_factor) {
   enable_pixel_output_ = true;
   force_device_scale_factor_ = force_device_scale_factor;
+
+#if BUILDFLAG(IS_ANDROID)
+  if (base::SysInfo::GetAndroidHardwareEGL() == "emulation") {
+    disable_android_native_fence_sync_ = true;
+  }
+#endif
 }
 
 void BrowserTestBase::UseSoftwareCompositing() {
diff --git a/content/public/test/browser_test_base.h b/content/public/test/browser_test_base.h
index f55f589..dbd626e 100644
--- a/content/public/test/browser_test_base.h
+++ b/content/public/test/browser_test_base.h
@@ -300,6 +300,11 @@
 
   bool allow_network_access_to_host_resolutions_ = false;
 
+#if BUILDFLAG(IS_ANDROID)
+  // See GL switch `switches::kDisableAndroidNativeFenceSyncForTesting`.
+  bool disable_android_native_fence_sync_ = false;
+#endif
+
   raw_ptr<BrowserMainParts, AcrossTasksDanglingUntriaged> browser_main_parts_ =
       nullptr;
 
diff --git a/content/test/test_aggregation_service_impl.cc b/content/test/test_aggregation_service_impl.cc
index 49733d1..7b54e65 100644
--- a/content/test/test_aggregation_service_impl.cc
+++ b/content/test/test_aggregation_service_impl.cc
@@ -132,7 +132,7 @@
       /*aggregation_coordinator_origin=*/std::nullopt,
       /*max_contributions_allowed=*/20,
       // TODO(crbug.com/330744610): Allow setting.
-      /*filtering_id_byte_size=*/std::nullopt);
+      /*filtering_id_max_bytes=*/std::nullopt);
 
   AggregatableReportSharedInfo shared_info(
       /*scheduled_report_time=*/base::Time::Now() + base::Seconds(30),
diff --git a/gpu/ipc/common/dxgi_helpers.cc b/gpu/ipc/common/dxgi_helpers.cc
index c361fa4..64ecc3f 100644
--- a/gpu/ipc/common/dxgi_helpers.cc
+++ b/gpu/ipc/common/dxgi_helpers.cc
@@ -157,23 +157,13 @@
 
     // Key equal to 0 is also used by the producer. Therefore, this keyed
     // mutex acts purely as a regular mutex.
-    //
-    // TODO(crbug.com/323751343): 5000ms is a temporary workaround to
-    // detect hangs. It should be `INFINITE` after the hang rootcause is
-    // fixed. Wait duration calculation and histogram reporting is also
-    // temporary.
-    base::Time before = base::Time::Now();
-    hr = keyed_mutex->AcquireSync(0, 5000);
-    int wait_duration_ms = (base::Time::Now() - before).InMilliseconds();
-    base::UmaHistogramCounts10000(
-        "Media.VideoCapture.Win.MappingAcquireMutexDelayMs", wait_duration_ms);
-    if (hr == WAIT_TIMEOUT) {
-      // Waited too long, likely a deadlock has happened. Crash report will
-      // have all the threads.
-      SCOPED_CRASH_KEY_NUMBER("KeyedMutexHangDebugging", "wait duration",
-                              wait_duration_ms);
-      base::debug::DumpWithoutCrashing();
-    }
+    // 300ms is long enough to get the mutex in 99.999% of cases. Yet we
+    // don't want to stall the callee indefinitely if the mutex is held by
+    // e.g. GpuMain thread while it's blocked on driver waiting for shader
+    // compilation.
+    // It's better to drop a frame in this case.
+    hr = keyed_mutex->AcquireSync(0, 300);
+
     // Can't check FAILED(hr), because AcquireSync may return e.g. WAIT_TIMEOUT
     // value.
     if (hr != S_OK) {
diff --git a/internal b/internal
index 90370b8..a4ccbea 160000
--- a/internal
+++ b/internal
@@ -1 +1 @@
-Subproject commit 90370b8a42e7db38af7306d1d21af53b2e28041a
+Subproject commit a4ccbeaa41c7afd89c02c70fddd5dabaed66e29c
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm
index b1adcbf..3dcb190 100644
--- a/ios/chrome/browser/flags/about_flags.mm
+++ b/ios/chrome/browser/flags/about_flags.mm
@@ -604,16 +604,6 @@
      std::size(kOneTapForMapsConsentModeDisabled), nullptr},
 };
 
-const FeatureEntry::Choice kEnablePasswordSharingChoices[] = {
-    {"Default", "", ""},
-    {"Bootstraping Only", switches::kEnableFeatures,
-     "SharingOfferKeyPairBootstrap"},
-    {"Enabled", switches::kEnableFeatures,
-     "SharingOfferKeyPairBootstrap,SendPasswords,"
-     "PasswordManagerEnableSenderService,"
-     "PasswordManagerEnableReceiverService,SharedPasswordNotificationUI"},
-};
-
 const flags_ui::FeatureEntry::FeatureParam kParcelTrackingTestDataDelivered[] =
     {{commerce::kParcelTrackingTestDataParam,
       commerce::kParcelTrackingTestDataParamDelivered}};
@@ -1327,7 +1317,7 @@
      FEATURE_VALUE_TYPE(kIOSSaveToDrive)},
     {"password-sharing", flag_descriptions::kPasswordSharingName,
      flag_descriptions::kPasswordSharingDescription, flags_ui::kOsIos,
-     MULTI_VALUE_TYPE(kEnablePasswordSharingChoices)},
+     FEATURE_VALUE_TYPE(password_manager::features::kSendPasswords)},
     {"omnibox-company-entity-icon-adjustment",
      flag_descriptions::kOmniboxCompanyEntityIconAdjustmentName,
      flag_descriptions::kOmniboxCompanyEntityIconAdjustmentDescription,
diff --git a/ios/chrome/browser/sync/model/ios_chrome_sync_client.h b/ios/chrome/browser/sync/model/ios_chrome_sync_client.h
index adc3610..f6bedad 100644
--- a/ios/chrome/browser/sync/model/ios_chrome_sync_client.h
+++ b/ios/chrome/browser/sync/model/ios_chrome_sync_client.h
@@ -74,6 +74,9 @@
           std::map<syncer::ModelType, syncer::LocalDataDescription>)> callback)
       override;
   void TriggerLocalDataMigration(syncer::ModelTypeSet types) override;
+  void RegisterTrustedVaultAutoUpgradeSyntheticFieldTrial(
+      const syncer::TrustedVaultAutoUpgradeSyntheticFieldTrialGroup& group)
+      override;
 
  private:
   const raw_ptr<ChromeBrowserState> browser_state_;
diff --git a/ios/chrome/browser/sync/model/ios_chrome_sync_client.mm b/ios/chrome/browser/sync/model/ios_chrome_sync_client.mm
index 5bfd5ec..72035198 100644
--- a/ios/chrome/browser/sync/model/ios_chrome_sync_client.mm
+++ b/ios/chrome/browser/sync/model/ios_chrome_sync_client.mm
@@ -33,6 +33,7 @@
 #import "components/sync/base/sync_util.h"
 #import "components/sync/service/sync_api_component_factory.h"
 #import "components/sync/service/sync_service.h"
+#import "components/sync/service/trusted_vault_synthetic_field_trial.h"
 #import "components/sync_sessions/session_sync_service.h"
 #import "components/sync_user_events/user_event_service.h"
 #import "components/trusted_vault/trusted_vault_service.h"
@@ -313,3 +314,11 @@
     syncer::ModelTypeSet types) {
   local_data_migration_helper_->Run(types);
 }
+
+void IOSChromeSyncClient::RegisterTrustedVaultAutoUpgradeSyntheticFieldTrial(
+    const syncer::TrustedVaultAutoUpgradeSyntheticFieldTrialGroup& group) {
+  CHECK(group.is_valid());
+
+  // TODO(crbug.com/338544832): Implement plumbing.
+  NOTIMPLEMENTED();
+}
diff --git a/ios/chrome/browser/ui/autofill/autofill_profile_edit_table_view_controller.mm b/ios/chrome/browser/ui/autofill/autofill_profile_edit_table_view_controller.mm
index 2d8fd3a..e7c63125 100644
--- a/ios/chrome/browser/ui/autofill/autofill_profile_edit_table_view_controller.mm
+++ b/ios/chrome/browser/ui/autofill/autofill_profile_edit_table_view_controller.mm
@@ -282,12 +282,7 @@
   NSInteger sectionIdentifier =
       [_controller.tableViewModel sectionIdentifierForSectionIndex:section];
 
-  AutofillProfileDetailsSectionIdentifier firstFieldSection =
-      _dynamicallyLoadInputFieldsEnabled
-          ? AutofillProfileDetailsSectionIdentifierName
-          : AutofillProfileDetailsSectionIdentifierFields;
-
-  return sectionIdentifier == firstFieldSection ||
+  return sectionIdentifier == AutofillProfileDetailsSectionIdentifierFooter ||
          sectionIdentifier ==
              AutofillProfileDetailsSectionIdentifierErrorFooter;
 }
@@ -296,12 +291,12 @@
   NSInteger sectionIdentifier =
       [_controller.tableViewModel sectionIdentifierForSectionIndex:section];
 
-  AutofillProfileDetailsSectionIdentifier lastFieldSection =
-      _dynamicallyLoadInputFieldsEnabled
-          ? AutofillProfileDetailsSectionIdentifierPhoneEmail
-          : AutofillProfileDetailsSectionIdentifierFields;
+  if (_dynamicallyLoadInputFieldsEnabled) {
+    return sectionIdentifier ==
+           AutofillProfileDetailsSectionIdentifierPhoneEmail;
+  }
 
-  return (sectionIdentifier == lastFieldSection) ||
+  return (sectionIdentifier == AutofillProfileDetailsSectionIdentifierFields) ||
          (!_settingsView &&
           sectionIdentifier == AutofillProfileDetailsSectionIdentifierFooter);
 }
@@ -321,6 +316,22 @@
 - (void)loadMessageAndButtonForModalIfSaveOrUpdate:(BOOL)update {
   CHECK(!_settingsView);
   TableViewModel* model = _controller.tableViewModel;
+
+  if (self.accountProfile || self.migrationPrompt) {
+    CHECK([_userEmail length] > 0);
+    if (_dynamicallyLoadInputFieldsEnabled) {
+      [model addSectionWithIdentifier:
+                 AutofillProfileDetailsSectionIdentifierFooter];
+      [model setFooter:[self footerItem]
+          forSectionWithIdentifier:
+              AutofillProfileDetailsSectionIdentifierFooter];
+    } else {
+      [model addItem:[self footerItemForModalViewIfSaveOrUpdate:update]
+          toSectionWithIdentifier:
+              AutofillProfileDetailsSectionIdentifierFields];
+    }
+  }
+
   AutofillProfileDetailsSectionIdentifier sectionIdentifier =
       AutofillProfileDetailsSectionIdentifierFields;
   if (_dynamicallyLoadInputFieldsEnabled) {
@@ -328,12 +339,6 @@
     [model addSectionWithIdentifier:sectionIdentifier];
   }
 
-  if (self.accountProfile || self.migrationPrompt) {
-    DCHECK([_userEmail length] > 0);
-    [model addItem:[self footerItemForModalViewIfSaveOrUpdate:update]
-        toSectionWithIdentifier:sectionIdentifier];
-  }
-
   [model addItem:[self saveButtonIfSaveOrUpdate:update]
       toSectionWithIdentifier:sectionIdentifier];
   _hasSaveButton = !update;
@@ -426,7 +431,6 @@
 
 // Creates and returns the `TableViewLinkHeaderFooterItem` footer item.
 - (TableViewLinkHeaderFooterItem*)footerItem {
-  CHECK(_settingsView);
   TableViewLinkHeaderFooterItem* item = [[TableViewLinkHeaderFooterItem alloc]
       initWithType:AutofillProfileDetailsItemTypeFooter];
   item.text = [self footerMessage];
diff --git a/ios/chrome/browser/ui/autofill/autofill_profile_edit_table_view_controller_unittest.mm b/ios/chrome/browser/ui/autofill/autofill_profile_edit_table_view_controller_unittest.mm
index 3f16ea1..909888e 100644
--- a/ios/chrome/browser/ui/autofill/autofill_profile_edit_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/autofill/autofill_profile_edit_table_view_controller_unittest.mm
@@ -459,26 +459,33 @@
 TEST_P(AutofillProfileEditTableViewControllerTestWithDynamicFieldsEnabled,
        SectionsAndItems) {
   auto test_case = GetParam();
-  EXPECT_EQ(NumberOfSections(),
-            (test_case.is_settings && !test_case.account_profile) ? 3 : 4);
+  if (test_case.is_settings) {
+    EXPECT_EQ(NumberOfSections(), test_case.account_profile ? 4 : 3);
+  } else {
+    EXPECT_EQ(NumberOfSections(),
+              (test_case.account_profile ||
+               test_case.prompt_mode ==
+                   AutofillSaveProfilePromptMode::kMigrateProfile)
+                  ? 5
+                  : 4);
+  }
+
   EXPECT_EQ(NumberOfItemsInSection(0), 2);
   EXPECT_EQ(NumberOfItemsInSection(1), 5);
   EXPECT_EQ(NumberOfItemsInSection(2), 2);
 
-  if (test_case.account_profile) {
-    EXPECT_EQ(NumberOfItemsInSection(3), test_case.is_settings ? 0 : 2);
-    if (test_case.is_settings) {
-      NSString* expected_footer_text = l10n_util::GetNSStringF(
-          IDS_IOS_SETTINGS_AUTOFILL_ACCOUNT_ADDRESS_FOOTER_TEXT,
-          kTestSyncingEmail);
-      CheckSectionFooter(expected_footer_text, 3);
+  if ((test_case.account_profile ||
+       test_case.prompt_mode ==
+           AutofillSaveProfilePromptMode::kMigrateProfile)) {
+    EXPECT_EQ(NumberOfItemsInSection(3), 0);
+    NSString* expected_footer_text = l10n_util::GetNSStringF(
+        IDS_IOS_SETTINGS_AUTOFILL_ACCOUNT_ADDRESS_FOOTER_TEXT,
+        kTestSyncingEmail);
+    CheckSectionFooter(expected_footer_text, 3);
+
+    if (!test_case.is_settings) {
+      EXPECT_EQ(NumberOfItemsInSection(4), 1);
     }
-  } else if (!test_case.is_settings) {
-    EXPECT_EQ(
-        NumberOfItemsInSection(3),
-        test_case.prompt_mode == AutofillSaveProfilePromptMode::kMigrateProfile
-            ? 2
-            : 1);
   }
 
   CountryItem* countryItem =
diff --git a/ios/chrome/browser/ui/autofill/bottom_sheet/autofill_edit_profile_bottom_sheet_table_view_controller.mm b/ios/chrome/browser/ui/autofill/bottom_sheet/autofill_edit_profile_bottom_sheet_table_view_controller.mm
index d4085a1..87c6bd8 100644
--- a/ios/chrome/browser/ui/autofill/bottom_sheet/autofill_edit_profile_bottom_sheet_table_view_controller.mm
+++ b/ios/chrome/browser/ui/autofill/bottom_sheet/autofill_edit_profile_bottom_sheet_table_view_controller.mm
@@ -25,9 +25,8 @@
 // Custom detent identifier for when the bottom sheet is expanded.
 NSString* const kCustomExpandedDetentIdentifier = @"customExpandedDetent";
 
-// Estimated height of the header/footer, used to speed the constraints.
-const CGFloat kEstimatedHeaderFooterHeight = 10;
-
+// Deafult height of the footer, used to speed the constraints.
+const CGFloat kDefaultFooterHeight = 20;
 }  // namespace
 
 @interface AutofillEditProfileBottomSheetTableViewController () <
@@ -64,9 +63,6 @@
   [self setUpBottomSheetPresentationController];
   [self setUpBottomSheetDetents];
 
-  self.tableView.sectionHeaderHeight = kEstimatedHeaderFooterHeight;
-  self.tableView.sectionFooterHeight = kEstimatedHeaderFooterHeight;
-  self.tableView.estimatedRowHeight = 56;
   [self.tableView
       setSeparatorInset:UIEdgeInsetsMake(0, kTableViewHorizontalSpacing, 0, 0)];
 
@@ -158,19 +154,16 @@
 }
 
 - (CGFloat)tableView:(UITableView*)tableView
-    heightForHeaderInSection:(NSInteger)section {
-  if ([self.handler heightForHeaderShouldBeZeroInSection:section]) {
-    return 0;
-  }
-  return [super tableView:tableView heightForHeaderInSection:section];
-}
-
-- (CGFloat)tableView:(UITableView*)tableView
     heightForFooterInSection:(NSInteger)section {
   if ([self.handler heightForFooterShouldBeZeroInSection:section]) {
     return 0;
   }
-  return [super tableView:tableView heightForFooterInSection:section];
+
+  if ([self.tableViewModel footerForSectionIndex:section]) {
+    return UITableViewAutomaticDimension;
+  }
+
+  return kDefaultFooterHeight;
 }
 
 #pragma mark - Actions
diff --git a/ios/chrome/browser/ui/tabs/tab_strip_controller.mm b/ios/chrome/browser/ui/tabs/tab_strip_controller.mm
index 9468add..96fdcf8 100644
--- a/ios/chrome/browser/ui/tabs/tab_strip_controller.mm
+++ b/ios/chrome/browser/ui/tabs/tab_strip_controller.mm
@@ -10,6 +10,7 @@
 
 #import "base/apple/bundle_locations.h"
 #import "base/apple/foundation_util.h"
+#import "base/debug/dump_without_crashing.h"
 #import "base/i18n/rtl.h"
 #import "base/ios/ios_util.h"
 #import "base/memory/raw_ptr.h"
@@ -1258,16 +1259,12 @@
       break;
     }
     case WebStateListChange::Type::kGroupCreate:
-      NOTREACHED() << "Old Tab Strip doesn't support Tab Groups.";
-      break;
     case WebStateListChange::Type::kGroupVisualDataUpdate:
-      NOTREACHED() << "Old Tab Strip doesn't support Tab Groups.";
-      break;
     case WebStateListChange::Type::kGroupMove:
-      NOTREACHED() << "Old Tab Strip doesn't support Tab Groups.";
-      break;
     case WebStateListChange::Type::kGroupDelete:
-      NOTREACHED() << "Old Tab Strip doesn't support Tab Groups.";
+      // This can happen on iPad if tab-groups-in-grid and tab-groups-on-ipad
+      // are enabled, but not modern-tab-strip.
+      base::debug::DumpWithoutCrashing();
       break;
   }
 
diff --git a/ios/web_view/internal/sync/web_view_sync_client.h b/ios/web_view/internal/sync/web_view_sync_client.h
index 159b07b..f7eb2d5 100644
--- a/ios/web_view/internal/sync/web_view_sync_client.h
+++ b/ios/web_view/internal/sync/web_view_sync_client.h
@@ -67,6 +67,9 @@
   bool IsPasswordSyncAllowed() override;
   void SetPasswordSyncAllowedChangeCb(
       const base::RepeatingClosure& cb) override;
+  void RegisterTrustedVaultAutoUpgradeSyntheticFieldTrial(
+      const syncer::TrustedVaultAutoUpgradeSyntheticFieldTrialGroup& group)
+      override;
 
  private:
   autofill::AutofillWebDataService* profile_web_data_service_;
diff --git a/ios/web_view/internal/sync/web_view_sync_client.mm b/ios/web_view/internal/sync/web_view_sync_client.mm
index 1990dd6..297d0044 100644
--- a/ios/web_view/internal/sync/web_view_sync_client.mm
+++ b/ios/web_view/internal/sync/web_view_sync_client.mm
@@ -221,4 +221,9 @@
   // IsPasswordSyncAllowed() doesn't change on //ios/web_view/.
 }
 
+void WebViewSyncClient::RegisterTrustedVaultAutoUpgradeSyntheticFieldTrial(
+    const syncer::TrustedVaultAutoUpgradeSyntheticFieldTrialGroup& group) {
+  // This code might be reached but synthetic field trials are not supported on
+  // iOS webview.
+}
 }  // namespace ios_web_view
diff --git a/ios_internal b/ios_internal
index 488e0f6..0753463 160000
--- a/ios_internal
+++ b/ios_internal
@@ -1 +1 @@
-Subproject commit 488e0f6f77db504dcf37d1b56bfecdcf69ca61f2
+Subproject commit 07534635e3525a099c739887f43df47df6464f17
diff --git a/net/cookies/cookie_partition_key_collection_unittest.cc b/net/cookies/cookie_partition_key_collection_unittest.cc
index e7fba4f..bb0d118 100644
--- a/net/cookies/cookie_partition_key_collection_unittest.cc
+++ b/net/cookies/cookie_partition_key_collection_unittest.cc
@@ -3,9 +3,12 @@
 // found in the LICENSE file.
 
 #include "net/cookies/cookie_partition_key_collection.h"
+
 #include "base/run_loop.h"
 #include "base/test/bind.h"
+#include "base/test/scoped_feature_list.h"
 #include "base/test/task_environment.h"
+#include "net/base/features.h"
 #include "net/cookies/test_cookie_access_delegate.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -129,4 +132,56 @@
   EXPECT_NE(all, foo);
 }
 
+class AncestorChainBitCookiePartitionKeyCollectionTest
+    : public testing::TestWithParam<bool> {
+ protected:
+  // testing::Test
+  void SetUp() override {
+    scoped_feature_list_.InitWithFeatureState(
+        features::kAncestorChainBitEnabledInPartitionedCookies,
+        AncestorChainBitEnabled());
+  }
+
+  bool AncestorChainBitEnabled() { return GetParam(); }
+
+ private:
+  base::test::ScopedFeatureList scoped_feature_list_;
+};
+
+INSTANTIATE_TEST_SUITE_P(/* no label */,
+                         AncestorChainBitCookiePartitionKeyCollectionTest,
+                         ::testing::Bool());
+
+TEST_P(AncestorChainBitCookiePartitionKeyCollectionTest,
+       ConsidersAncestorChainBit) {
+  CookiePartitionKey cross_site_key = CookiePartitionKey::FromURLForTesting(
+      GURL("https://foo.test"),
+      CookiePartitionKey::AncestorChainBit::kCrossSite);
+
+  CookiePartitionKey same_site_key = CookiePartitionKey::FromURLForTesting(
+      GURL("https://foo.test"),
+      CookiePartitionKey::AncestorChainBit::kSameSite);
+
+  CookiePartitionKeyCollection cross_site_collection(cross_site_key);
+  CookiePartitionKeyCollection same_site_collection(same_site_key);
+  CookiePartitionKeyCollection all =
+      CookiePartitionKeyCollection::ContainsAll();
+
+  // Confirm that CookiePartitionKeyCollection::ContainsAll() is not impacted by
+  // the value of the AncestorChainBit.
+  EXPECT_TRUE(all.Contains(cross_site_key));
+  EXPECT_TRUE(all.Contains(same_site_key));
+
+  // Confirm that the results of equivalency and Contains() are
+  // dependent on if the ancestor chain bit is enabled.
+  if (AncestorChainBitEnabled()) {
+    EXPECT_NE(cross_site_collection, same_site_collection);
+    EXPECT_FALSE(cross_site_collection.Contains(same_site_key));
+    EXPECT_FALSE(same_site_collection.Contains(cross_site_key));
+  } else {
+    EXPECT_EQ(cross_site_collection, same_site_collection);
+    EXPECT_TRUE(cross_site_collection.Contains(same_site_key));
+    EXPECT_TRUE(same_site_collection.Contains(cross_site_key));
+  }
+}
 }  // namespace net
diff --git a/net/quic/quic_session_pool_test.cc b/net/quic/quic_session_pool_test.cc
index fd4ef85..b4b7c67 100644
--- a/net/quic/quic_session_pool_test.cc
+++ b/net/quic/quic_session_pool_test.cc
@@ -319,6 +319,20 @@
       std::vector<HostResolverEndpointResult> endpoints,
       bool expect_success);
 
+  // Creates a callback that filters for control-stream frames.
+  base::RepeatingCallback<bool(const quic::QuicFrame&)>
+  FilterControlStreamOnly() {
+    quic::QuicStreamId control_stream_id =
+        quic::QuicUtils::GetFirstUnidirectionalStreamId(
+            version_.transport_version, quic::Perspective::IS_CLIENT);
+    return base::BindRepeating(
+        [](quic::QuicStreamId control_stream_id, const quic::QuicFrame& frame) {
+          return frame.type == quic::STREAM_FRAME &&
+                 frame.stream_frame.stream_id == control_stream_id;
+        },
+        control_stream_id);
+  }
+
   scoped_refptr<TestTaskRunner> runner_;
 
  private:
@@ -7969,12 +7983,17 @@
   ConstructGetRequestPacket(packet_number++,
                             GetNthClientInitiatedBidirectionalStreamId(0),
                             /*fin=*/true);
+  quic::QuicStreamId stream_1 = GetNthClientInitiatedBidirectionalStreamId(1);
   socket_data1.AddWrite(
-      SYNCHRONOUS, client_maker_.MakeRetransmissionRstAndDataPacket(
-                       /*original_packet_numbers=*/{1, 2}, packet_number++,
-                       GetNthClientInitiatedBidirectionalStreamId(1),
-                       quic::QUIC_STREAM_CANCELLED, GetQpackDecoderStreamId(),
-                       StreamCancellationQpackDecoderInstruction(1)));
+      SYNCHRONOUS,
+      client_maker_.Packet(packet_number++)
+          .AddPacketRetransmission(1)
+          .AddPacketRetransmission(2)
+          .AddStopSendingFrame(stream_1, quic::QUIC_STREAM_CANCELLED)
+          .AddRstStreamFrame(stream_1, quic::QUIC_STREAM_CANCELLED)
+          .AddStreamFrame(GetQpackDecoderStreamId(), /*fin=*/false,
+                          StreamCancellationQpackDecoderInstruction(1))
+          .Build());
   socket_data1.AddWrite(SYNCHRONOUS,
                         client_maker_.MakePingPacket(packet_number++));
   socket_data1.AddWrite(SYNCHRONOUS, client_maker_.MakeRetireConnectionIdPacket(
@@ -8012,7 +8031,8 @@
   EXPECT_EQ(OK, stream1->InitializeStream(true, DEFAULT_PRIORITY, net_log_,
                                           CompletionOnceCallback()));
 
-  // Second request returns synchronously because it pools to existing session.
+  // Second request returns synchronously because it pools to existing
+  // session.
   TestCompletionCallback callback2;
   RequestBuilder builder2(this);
   builder2.callback = callback2.callback();
@@ -8113,16 +8133,20 @@
   ConstructGetRequestPacket(packet_number++,
                             GetNthClientInitiatedBidirectionalStreamId(1),
                             /*fin=*/true);
-  std::vector<uint64_t> original_packet_numbers = {1};
-  uint64_t retransmit_frame_count = 2;
-  original_packet_numbers.push_back(2);
+
+  base::RepeatingCallback<bool(const quic::QuicFrame&)> control_stream_only =
+      FilterControlStreamOnly();
+  quic::QuicStreamId stream_1 = GetNthClientInitiatedBidirectionalStreamId(1);
   socket_data1.AddWrite(
-      SYNCHRONOUS, client_maker_.MakeRetransmissionRstAndDataPacket(
-                       original_packet_numbers, packet_number++,
-                       GetNthClientInitiatedBidirectionalStreamId(1),
-                       quic::QUIC_STREAM_CANCELLED, GetQpackDecoderStreamId(),
-                       StreamCancellationQpackDecoderInstruction(1),
-                       retransmit_frame_count));
+      SYNCHRONOUS,
+      client_maker_.Packet(packet_number++)
+          .AddPacketRetransmission(1, control_stream_only)
+          .AddPacketRetransmission(2, control_stream_only)
+          .AddStopSendingFrame(stream_1, quic::QUIC_STREAM_CANCELLED)
+          .AddRstStreamFrame(stream_1, quic::QUIC_STREAM_CANCELLED)
+          .AddStreamFrame(GetQpackDecoderStreamId(), /*fin=*/false,
+                          StreamCancellationQpackDecoderInstruction(1))
+          .Build());
   socket_data1.AddWrite(SYNCHRONOUS,
                         client_maker_.MakePingPacket(packet_number++));
   socket_data1.AddWrite(SYNCHRONOUS, client_maker_.MakeRetireConnectionIdPacket(
@@ -8260,16 +8284,20 @@
     ConstructGetRequestPacket(packet_num++,
                               GetNthClientInitiatedBidirectionalStreamId(0),
                               /*fin=*/true);
-    std::vector<uint64_t> original_packet_numbers = {1};
-    uint64_t retransmit_frame_count = 2;
-    original_packet_numbers.push_back(2);
+
+    base::RepeatingCallback<bool(const quic::QuicFrame&)> control_stream_only =
+        FilterControlStreamOnly();
+    quic::QuicStreamId stream_0 = GetNthClientInitiatedBidirectionalStreamId(0);
     socket_data.AddWrite(
-        SYNCHRONOUS, client_maker_.MakeRetransmissionRstAndDataPacket(
-                         original_packet_numbers, packet_num++,
-                         GetNthClientInitiatedBidirectionalStreamId(0),
-                         quic::QUIC_STREAM_CANCELLED, GetQpackDecoderStreamId(),
-                         StreamCancellationQpackDecoderInstruction(0),
-                         retransmit_frame_count));
+        SYNCHRONOUS,
+        client_maker_.Packet(packet_num++)
+            .AddPacketRetransmission(1, control_stream_only)
+            .AddPacketRetransmission(2, control_stream_only)
+            .AddStopSendingFrame(stream_0, quic::QUIC_STREAM_CANCELLED)
+            .AddRstStreamFrame(stream_0, quic::QUIC_STREAM_CANCELLED)
+            .AddStreamFrame(GetQpackDecoderStreamId(), /*fin=*/false,
+                            StreamCancellationQpackDecoderInstruction(0))
+            .Build());
     socket_data.AddWrite(SYNCHRONOUS,
                          client_maker_.MakePingPacket(packet_num++));
     socket_data.AddWrite(
diff --git a/net/quic/quic_test_packet_maker.cc b/net/quic/quic_test_packet_maker.cc
index 28dc8ce..dd60b06 100644
--- a/net/quic/quic_test_packet_maker.cc
+++ b/net/quic/quic_test_packet_maker.cc
@@ -222,10 +222,7 @@
     uint64_t sequence_number) {
   auto& builder = Packet(packet_number);
   for (auto it : original_packet_numbers) {
-    for (auto frame :
-         connection_state_.saved_frames[quic::QuicPacketNumber(it)]) {
-      builder.AddFrameWithCoalescing(frame);
-    }
+    builder.AddPacketRetransmission(it);
   }
 
   builder.AddRetireConnectionIdFrame(sequence_number);
@@ -281,35 +278,6 @@
 }
 
 std::unique_ptr<quic::QuicReceivedPacket>
-QuicTestPacketMaker::MakeRetransmissionRstAndDataPacket(
-    const std::vector<uint64_t>& original_packet_numbers,
-    uint64_t packet_number,
-    quic::QuicStreamId rst_stream_id,
-    quic::QuicRstStreamErrorCode rst_error_code,
-    quic::QuicStreamId data_stream_id,
-    std::string_view data,
-    uint64_t retransmit_frame_count) {
-  DCHECK(connection_state_.save_packet_frames);
-  auto& builder = Packet(packet_number);
-  uint64_t frame_count = 0;
-  for (auto it : original_packet_numbers) {
-    for (auto frame :
-         connection_state_.saved_frames[quic::QuicPacketNumber(it)]) {
-      frame_count++;
-      if (retransmit_frame_count == 0 ||
-          frame_count <= retransmit_frame_count) {
-        builder.AddFrameWithCoalescing(frame);
-      }
-    }
-  }
-
-  builder.AddStopSendingFrame(rst_stream_id, rst_error_code);
-  builder.AddRstStreamFrame(rst_stream_id, rst_error_code);
-  builder.AddStreamFrame(data_stream_id, /* fin = */ false, data);
-  return builder.Build();
-}
-
-std::unique_ptr<quic::QuicReceivedPacket>
 QuicTestPacketMaker::MakeDataAndRstPacket(
     uint64_t packet_number,
     quic::QuicStreamId data_stream_id,
@@ -440,10 +408,7 @@
   auto& builder = Packet(packet_number);
   builder.AddAckFrame(first_received, largest_received, smallest_received);
   for (auto it : original_packet_numbers) {
-    for (auto frame :
-         connection_state_.saved_frames[quic::QuicPacketNumber(it)]) {
-      builder.AddFrameWithCoalescing(frame);
-    }
+    builder.AddPacketRetransmission(it);
   }
   return builder.Build();
 }
@@ -659,10 +624,7 @@
   builder.AddAckFrame(/*first_received=*/1, largest_received,
                       smallest_received);
   for (auto it : original_packet_numbers) {
-    for (auto frame :
-         connection_state_.saved_frames[quic::QuicPacketNumber(it)]) {
-      builder.AddFrameWithCoalescing(frame);
-    }
+    builder.AddPacketRetransmission(it);
   }
   builder.AddStreamFrame(stream_id, fin, data);
   return builder.Build();
@@ -735,10 +697,7 @@
   DCHECK(connection_state_.save_packet_frames);
   auto& builder = Packet(packet_number);
   for (auto it : original_packet_numbers) {
-    for (auto frame :
-         connection_state_.saved_frames[quic::QuicPacketNumber(it)]) {
-      builder.AddFrameWithCoalescing(frame);
-    }
+    builder.AddPacketRetransmission(it);
   }
 
   builder.MaybeAddHttp3SettingsFrames();
@@ -852,11 +811,7 @@
                                               uint64_t new_packet_number) {
   DCHECK(connection_state_.save_packet_frames);
   auto& builder = Packet(new_packet_number);
-  for (auto frame :
-       connection_state_
-           .saved_frames[quic::QuicPacketNumber(original_packet_number)]) {
-    builder.AddFrameWithCoalescing(frame);
-  }
+  builder.AddPacketRetransmission(original_packet_number);
   return builder.Build();
 }
 
@@ -1311,6 +1266,18 @@
   return *this;
 }
 
+QuicTestPacketBuilder& QuicTestPacketBuilder::AddPacketRetransmission(
+    uint64_t packet_number,
+    base::RepeatingCallback<bool(const quic::QuicFrame&)> filter) {
+  for (auto frame :
+       connection_state_->saved_frames[quic::QuicPacketNumber(packet_number)]) {
+    if (!filter || filter.Run(frame)) {
+      AddFrameWithCoalescing(frame);
+    }
+  }
+  return *this;
+}
+
 std::unique_ptr<quic::QuicReceivedPacket> QuicTestPacketBuilder::Build() {
   CHECK(maker_);
   QuicTestPacketMaker* maker = maker_;
diff --git a/net/quic/quic_test_packet_maker.h b/net/quic/quic_test_packet_maker.h
index 21881a45..6951151 100644
--- a/net/quic/quic_test_packet_maker.h
+++ b/net/quic/quic_test_packet_maker.h
@@ -138,15 +138,6 @@
       quic::QuicStreamId data_stream_id,
       std::string_view data);
 
-  std::unique_ptr<quic::QuicReceivedPacket> MakeRetransmissionRstAndDataPacket(
-      const std::vector<uint64_t>& original_packet_numbers,
-      uint64_t packet_number,
-      quic::QuicStreamId rst_stream_id,
-      quic::QuicRstStreamErrorCode rst_error_code,
-      quic::QuicStreamId data_stream_id,
-      std::string_view data,
-      uint64_t retransmit_frame_count = 0);
-
   std::unique_ptr<quic::QuicReceivedPacket> MakeDataAndRstPacket(
       uint64_t packet_number,
       quic::QuicStreamId data_stream_id,
@@ -575,6 +566,13 @@
   // stream ID into a single frame.
   QuicTestPacketBuilder& AddFrameWithCoalescing(const quic::QuicFrame& frame);
 
+  // Retransmit the frames in a previously-transmitted packet, optionally
+  // filtering frames with the given callback.
+  QuicTestPacketBuilder& AddPacketRetransmission(
+      uint64_t packet_number,
+      base::RepeatingCallback<bool(const quic::QuicFrame&)> filter =
+          base::RepeatingCallback<bool(const quic::QuicFrame&)>());
+
   // Complete the building process and return the resulting packet.
   std::unique_ptr<quic::QuicReceivedPacket> Build();
 
diff --git a/services/device/compute_pressure/README.md b/services/device/compute_pressure/README.md
index 19a011f..6da94e5 100644
--- a/services/device/compute_pressure/README.md
+++ b/services/device/compute_pressure/README.md
@@ -8,7 +8,7 @@
 The system is made up of the following components.
 
 `device::mojom::PressureManager`, defined in services, is the interface
-implemented in the browser side (`content::PressureServiceImpl`) to communicate
+implemented in the browser side (`content::PressureServiceBase`) to communicate
 with the renderer and implemented in services (`device::PressureManagerImpl`)
 to communicate with the browser side.
 
diff --git a/services/network/ip_protection/ip_protection_config_cache_impl.cc b/services/network/ip_protection/ip_protection_config_cache_impl.cc
index 03022e9..fa64ac65 100644
--- a/services/network/ip_protection/ip_protection_config_cache_impl.cc
+++ b/services/network/ip_protection/ip_protection_config_cache_impl.cc
@@ -177,9 +177,10 @@
 void IpProtectionConfigCacheImpl::OnNetworkChanged(
     net::NetworkChangeNotifier::ConnectionType type) {
   // When the network changes, but there is still a network, reset the
-  // tracking of whether QUIC proxies work.
+  // tracking of whether QUIC proxies work, and try to fetch a new proxy list.
   if (type != net::NetworkChangeNotifier::ConnectionType::CONNECTION_NONE) {
     ipp_over_quic_ = net::features::kIpPrivacyUseQuicProxies.Get();
+    RequestRefreshProxyList();
   }
 }
 
diff --git a/services/network/ip_protection/ip_protection_config_cache_impl_unittest.cc b/services/network/ip_protection/ip_protection_config_cache_impl_unittest.cc
index f5bfd55..c9b6939 100644
--- a/services/network/ip_protection/ip_protection_config_cache_impl_unittest.cc
+++ b/services/network/ip_protection/ip_protection_config_cache_impl_unittest.cc
@@ -10,6 +10,7 @@
 #include <vector>
 
 #include "base/strings/stringprintf.h"
+#include "base/test/bind.h"
 #include "base/test/metrics/histogram_tester.h"
 #include "base/test/scoped_feature_list.h"
 #include "base/test/task_environment.h"
@@ -252,4 +253,33 @@
   EXPECT_EQ(ipp_config_cache_->GetProxyChainList(), proxy_chain_list_with_quic);
 }
 
+// When the network changes, a new proxy list is requested.
+TEST_F(IpProtectionConfigCacheImplTest, RefreshProxyListOnNetworkChange) {
+  std::map<std::string, std::string> parameters;
+  parameters[net::features::kIpPrivacyUseQuicProxies.name] = "true";
+  base::test::ScopedFeatureList scoped_feature_list;
+  scoped_feature_list.InitAndEnableFeatureWithParameters(
+      net::features::kEnableIpProtectionProxy, std::move(parameters));
+
+  std::unique_ptr<net::NetworkChangeNotifier> network_change_notifier =
+      net::NetworkChangeNotifier::CreateMockIfNeeded();
+
+  ipp_config_cache_ =
+      std::make_unique<IpProtectionConfigCacheImpl>(mojo::NullRemote());
+
+  auto ipp_proxy_list_manager_ =
+      std::make_unique<MockIpProtectionProxyListManager>();
+  bool refresh_requested = false;
+  ipp_proxy_list_manager_->SetOnRequestRefreshProxyList(
+      base::BindLambdaForTesting([&]() { refresh_requested = true; }));
+  ipp_config_cache_->SetIpProtectionProxyListManagerForTesting(
+      std::move(ipp_proxy_list_manager_));
+
+  net::NetworkChangeNotifier::NotifyObserversOfNetworkChangeForTests(
+      net::NetworkChangeNotifier::ConnectionType::CONNECTION_2G);
+  base::RunLoop().RunUntilIdle();
+
+  EXPECT_TRUE(refresh_requested);
+}
+
 }  // namespace network
diff --git a/services/network/ip_protection/ip_protection_token_cache_manager_impl.cc b/services/network/ip_protection/ip_protection_token_cache_manager_impl.cc
index 286f364..e625e76 100644
--- a/services/network/ip_protection/ip_protection_token_cache_manager_impl.cc
+++ b/services/network/ip_protection/ip_protection_token_cache_manager_impl.cc
@@ -164,6 +164,14 @@
                 return a->expiration < b->expiration;
               });
 
+    // If the number of tokens in the cache is still below the low-water mark,
+    // we do not want to immediately re-request tokens, lest we overwhelm the
+    // server. This is unlikely to happen in practice, but exists as a safety
+    // check.
+    if (cache_.size() < cache_low_water_mark_) {
+      try_get_auth_tokens_after_ = base::Time::Now() + base::Minutes(1);
+    }
+
     base::UmaHistogramMediumTimes(
         "NetworkService.IpProtection.TokenBatchGenerationTime",
         base::TimeTicks::Now() - attempt_start_time_for_metrics);
diff --git a/services/network/ip_protection/ip_protection_token_cache_manager_impl_unittest.cc b/services/network/ip_protection/ip_protection_token_cache_manager_impl_unittest.cc
index 3872d85..f72d981f 100644
--- a/services/network/ip_protection/ip_protection_token_cache_manager_impl_unittest.cc
+++ b/services/network/ip_protection/ip_protection_token_cache_manager_impl_unittest.cc
@@ -285,6 +285,24 @@
       HistogramState{.success = 0, .failure = 1, .generated = 1});
 }
 
+// If `TryGetAuthTokens()` returns a batch smaller than the low-water mark, the
+// cache does not immediately refill.
+TEST_F(IpProtectionTokenCacheManagerImplTest, SmallBatch) {
+  mock_.ExpectTryGetAuthTokensCall(
+      expected_batch_size_,
+      TokenBatch(cache_low_water_mark_ - 1, kFutureExpiration));
+  CallTryGetAuthTokensAndWait(network::mojom::IpProtectionProxyLayer::kProxyA);
+  ASSERT_TRUE(mock_.GotAllExpectedMockCalls());
+
+  ASSERT_TRUE(ipp_proxy_a_token_cache_manager_->IsAuthTokenAvailable());
+  ASSERT_TRUE(ipp_proxy_a_token_cache_manager_->GetAuthToken());
+  ASSERT_TRUE(ipp_proxy_a_token_cache_manager_
+                  ->try_get_auth_tokens_after_for_testing() >
+              base::Time::Now());
+  ExpectHistogramState(
+      HistogramState{.success = 1, .failure = 0, .generated = 1});
+}
+
 // If `TryGetAuthTokens()` returns an backoff due to an error, the cache remains
 // empty.
 TEST_F(IpProtectionTokenCacheManagerImplTest, ErrorBatch) {
diff --git a/services/screen_ai/README.md b/services/screen_ai/README.md
index 4b9cd28..865ecb7 100644
--- a/services/screen_ai/README.md
+++ b/services/screen_ai/README.md
@@ -1,44 +1,26 @@
 # Chrome Screen AI Library
 
 ## Purpose
-Chrome Screen AI library provides two on-device functionalities for Chrome and ChromeOS:
- - **Main Content Extraction:** Intelligently isolates the core content of a web
+Chrome Screen AI library provides two on-device functionalities for Chrome and
+ChromeOS:
+* **Main Content Extraction:** Intelligently isolates the main content of a web
    page, improving its readability by stripping distracting elements (based on
    the accessibility tree).
- - **Optical Character Recognition:** Analyzes images to extract text.
+* **Optical Character Recognition:** Extracts text from image.
+
+These functionalities are entirely on device and do not send any data to
+network or store on disk.
 
 ## Development and Deployment
- - **Source:** Developed within Google's internal source code repository (google3).
- - **Platforms:** Built for ChromeOS, Linux, Mac, and Windows.
- - **Distribution:**
-   - **ChromeOS:** Distributed via DLC (Dynamic Link Component).
-   - **Linux, Mac, Windows:** Delivered on-demand through the component updater.
+* **Source:** Developed within Google's internal source code repository
+   (google3).
+* **Platforms:** Built for ChromeOS, Linux, Mac, and Windows.
+* **Distribution:**
+  * **ChromeOS:** Distributed via DLC (Dynamic Link Component).
+  * **Linux, Mac, Windows:** Delivered on-demand through the component updater.
 
-## How to Use for OCR
- -  when all use cases are covered.
- - ScreenAI service is downloaded and initialized on demand, and stays on disk
-   for 30 days after the last use.
- - If your use case allows, before promising the availability to user, call
-   `screen_ai::ScreenAIServiceRouterFactory::GetForBrowserContext(browser_context)::GetServiceStateAsync`
-   to trigger the service initialization and receive the result in a callback when download and
-   initialization (if needed) are finished.
- - Create a `screen_ai::OpticalCharacterRecognizer` object.
- - If you have not used `IsReadyAsync`, wait until
-   `screen_ai::OpticalCharacterRecognizer::IsReady` returns true.
- - Call `OpticalCharacterRecognizer::PerformOCR` with an image and get the OCR
-   results. If service is not yet initialized, this call will return empty.
- - TODO(crbug.com/327181467): Add interfaces and instructions for calls from
-   renderer process.
-
-## How to use for Main Content Extraction (to be updated as OCR)
-  - **Library Availability Check:** Since the library isn't pre-installed with
-    Chrome, confirm its presence before enabling Screen AI features by using
-    `ScreenAIServiceRouter::GetServiceStateAsync` to query the library's
-    download and readiness status.
-  - **Interface Creation:** Once the library is confirmed available, create a
-    mojo interface to access the desired functionality. See the following as an
-    example, focusing on the `ExtractMainContent` call:
-    `chrome/renderer/accessibility/ax_tree_distiller.cc`
+## How to Use
+See: `chrome/browser/screen_ai/README.md`
 
 ## Bugs Component:
   Chromium > UI > Accessibility > MachineIntelligence
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json
index be0eedc6..31a753b 100644
--- a/testing/variations/fieldtrial_testing_config.json
+++ b/testing/variations/fieldtrial_testing_config.json
@@ -4196,6 +4196,25 @@
             ]
         }
     ],
+    "ClientSideDetectionSamplePing": [
+        {
+            "platforms": [
+                "android",
+                "chromeos",
+                "linux",
+                "mac",
+                "windows"
+            ],
+            "experiments": [
+                {
+                    "name": "Enabled",
+                    "enable_features": [
+                        "ClientSideDetectionSamplePing"
+                    ]
+                }
+            ]
+        }
+    ],
     "ClipboardDeemphasisAndroid": [
         {
             "platforms": [
@@ -21838,6 +21857,24 @@
             ]
         }
     ],
+    "WaitForAccountCapabilitiesInSigninIntercept": [
+        {
+            "platforms": [
+                "linux",
+                "mac",
+                "windows"
+            ],
+            "experiments": [
+                {
+                    "name": "WaitForCapabilitiesWithPreconnect_20240503",
+                    "enable_features": [
+                        "CustomWebSignInInterceptForSupervisedUsers",
+                        "PreconnectAccountCapabilitiesPostSignin"
+                    ]
+                }
+            ]
+        }
+    ],
     "WaitUntilAccessTokenAvailableForClassifyUrl": [
         {
             "platforms": [
@@ -22146,6 +22183,21 @@
             ]
         }
     ],
+    "WebRTC-Aec3BufferingMaxAllowedExcessRenderBlocksOverride": [
+        {
+            "platforms": [
+                "chromeos",
+                "linux",
+                "mac",
+                "windows"
+            ],
+            "experiments": [
+                {
+                    "name": "1"
+                }
+            ]
+        }
+    ],
     "WebRTC-Aec3DelayEstimateSmoothingDelayFoundOverride": [
         {
             "platforms": [
diff --git a/third_party/angle b/third_party/angle
index ff0a33c..b0875f1 160000
--- a/third_party/angle
+++ b/third_party/angle
@@ -1 +1 @@
-Subproject commit ff0a33cde29d9eea6d835f3fc4b774b5cce4ead3
+Subproject commit b0875f124a2459318e974653517f87d8fcbb50c2
diff --git a/third_party/blink/public/mojom/webid/federated_auth_request.mojom b/third_party/blink/public/mojom/webid/federated_auth_request.mojom
index efeb270..167fe29 100644
--- a/third_party/blink/public/mojom/webid/federated_auth_request.mojom
+++ b/third_party/blink/public/mojom/webid/federated_auth_request.mojom
@@ -94,12 +94,6 @@
   // custom ones (e.g. "access to calendar", "access to social graph", etc).
   array<string> scope;
 
-  // The types of token the relying party wants to get back (e.g. an id token
-  // or an access token).
-  // More than one type can be requested, e.g. to support OIDC flows:
-  // https://openid.net/specs/openid-connect-core-1_0.html#code-id_token-tokenExample
-  array<string> responseType;
-
   // Additional parameters that the relying party can send to the IdP after
   // the user's permission has been gathered.
   map<string, string> params;
diff --git a/third_party/blink/renderer/core/css/selector_query.cc b/third_party/blink/renderer/core/css/selector_query.cc
index 987e191..a1c0ae621 100644
--- a/third_party/blink/renderer/core/css/selector_query.cc
+++ b/third_party/blink/renderer/core/css/selector_query.cc
@@ -221,6 +221,27 @@
   return EqualIgnoringASCIICase(selector_value, value);
 }
 
+// SynchronizeAttribute() is rather expensive to call. We can determine ahead of
+// time if it's needed. The exact set needed for svg is rather large, so this
+// errors on the side of caution.
+static bool NeedsSynchronizeAttribute(const QualifiedName& qname,
+                                      bool is_html_doc) {
+  // Assume any known name needs synchronization.
+  if (qname.IsDefinedName()) {
+    return true;
+  }
+  const QualifiedName local_qname(qname.LocalName());
+  if (local_qname.IsDefinedName()) {
+    return true;
+  }
+  // HTML elements in an html doc use the lower case name.
+  if (!is_html_doc || qname.LocalName().IsLowerASCII()) {
+    return false;
+  }
+  const QualifiedName lower_local_qname(qname.LocalName().LowerASCII());
+  return lower_local_qname.IsDefinedName();
+}
+
 template <typename SelectorQueryTrait>
 static void CollectElementsByAttributeExact(
     ContainerNode& root_node,
@@ -239,14 +260,17 @@
   // flag is set or not.
   const bool legacy_case_insensitive =
       is_html_doc && !selector.IsCaseSensitiveAttribute();
+  const bool needs_synchronize_attribute =
+      NeedsSynchronizeAttribute(selector_attr, is_html_doc);
 
   for (Element& element : ElementTraversal::DescendantsOf(root_node)) {
     QUERY_STATS_INCREMENT(fast_scan);
-    // Synchronize the attribute in case it is lazy-computed.
-    // Currently all lazy properties have a null namespace, so only pass
-    // localName().
-    // TODO: figure out how to only call this if necessary.
-    element.SynchronizeAttribute(selector_attr.LocalName());
+    if (needs_synchronize_attribute) {
+      // Synchronize the attribute in case it is lazy-computed.
+      // Currently all lazy properties have a null namespace, so only pass
+      // localName().
+      element.SynchronizeAttribute(selector_attr.LocalName());
+    }
     AttributeCollection attributes = element.AttributesWithoutUpdate();
     for (const auto& attribute_item : attributes) {
       if (!attribute_item.Matches(selector_attr)) {
diff --git a/third_party/blink/renderer/core/layout/svg/svg_content_container.cc b/third_party/blink/renderer/core/layout/svg/svg_content_container.cc
index 3e6cbb935..d4a9e4a 100644
--- a/third_party/blink/renderer/core/layout/svg/svg_content_container.cc
+++ b/third_party/blink/renderer/core/layout/svg/svg_content_container.cc
@@ -145,24 +145,15 @@
       }
     }
 
-    // Resource containers are nasty: they can invalidate clients outside the
-    // containers.
-    // Since they only care about viewport size changes (to resolve their
-    // relative lengths), we trigger their invalidation directly from
-    // SVGSVGElement::svgAttributeChange() or at the LayoutView. We do not mark
-    // them for resources here, because their ability to reference each other
-    // leads to circular layout.
-    // TODO(layout-dev): Do we still need this special treatment?
-    if (!child->IsSVGResourceContainer()) {
-      DCHECK(!child->IsSVGRoot());
-      if (force_child_layout) {
-        child->SetNeedsLayout(layout_invalidation_reason::kSvgChanged,
-                              kMarkOnlyThis);
-      }
-
-      // Lay out any referenced resources before the child.
-      LayoutMarkerResourcesIfNeeded(*child, layout_info);
+    DCHECK(!child->IsSVGRoot());
+    if (force_child_layout) {
+      child->SetNeedsLayout(layout_invalidation_reason::kSvgChanged,
+                            kMarkOnlyThis);
     }
+
+    // Lay out any referenced resources before the child.
+    LayoutMarkerResourcesIfNeeded(*child, layout_info);
+
     if (!child->NeedsLayout()) {
       continue;
     }
diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc
index ffa8ab2..061d3420 100644
--- a/third_party/blink/renderer/core/loader/document_loader.cc
+++ b/third_party/blink/renderer/core/loader/document_loader.cc
@@ -2187,6 +2187,9 @@
   // true, we won't try to compare the nonce of this origin (if it's opaque) to
   // the browser-calculated origin later on.
   bool origin_is_newly_created = false;
+  bool is_sandboxed = (policy_container_->GetPolicies().sandbox_flags &
+                       network::mojom::blink::WebSandboxFlags::kOrigin) !=
+                      network::mojom::blink::WebSandboxFlags::kNone;
   if (origin_to_commit_) {
     // Origin to commit is specified by the browser process, it must be taken
     // and used directly. It is currently supplied only for failed navigations
@@ -2233,21 +2236,24 @@
     debug_info_builder.Append(", url=");
     debug_info_builder.Append(owner_document->Url().BaseAsString());
     debug_info_builder.Append(")");
-  } else if (url_.IsAboutSrcdocURL()) {
-    // If there's no owner_document and this is a srcdoc load, then get the
-    // origin from the remote parent. A srcdoc navigation with no owner_document
-    // can only happen if the iframe is sandboxed and isolated sandboxed frames
-    // is enabled In that case, copy the origin from the remote parent
-    // here—though this origin will only be used to derive the actual opaque
-    // origin later.
+  } else if (url_.IsAboutSrcdocURL() && is_sandboxed) {
+    // If there's no owner_document and this is a sandboxed srcdoc load, then
+    // get the origin from the remote parent. In general, a srcdoc navigation
+    // with no owner_document can only currently happen in two cases:
+    // 1) if the iframe is sandboxed and isolated sandboxed frames is enabled,
+    //    in which case, copy the origin from the remote parent here (though
+    //    this origin will only be used to derive the actual opaque origin
+    //    later),
+    // 2) if we are print-previewing a selection of a srcdoc frame (see
+    //    crbug.com/333992355), in which case (i) the original frame url is
+    //    copied, but (ii) the document is in a mainframe, meaning there is
+    //    no parent.
+    // In the second case, we handle the origin calculation in the terminal
+    // else-block below.
     // TODO(https://crbug.com/328279696): this block can be removed once the
     // about:srcdoc navigation blocking finishes rolling out, as then the
     // initiator can never be cross-origin to the parent.
     debug_info_builder.Append("about_srcdoc_with_remote_parent[origin=");
-    // Verify this is a sandboxed srcdoc frame.
-    CHECK((policy_container_->GetPolicies().sandbox_flags &
-           network::mojom::blink::WebSandboxFlags::kOrigin) !=
-          network::mojom::blink::WebSandboxFlags::kNone);
     origin = frame_->Tree()
                  .Parent()
                  ->GetSecurityContext()
diff --git a/third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.cc b/third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.cc
index b964781..dd41ad2 100644
--- a/third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.cc
+++ b/third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.cc
@@ -872,9 +872,6 @@
   if (options.hasScope()) {
     mojo_options->scope = options.scope();
   }
-  if (options.hasResponseType()) {
-    mojo_options->responseType = options.responseType();
-  }
   if (options.hasParams()) {
     HashMap<String, String> params;
     for (const auto& pair : options.params()) {
diff --git a/third_party/blink/renderer/modules/credentialmanagement/identity_provider_config.idl b/third_party/blink/renderer/modules/credentialmanagement/identity_provider_config.idl
index 1f4e3573..a7579598 100644
--- a/third_party/blink/renderer/modules/credentialmanagement/identity_provider_config.idl
+++ b/third_party/blink/renderer/modules/credentialmanagement/identity_provider_config.idl
@@ -19,6 +19,5 @@
   DOMString loginHint;
   [RuntimeEnabled=FedCmDomainHint] DOMString domainHint;
   [RuntimeEnabled=FedCmAuthz] sequence<USVString> scope;
-  [RuntimeEnabled=FedCmAuthz] sequence<USVString> responseType;
   [RuntimeEnabled=FedCmAuthz] record<USVString, USVString> params;
 };
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
index f3dd5df8..c4a97e9 100644
--- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
+++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -273461,7 +273461,7 @@
         ]
        ],
        "selectlist-option-arbitrary-content-displayed.tentative.html": [
-        "2d51002fb2e7e30f5cae4cd1a9452f63641e0dff",
+        "8c620baccad8ef750589b8d7687dd3aa458a1cf4",
         [
          null,
          [
@@ -273470,7 +273470,23 @@
            "=="
           ]
          ],
-         {}
+         {
+          "fuzzy": [
+           [
+            null,
+            [
+             [
+              0,
+              1
+             ],
+             [
+              0,
+              200
+             ]
+            ]
+           ]
+          ]
+         }
         ]
        ],
        "selectlist-option-arbitrary-content-not-displayed.tentative.html": [
@@ -604480,7 +604496,7 @@
       ]
      ],
      "event-constructor.html": [
-      "863681ced730d1c3f441a6f8b21db7b890301d25",
+      "89ac934020eec9c7771b2fbd608a95e730b5d093",
       [
        null,
        {}
@@ -604627,14 +604643,14 @@
       ]
      ],
      "navigate-anchor-cross-origin.html": [
-      "62e5adb20ae88c33c3f76b527d98502d38db3a52",
+      "a69b78196ff288fb251a1393436e4714d7925701",
       [
        null,
        {}
       ]
      ],
      "navigate-anchor-download-userInitiated.html": [
-      "69181425292e758ac5bdccaec51b95f3670ecb71",
+      "17109a2ae82049bba0afbec4df059fe43150164d",
       [
        null,
        {
@@ -604643,28 +604659,28 @@
       ]
      ],
      "navigate-anchor-download.html": [
-      "d04245ec253ce0b9f56afa9fbc598730924ba40e",
+      "fbeeb69b9563f7246079242a31063e584e3e420a",
       [
        null,
        {}
       ]
      ],
      "navigate-anchor-fragment.html": [
-      "6443ccecd1d702cc1210857bd9c7013721d88fa6",
+      "69400c3d2f31f8df45dfef9062904035800c4ac5",
       [
        null,
        {}
       ]
      ],
      "navigate-anchor-same-origin-cross-document.html": [
-      "5a6dce7ec8bcc9b349494ff151428d219ee7bfc0",
+      "084993540a18dc90da1cd747de05fdcef6cc093a",
       [
        null,
        {}
       ]
      ],
      "navigate-anchor-userInitiated.html": [
-      "bb76e7a3fbe65121452fb39218f89c567bafac48",
+      "686d7ad6ee393e6ca5cc65193e35f7bdf8fda416",
       [
        null,
        {
@@ -604673,7 +604689,7 @@
       ]
      ],
      "navigate-anchor-with-target.html": [
-      "e4b897d82f3ddc62e64f9a7489969425338b29f9",
+      "de74239b3bee8b3cc0e7e27c899e8b620245d925",
       [
        null,
        {}
@@ -604694,35 +604710,35 @@
       ]
      ],
      "navigate-destination-getState-back-forward.html": [
-      "869fc1648157b25f296c69f8163a441a0101277b",
+      "b206981821b5441534f2c19b3f8076308ec3e0bf",
       [
        null,
        {}
       ]
      ],
      "navigate-destination-getState-navigate.html": [
-      "d19a16851453a0ea5f9b7ac72ea2bb9e70e98199",
+      "1e622f99117c192a0081cdf92e2d2b9605fa182c",
       [
        null,
        {}
       ]
      ],
      "navigate-destination-getState-reload.html": [
-      "ac6528ce7ef261ac087105f54d52d0ef381cb231",
+      "be33b8120da70a1269efeb6cef3beb2c8a9922a6",
       [
        null,
        {}
       ]
      ],
      "navigate-form-get.html": [
-      "7a71a1c3050a0cceca5ca0e9415a830ae8210356",
+      "59661a1caf77a5da1672bf0fb4ace357e970292a",
       [
        null,
        {}
       ]
      ],
      "navigate-form-reload.html": [
-      "217169053722c2b4c4ecdbaed4b9a8e263fbb97a",
+      "cdd3ade4ff2c54e889183a852bc4d42611e8e19f",
       [
        null,
        {}
@@ -604736,14 +604752,14 @@
       ]
      ],
      "navigate-form-traverse.html": [
-      "b9665c805665956fe57bf6640cb292be71f447f3",
+      "72b8dc36acb3a7d64f91cc59a261b971d0836312",
       [
        null,
        {}
       ]
      ],
      "navigate-form-userInitiated.html": [
-      "246e028a0dbf241f1667c380a0255396d13b1553",
+      "079f546771ff669f48c69bb8ead2932ceeb24324",
       [
        null,
        {
@@ -604752,28 +604768,28 @@
       ]
      ],
      "navigate-form-with-target.html": [
-      "4b1a8ce9d3a975f839f0af2a91e0a600a8ea827e",
+      "07418366a7644104ac31db6ef0bb881a7b499cd4",
       [
        null,
        {}
       ]
      ],
      "navigate-form.html": [
-      "653ef3b8eba65a79f631ac392c9cdf8b0ec77d9b",
+      "8cea889bec185a26797b8df559682a78cfe9b14b",
       [
        null,
        {}
       ]
      ],
      "navigate-history-back-after-fragment.html": [
-      "9da4ddcd50779229c550452987ce153671a4e093",
+      "4529fe25ac3b4f84410dad36a09a7dd5f0f4c036",
       [
        null,
        {}
       ]
      ],
      "navigate-history-back-after-pushState.html": [
-      "fdee41a312191455e0f7babdad75d281b6fc6755",
+      "06c3b89bbcf4141de35e8d65d002b798f3fea651",
       [
        null,
        {}
@@ -604787,7 +604803,7 @@
       ]
      ],
      "navigate-history-back-cross-document.html": [
-      "29c626a522145f5a26b050e9e97aeff4d213cad8",
+      "a34b20a5e539fae8437d112025e56b5924d182a8",
       [
        null,
        {}
@@ -604801,77 +604817,77 @@
       ]
      ],
      "navigate-history-go-0.html": [
-      "5508928e198dd9a4d88fe6ac3b50a99286c2e825",
+      "cd716bfafb1b4cc425ee0a387f590cc773340cd7",
       [
        null,
        {}
       ]
      ],
      "navigate-history-pushState.html": [
-      "5079b21078178175df99bdb1875889b9328fed34",
+      "f89288b6edf4685c24b974b34f2ae778efe7bb6c",
       [
        null,
        {}
       ]
      ],
      "navigate-history-replaceState.html": [
-      "444116a6324c361b6876f3370bbcf4f579c7f0f4",
+      "d18feb2bc1debbde82708d3442c46d387ca2394a",
       [
        null,
        {}
       ]
      ],
      "navigate-iframe-location.html": [
-      "1bd79188231b6ff973fe9e741f9d554be252bd72",
+      "c00a6e010db8e21cd5a01ec5972300792add9033",
       [
        null,
        {}
       ]
      ],
      "navigate-location.html": [
-      "a0ed4dc0aac5886cee3496a4aac007eaddaee46e",
+      "b1ce204a626a5ada1410426fcdbfd56e4337d628",
       [
        null,
        {}
       ]
      ],
      "navigate-meta-refresh.html": [
-      "d4d5b1c8e13927eaa3bbda1d973cc1413421c753",
+      "f64484c3055cbb2d761dd1a5cdc858f61d28d75d",
       [
        null,
        {}
       ]
      ],
      "navigate-navigation-back-cross-document.html": [
-      "084051539b8db3f50edb4e3037c9dd8882a6bbe6",
+      "de87fbbb800d1681c9d1b7ed925085dbac2ad7ba",
       [
        null,
        {}
       ]
      ],
      "navigate-navigation-back-same-document-in-iframe.html": [
-      "42c694e2905d73eb7ba92dc7a96c3c3152febf8e",
+      "3d810d2f1de5a8e2a3054465844a2edec7783901",
       [
        null,
        {}
       ]
      ],
      "navigate-navigation-back-same-document.html": [
-      "b08bbfcbf11430e3e5f6131e91fb8b90ea82a891",
+      "0f2faff7d7b06238d106b5f54210ab60d29c0cca",
       [
        null,
        {}
       ]
      ],
      "navigate-navigation-navigate.html": [
-      "c56af1b40df8fd0720f0114f687ef78fed88a074",
+      "5dd1892cc001a77ca24b530ca7c7bd8e017860d9",
       [
        null,
        {}
       ]
      ],
      "navigate-svg-anchor-fragment.html": [
-      "c6d210cccb1335983ba3df95788e1f7e7caa3dc8",
+      "647496fd5c6980e8a977317a40c5e7e0424573c5",
       [
        null,
        {}
@@ -604885,21 +604901,21 @@
       ]
      ],
      "navigate-to-srcdoc.html": [
-      "ea5c3f92168500ed6966dd1211447eb0bbcc7280",
+      "bb598d8b90292904fe669c6dd2414faa8460b586",
       [
        null,
        {}
       ]
      ],
      "navigate-window-open-self.html": [
-      "4e569b6d548f165cd7939b5e51d7da19957b0f69",
+      "1ef65ed82ba23a297e1a84eda5a200319e4db105",
       [
        null,
        {}
       ]
      ],
      "navigate-window-open.html": [
-      "42828308d7709e717402e126f7aebbf1d6e0896c",
+      "13cdefb5d3b559ec92a92d689d499727d02fac24",
       [
        null,
        {}
diff --git a/third_party/blink/web_tests/external/wpt/css/css-masking/mask-image/mask-image-svg-viewport-changed.html b/third_party/blink/web_tests/external/wpt/css/css-masking/mask-image/mask-image-svg-viewport-changed.html
new file mode 100644
index 0000000..156317b
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-masking/mask-image/mask-image-svg-viewport-changed.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>Change of viewport affecting mask content</title>
+<link rel="help" href="https://drafts.fxtf.org/css-masking-1/#the-mask-image">
+<link rel="help" href="https://drafts.fxtf.org/css-masking-1/#svg-masks">
+<link rel="match" href="../clip-path/reference/green-100x100.html">
+<div id="container" style="width: 0%">
+  <svg style="width: 100%">
+    <mask id="mask">
+      <rect width="100%" height="100%" fill="white"/>
+    </mask>
+    <rect width="100" height="100" fill="red"/>
+    <rect width="100" height="100" fill="green" mask="url(#mask)"/>
+  </svg>
+</div>
+<script>
+  document.body.offsetTop;
+  document.getElementById('container').style.width = '100%';
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/event-constructor.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/event-constructor.html
index 863681c..89ac934 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/event-constructor.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/event-constructor.html
@@ -78,7 +78,8 @@
     assert_equals(event.downloadRequest, downloadRequest);
     assert_equals(event.info, info);
     assert_equals(event.hasUAVisualTransition, hasUAVisualTransition);
-    assert_equals(event.sourceElement, sourceElement);
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(event.sourceElement, sourceElement);
   });
   history.pushState(2, null, "#2");
 }, "all properties are reflected back");
@@ -98,7 +99,8 @@
     assert_equals(event.formData, null);
     assert_equals(event.downloadRequest, null);
     assert_equals(event.info, undefined);
-    assert_equals(event.sourceElement, null);
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(event.sourceElement, null);
   });
   history.pushState(3, null, "#3");
 }, "defaults are as expected");
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-cross-origin.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-cross-origin.html
index 62e5adb..a69b781 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-cross-origin.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-cross-origin.html
@@ -17,7 +17,8 @@
     assert_equals(e.destination.key, "");
     assert_equals(e.destination.id, "");
     assert_equals(e.destination.index, -1);
-    assert_equals(e.sourceElement, document.getElementById("a"));
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, document.getElementById("a"));
     e.preventDefault();
   });
   a.click();
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-download-userInitiated.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-download-userInitiated.html
index 6918142..17109a2 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-download-userInitiated.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-download-userInitiated.html
@@ -21,7 +21,8 @@
     assert_equals(e.destination.key, "");
     assert_equals(e.destination.id, "");
     assert_equals(e.destination.index, -1);
-    assert_equals(e.sourceElement, document.getElementById("a"));
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, document.getElementById("a"));
     e.preventDefault();
     t.step_timeout(t.step_func_done(() => assert_equals(location.hash, "")), 0);
   });
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-download.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-download.html
index d04245ec..fbeeb69 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-download.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-download.html
@@ -25,7 +25,8 @@
       assert_equals(e.destination.key, "");
       assert_equals(e.destination.id, "");
       assert_equals(e.destination.index, -1);
-      assert_equals(e.sourceElement, a);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, a);
       e.preventDefault();
     });
     a.click();
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-fragment.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-fragment.html
index 6443cce..69400c3 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-fragment.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-fragment.html
@@ -17,7 +17,8 @@
     assert_equals(e.destination.key, "");
     assert_equals(e.destination.id, "");
     assert_equals(e.destination.index, -1);
-    assert_equals(e.sourceElement, document.getElementById("a"));
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, document.getElementById("a"));
     e.preventDefault();
     t.step_timeout(t.step_func_done(() => assert_equals(location.hash, "")), 0);
   });
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-same-origin-cross-document.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-same-origin-cross-document.html
index 5a6dce7..0849935 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-same-origin-cross-document.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-same-origin-cross-document.html
@@ -18,7 +18,8 @@
     assert_equals(e.destination.key, "");
     assert_equals(e.destination.id, "");
     assert_equals(e.destination.index, -1);
-    assert_equals(e.sourceElement, document.getElementById("a"));
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, document.getElementById("a"));
     e.preventDefault();
   });
   a.click();
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-userInitiated.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-userInitiated.html
index bb76e7a..686d7ad 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-userInitiated.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-userInitiated.html
@@ -20,7 +20,8 @@
     assert_equals(e.destination.key, "");
     assert_equals(e.destination.id, "");
     assert_equals(e.destination.index, -1);
-    assert_equals(e.sourceElement, document.getElementById("a"));
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, document.getElementById("a"));
     e.preventDefault();
     t.step_timeout(t.step_func_done(() => assert_equals(location.hash, "")), 0);
   });
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-with-target.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-with-target.html
index e4b897d..de74239 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-with-target.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-anchor-with-target.html
@@ -20,10 +20,11 @@
       assert_equals(new URL(e.destination.url).pathname,
                     "/navigation-api/navigate-event/foo.html");
       assert_false(e.destination.sameDocument);
-    assert_equals(e.destination.key, "");
-    assert_equals(e.destination.id, "");
+      assert_equals(e.destination.key, "");
+      assert_equals(e.destination.id, "");
       assert_equals(e.destination.index, -1);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
       e.preventDefault();
     });
     a.click();
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-destination-getState-back-forward.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-destination-getState-back-forward.html
index 869fc16..b2069818 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-destination-getState-back-forward.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-destination-getState-back-forward.html
@@ -19,7 +19,8 @@
       assert_equals(e.destination.key, "");
       assert_equals(e.destination.id, "");
       assert_equals(e.destination.index, -1);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
     });
     navigation.back();
   }), 0);
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-destination-getState-navigate.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-destination-getState-navigate.html
index d19a168..1e622f99 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-destination-getState-navigate.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-destination-getState-navigate.html
@@ -16,7 +16,8 @@
       assert_equals(e.destination.key, "");
       assert_equals(e.destination.id, "");
       assert_equals(e.destination.index, -1);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
     });
     navigation.navigate("#foo", { state: navState });
   }, 0);
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-destination-getState-reload.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-destination-getState-reload.html
index ac6528c..be33b81 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-destination-getState-reload.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-destination-getState-reload.html
@@ -16,7 +16,8 @@
       assert_equals(e.destination.key, "");
       assert_equals(e.destination.id, "");
       assert_equals(e.destination.index, -1);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
       e.intercept();
     });
     navigation.updateCurrentEntry({ state: navState });
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-get.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-get.html
index 7a71a1c..59661a1 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-get.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-get.html
@@ -21,7 +21,8 @@
 
     // Because it's a GET, not a POST
     assert_equals(e.formData, null);
-    assert_equals(e.sourceElement, form);
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, form);
   });
   window.onload = t.step_func(() => form.submit());
 }, "<form> submission with GET method fires navigate event but with formData null");
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-reload.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-reload.html
index 2171690..cdd3ade 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-reload.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-reload.html
@@ -12,7 +12,8 @@
     iframe.contentWindow.navigation.onnavigate = t.step_func(e => {
       assert_equals(e.navigationType, "push");
       assert_not_equals(e.formData, null);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
 
       iframe.onload = t.step_func(() => {
         iframe.contentWindow.navigation.onnavigate = t.step_func_done(e => {
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-traverse.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-traverse.html
index b9665c805..72b8dc3 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-traverse.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-traverse.html
@@ -12,7 +12,8 @@
     iframe.contentWindow.navigation.onnavigate = t.step_func(e => {
       assert_equals(e.navigationType, "push");
       assert_not_equals(e.formData, null);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
 
       iframe.onload = t.step_func(() => {
         // Avoid the replace behavior that occurs if you navigate during the load handler
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-userInitiated.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-userInitiated.html
index 246e028..079f546 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-userInitiated.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-userInitiated.html
@@ -24,7 +24,8 @@
     assert_equals(e.destination.id, "");
     assert_equals(e.destination.index, -1);
     assert_not_equals(e.formData, null);
-    assert_equals(e.sourceElement, submit);
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, submit);
   });
   window.onload = t.step_func(() => test_driver.click(submit));
 }, "<form> submission fires navigate event");
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-with-target.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-with-target.html
index 4b1a8ce9..0741836 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-with-target.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form-with-target.html
@@ -22,7 +22,8 @@
       assert_equals(e.destination.id, "");
       assert_equals(e.destination.index, -1);
       assert_not_equals(e.formData, null);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
     });
     form.submit();
   });
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form.html
index 653ef3b..8cea889 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-form.html
@@ -19,7 +19,8 @@
     assert_equals(e.destination.id, "");
     assert_equals(e.destination.index, -1);
     assert_not_equals(e.formData, null);
-    assert_equals(e.sourceElement, form);
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, form);
   });
   window.onload = t.step_func(() => form.submit());
 }, "<form> submission fires navigate event");
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-back-after-fragment.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-back-after-fragment.html
index 9da4ddc..4529fe2 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-back-after-fragment.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-back-after-fragment.html
@@ -24,7 +24,8 @@
       assert_equals(e.destination.id, target_id);
         assert_equals(e.destination.index, start_index);
       assert_equals(e.formData, null);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
     });
 
     history.back();
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-back-after-pushState.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-back-after-pushState.html
index fdee41a..06c3b89 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-back-after-pushState.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-back-after-pushState.html
@@ -24,7 +24,8 @@
       assert_equals(e.destination.id, target_id);
       assert_equals(e.destination.index, start_index);
       assert_equals(e.formData, null);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
     });
 
     history.back();
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-back-cross-document.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-back-cross-document.html
index 29c626a..a34b20a5 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-back-cross-document.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-back-cross-document.html
@@ -23,7 +23,8 @@
         assert_equals(e.destination.index, 0);
         assert_equals(e.formData, null);
         assert_equals(e.info, undefined);
-        assert_equals(e.sourceElement, null);
+        // NavigateEvent sourceElement is still in development, so test whether it is available.
+        if ("sourceElement" in e) assert_equals(e.sourceElement, null);
       });
       assert_true(i.contentWindow.navigation.canGoBack);
       i.contentWindow.history.back();
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-go-0.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-go-0.html
index 5508928e..cd716bfa 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-go-0.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-go-0.html
@@ -18,7 +18,8 @@
       assert_equals(e.destination.id, "");
       assert_equals(e.destination.index, -1);
       assert_equals(e.formData, null);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
       e.preventDefault();
     });
 
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-pushState.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-pushState.html
index 5079b21..f89288b 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-pushState.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-pushState.html
@@ -17,7 +17,8 @@
     assert_equals(e.destination.id, "");
     assert_equals(e.destination.index, -1);
     assert_equals(e.formData, null);
-    assert_equals(e.sourceElement, null);
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, null);
     e.preventDefault();
     t.step_timeout(t.step_func_done(() => {
       assert_equals(location.hash, "");
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-replaceState.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-replaceState.html
index 444116a..d18feb2b 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-replaceState.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-history-replaceState.html
@@ -17,7 +17,8 @@
     assert_equals(e.destination.id, "");
     assert_equals(e.destination.index, -1);
     assert_equals(e.formData, null);
-    assert_equals(e.sourceElement, null);
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, null);
     e.preventDefault();
     t.step_timeout(t.step_func_done(() => {
       assert_equals(location.hash, "");
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-iframe-location.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-iframe-location.html
index 1bd7918..c00a6e0 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-iframe-location.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-iframe-location.html
@@ -21,7 +21,8 @@
       assert_equals(e.destination.id, "");
       assert_equals(e.destination.index, -1);
       assert_equals(e.formData, null);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
       e.preventDefault();
       t.step_timeout(t.step_func_done(() => assert_equals(location.hash, "")), 0);
     });
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-location.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-location.html
index a0ed4dc..b1ce204a 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-location.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-location.html
@@ -17,7 +17,8 @@
     assert_equals(e.destination.id, "");
     assert_equals(e.destination.index, -1);
     assert_equals(e.formData, null);
-    assert_equals(e.sourceElement, null);
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, null);
   });
   location.href = "#1";
 }, "location API fires navigate event");
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-meta-refresh.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-meta-refresh.html
index d4d5b1c..f64484c3 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-meta-refresh.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-meta-refresh.html
@@ -20,7 +20,8 @@
       assert_equals(e.destination.id, "");
       assert_equals(e.destination.index, -1);
       assert_equals(e.formData, null);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
       e.preventDefault();
     });
   });
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-back-cross-document.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-back-cross-document.html
index 0840515..de87fbbb 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-back-cross-document.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-back-cross-document.html
@@ -25,7 +25,8 @@
         assert_equals(e.destination.index, 0);
         assert_equals(e.formData, null);
         assert_equals(e.info, "hi");
-        assert_equals(e.sourceElement, null);
+        // NavigateEvent sourceElement is still in development, so test whether it is available.
+        if ("sourceElement" in e) assert_equals(e.sourceElement, null);
       });
       i.contentWindow.onbeforeunload = () => beforeunload_called = true;
       assert_true(i.contentWindow.navigation.canGoBack);
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe.html
index 42c694e..3d810d2f 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe.html
@@ -27,7 +27,8 @@
     assert_equals(e.destination.index, 0);
     assert_equals(e.formData, null);
     assert_equals(e.info, "hi");
-    assert_equals(e.sourceElement, null);
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, null);
   }
   await i.contentWindow.navigation.back({ info: "hi" }).finished;
 }, "navigate event for navigation.back() - same-document in an iframe");
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-back-same-document.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-back-same-document.html
index b08bbfc..0f2faff 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-back-same-document.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-back-same-document.html
@@ -25,7 +25,8 @@
         assert_equals(e.formData, null);
         assert_equals(e.info, "hi");
         assert_not_equals(e.hasUAVisualTransition, undefined);
-        assert_equals(e.sourceElement, null);
+        // NavigateEvent sourceElement is still in development, so test whether it is available.
+        if ("sourceElement" in e) assert_equals(e.sourceElement, null);
       });
       assert_true(navigation.canGoBack);
       navigation.back({ info: "hi" });
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-navigate.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-navigate.html
index c56af1b..5dd1892 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-navigate.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-navigation-navigate.html
@@ -16,7 +16,8 @@
     assert_equals(e.destination.id, "");
     assert_equals(e.destination.index, -1);
     assert_equals(e.formData, null);
-    assert_equals(e.sourceElement, null);
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, null);
   });
   navigation.navigate("#foo");
 }, "navigate event for navigation.navigate()");
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-svg-anchor-fragment.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-svg-anchor-fragment.html
index c6d210cc..647496f 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-svg-anchor-fragment.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-svg-anchor-fragment.html
@@ -17,7 +17,8 @@
     assert_equals(e.destination.key, "");
     assert_equals(e.destination.id, "");
     assert_equals(e.destination.index, -1);
-    assert_equals(e.sourceElement, document.getElementById("a"));
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, document.getElementById("a"));
     e.preventDefault();
     t.step_timeout(t.step_func_done(() => assert_equals(location.hash, "")), 0);
   });
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-to-srcdoc.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-to-srcdoc.html
index ea5c3f9..bb598d8 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-to-srcdoc.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-to-srcdoc.html
@@ -21,7 +21,8 @@
       assert_equals(e.destination.id, "");
       assert_equals(e.destination.index, -1);
       assert_equals(e.formData, null);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
       e.preventDefault();
 
       // Make sure it doesn't navigate anyway.
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-window-open-self.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-window-open-self.html
index 4e569b6d..1ef65ed 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-window-open-self.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-window-open-self.html
@@ -16,7 +16,8 @@
     assert_equals(e.destination.id, "");
     assert_equals(e.destination.index, -1);
     assert_equals(e.formData, null);
-    assert_equals(e.sourceElement, null);
+    // NavigateEvent sourceElement is still in development, so test whether it is available.
+    if ("sourceElement" in e) assert_equals(e.sourceElement, null);
     e.preventDefault();
   });
   window.onload = t.step_func(() => window.open("#1", "_self"));
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-window-open.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-window-open.html
index 42828308..13cdefb5 100644
--- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-window-open.html
+++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/navigate-window-open.html
@@ -21,7 +21,8 @@
       assert_equals(e.destination.id, "");
       assert_equals(e.destination.index, -1);
       assert_equals(e.formData, null);
-      assert_equals(e.sourceElement, null);
+      // NavigateEvent sourceElement is still in development, so test whether it is available.
+      if ("sourceElement" in e) assert_equals(e.sourceElement, null);
       e.preventDefault();
     });
 
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/RTCPeerConnection-createAnswer.html b/third_party/blink/web_tests/external/wpt/webrtc/RTCPeerConnection-createAnswer.html
index 1970db0..7e31dda6 100644
--- a/third_party/blink/web_tests/external/wpt/webrtc/RTCPeerConnection-createAnswer.html
+++ b/third_party/blink/web_tests/external/wpt/webrtc/RTCPeerConnection-createAnswer.html
@@ -18,14 +18,14 @@
   const pc = new RTCPeerConnection();
   t.add_cleanup(() => pc.close());
 
-  const offer = await generateVideoReceiveOnlyOffer(pc);
+  const offer = await pc.createOffer();
   await pc.setRemoteDescription(offer);
   const answer = await pc.createAnswer();
   assert_equals(typeof answer, 'object',
-    'Expect answer to be plain object dictionary RTCSessionDescriptionInit');
+    'Expect answer to be plain object (dictionary RTCSessionDescriptionInit)');
   assert_false(answer instanceof RTCSessionDescription,
     'Expect answer to not be instance of RTCSessionDescription');
-}, 'createAnswer() after setting remote description should succeed');
+}, 'createAnswer() returns RTCSessionDescriptionInit');
 
 promise_test(async t => {
   const pc = new RTCPeerConnection();
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/RTCPeerConnection-createOffer.html b/third_party/blink/web_tests/external/wpt/webrtc/RTCPeerConnection-createOffer.html
index 7287980a..4eabdff 100644
--- a/third_party/blink/web_tests/external/wpt/webrtc/RTCPeerConnection-createOffer.html
+++ b/third_party/blink/web_tests/external/wpt/webrtc/RTCPeerConnection-createOffer.html
@@ -25,20 +25,17 @@
    *        with its type member initialized to the string "offer" and its sdp member
    *        initialized to sdpString.
    */
-  promise_test(t => {
+  promise_test(async t => {
     const pc = new RTCPeerConnection()
-
     t.add_cleanup(() => pc.close());
 
-    return pc.createOffer()
-    .then(offer => {
-      assert_equals(typeof offer, 'object',
-        'Expect offer to be plain object dictionary RTCSessionDescriptionInit');
+    const offer = await pc.createOffer()
+    assert_equals(typeof offer, 'object',
+      'Expect offer to be plain object (dictionary RTCSessionDescriptionInit)');
 
-      assert_false(offer instanceof RTCSessionDescription,
-        'Expect offer to not be instance of RTCSessionDescription')
-    });
-  }, 'createOffer() with no argument from newly created RTCPeerConnection should succeed');
+    assert_false(offer instanceof RTCSessionDescription,
+      'Expect offer to not be instance of RTCSessionDescription')
+  }, 'createOffer() returns RTCSessionDescriptionInit');
 
   promise_test(t => {
     const pc = new RTCPeerConnection();
diff --git a/third_party/chromium-variations b/third_party/chromium-variations
index bc8a8fb5..56250b5 160000
--- a/third_party/chromium-variations
+++ b/third_party/chromium-variations
@@ -1 +1 @@
-Subproject commit bc8a8fb5eced2ed99c21b6c2ce00a35e15a73951
+Subproject commit 56250b5231b96ee47132babec86ee879031020ca
diff --git a/third_party/dawn b/third_party/dawn
index 944a68d..d3bebe6 160000
--- a/third_party/dawn
+++ b/third_party/dawn
@@ -1 +1 @@
-Subproject commit 944a68db9491cf72c2adac6a7d7282b5788fff67
+Subproject commit d3bebe6cf996439ed197d1c83e323baf8a9a7135
diff --git a/third_party/depot_tools b/third_party/depot_tools
index a60f90e..94f42f8 160000
--- a/third_party/depot_tools
+++ b/third_party/depot_tools
@@ -1 +1 @@
-Subproject commit a60f90e38e53738d3cf115cf0a6c75a0dfef0438
+Subproject commit 94f42f8fe3fe26b4f321b5b401ac14c065b665ad
diff --git a/third_party/devtools-frontend-internal b/third_party/devtools-frontend-internal
index a8efd4e7..b905e0b 160000
--- a/third_party/devtools-frontend-internal
+++ b/third_party/devtools-frontend-internal
@@ -1 +1 @@
-Subproject commit a8efd4e7a62d4e625a5c1e898fa603ac97865d5e
+Subproject commit b905e0bc023bf72eaccbb36735adc6873ceff486
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src
index e645aee..9cc73b5 160000
--- a/third_party/devtools-frontend/src
+++ b/third_party/devtools-frontend/src
@@ -1 +1 @@
-Subproject commit e645aee43e264f05a65f0c6c1ef1d54a0d2e5c3d
+Subproject commit 9cc73b5e0315d6e6bc9b7d47458b076c94ed1cc0
diff --git a/third_party/libc++abi/src b/third_party/libc++abi/src
index 09737b8..d17298a 160000
--- a/third_party/libc++abi/src
+++ b/third_party/libc++abi/src
@@ -1 +1 @@
-Subproject commit 09737b8e11281840ff019de74a9e576611167ed5
+Subproject commit d17298ab09b44bbc95e5e59c0f285145d0e5f8a7
diff --git a/third_party/skia b/third_party/skia
index 7f582d0..3bc48d1 160000
--- a/third_party/skia
+++ b/third_party/skia
@@ -1 +1 @@
-Subproject commit 7f582d05438519650eabfd08a925b94bfb274c6b
+Subproject commit 3bc48d128d4b081bb75a917c51c38f93d5a0e719
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
index 140bdd5..de43803 100644
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -17488,6 +17488,7 @@
   <int value="-1666519913"
       label="PrivateNetworkAccessPreflightShortTimeout:disabled"/>
   <int value="-1664795930" label="StorageAccessAPI:disabled"/>
+  <int value="-1664497967" label="SendPasswords:enabled"/>
   <int value="-1664290318" label="ComputePressure:enabled"/>
   <int value="-1663410466" label="top-document-isolation"/>
   <int value="-1663125441" label="OptInImeMenu:enabled"/>
@@ -18479,6 +18480,7 @@
   <int value="-1246477455" label="ClipboardUnsanitizedContent:disabled"/>
   <int value="-1245617305" label="NewProfilePicker:enabled"/>
   <int value="-1244772303" label="NtpRealboxMatchOmniboxTheme:enabled"/>
+  <int value="-1243870410" label="CrOSLateBootCrasProcessorWavDump:disabled"/>
   <int value="-1243694853" label="DeferAllScript:disabled"/>
   <int value="-1243449299" label="WebPrinting:disabled"/>
   <int value="-1241868814" label="WebAuthenticationPhoneSupport:disabled"/>
@@ -19516,6 +19518,7 @@
   <int value="-775952696" label="FeedStamp:enabled"/>
   <int value="-775361878" label="ReadAnythingImagesViaAlgorithm:disabled"/>
   <int value="-775321548" label="UseNewDoodleApi:disabled"/>
+  <int value="-774940991" label="CrOSLateBootCrasProcessorWavDump:enabled"/>
   <int value="-774513654" label="ShareSheetCustomActionsPolish:disabled"/>
   <int value="-773238824" label="AutoplayWhitelistSettings:disabled"/>
   <int value="-772787642" label="MediaAppCustomColors:disabled"/>
@@ -24814,6 +24817,7 @@
   <int value="1573860827" label="EnableImeSandbox:enabled"/>
   <int value="1575011129" label="WelcomeTour:disabled"/>
   <int value="1575978252" label="PasswordLeakDetection:enabled"/>
+  <int value="1575982187" label="SendPasswords:disabled"/>
   <int value="1576879780" label="StarterPackExpansion:enabled"/>
   <int value="1577205328"
       label="DataReductionProxyEnabledWithNetworkService:enabled"/>
diff --git a/tools/metrics/histograms/metadata/enterprise/histograms.xml b/tools/metrics/histograms/metadata/enterprise/histograms.xml
index 1dd2f59..b8d9c8b 100644
--- a/tools/metrics/histograms/metadata/enterprise/histograms.xml
+++ b/tools/metrics/histograms/metadata/enterprise/histograms.xml
@@ -201,7 +201,7 @@
 
 <histogram
     name="Enterprise.AutoEnrollmentBucketDownloadTime{EnterpriseAutoEnrollmentType}"
-    units="ms" expires_after="2024-06-01">
+    units="ms" expires_after="2024-12-01">
   <owner>sergiyb@chromium.org</owner>
   <owner>igorcov@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -218,7 +218,7 @@
 
 <histogram name="Enterprise.AutoEnrollmentControllerTimeout"
     enum="EnterpriseAutoEnrollmentControllerTimeoutReport"
-    expires_after="2024-09-01">
+    expires_after="2024-12-01">
   <owner>vsavu@google.com</owner>
   <owner>igorcov@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -229,7 +229,7 @@
 
 <histogram
     name="Enterprise.AutoEnrollmentHashDanceSuccessTime{EnterpriseAutoEnrollmentType}"
-    units="ms" expires_after="2024-06-30">
+    units="ms" expires_after="2024-12-01">
   <owner>sergiyb@chromium.org</owner>
   <owner>igorcov@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -243,7 +243,7 @@
 </histogram>
 
 <histogram name="Enterprise.AutoEnrollmentPrivateSetMembershipSuccessTime"
-    units="ms" expires_after="2024-09-01">
+    units="ms" expires_after="2024-12-01">
   <owner>sergiyb@google.com</owner>
   <owner>mpolzer@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -258,7 +258,7 @@
 
 <histogram
     name="Enterprise.AutoEnrollmentProtocolTime{EnterpriseAutoEnrollmentType}"
-    units="ms" expires_after="2024-06-30">
+    units="ms" expires_after="2024-12-01">
   <owner>sergiyb@chromium.org</owner>
   <owner>igorcov@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -275,7 +275,7 @@
 
 <histogram
     name="Enterprise.AutoEnrollmentPsmDmServerRequestStatus{EnterpriseAutoEnrollmentType}"
-    enum="EnterpriseDeviceManagementStatus" expires_after="2024-06-30">
+    enum="EnterpriseDeviceManagementStatus" expires_after="2024-12-01">
   <owner>sergiyb@chromium.org</owner>
   <owner>igorcov@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -294,7 +294,7 @@
 
 <histogram
     name="Enterprise.AutoEnrollmentPsmRequestNetworkErrorCode{EnterpriseAutoEnrollmentType}"
-    enum="NetErrorCodes" expires_after="2024-09-01">
+    enum="NetErrorCodes" expires_after="2024-12-01">
   <owner>sergiyb@chromium.org</owner>
   <owner>igorcov@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -313,7 +313,7 @@
 
 <histogram
     name="Enterprise.AutoEnrollmentPsmResult{EnterpriseAutoEnrollmentType}"
-    enum="PsmResult" expires_after="2024-09-01">
+    enum="PsmResult" expires_after="2024-12-01">
   <owner>sergiyb@chromium.org</owner>
   <owner>igorcov@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -350,7 +350,7 @@
 
 <histogram
     name="Enterprise.AutoEnrollmentRequestStatus{EnterpriseAutoEnrollmentType}"
-    enum="EnterpriseDeviceManagementStatus" expires_after="2024-09-01">
+    enum="EnterpriseDeviceManagementStatus" expires_after="2024-12-01">
   <owner>sergiyb@chromium.org</owner>
   <owner>igorcov@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -661,7 +661,7 @@
 </histogram>
 
 <histogram name="Enterprise.DeviceLocalAccountPolicyInvalidations2"
-    enum="EnterprisePolicyInvalidations" expires_after="2024-06-01">
+    enum="EnterprisePolicyInvalidations" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
@@ -676,7 +676,7 @@
 </histogram>
 
 <histogram name="Enterprise.DeviceLocalAccountPolicyRefresh3"
-    enum="EnterprisePolicyRefresh" expires_after="2024-06-01">
+    enum="EnterprisePolicyRefresh" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
@@ -711,7 +711,7 @@
 </histogram>
 
 <histogram name="Enterprise.DevicePolicyInvalidations2"
-    enum="EnterprisePolicyInvalidations" expires_after="2024-06-01">
+    enum="EnterprisePolicyInvalidations" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
@@ -727,7 +727,7 @@
 </histogram>
 
 <histogram name="Enterprise.DevicePolicyRefresh3"
-    enum="EnterprisePolicyRefresh" expires_after="2024-06-01">
+    enum="EnterprisePolicyRefresh" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
@@ -781,7 +781,7 @@
 
 <histogram
     name="Enterprise.DeviceRemoteCommand.Executed{Enterprise_RemoteCommandType}"
-    enum="RemoteCommandExecutionStatus" expires_after="2024-09-01">
+    enum="RemoteCommandExecutionStatus" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
@@ -811,7 +811,7 @@
 </histogram>
 
 <histogram name="Enterprise.DeviceRemoteCommand.Received"
-    enum="RemoteCommandReceivedStatus" expires_after="2024-09-01">
+    enum="RemoteCommandReceivedStatus" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
@@ -823,7 +823,7 @@
 </histogram>
 
 <histogram name="Enterprise.DeviceRemoteCommandInvalidations"
-    enum="EnterprisePolicyInvalidations" expires_after="2024-06-01">
+    enum="EnterprisePolicyInvalidations" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
@@ -840,7 +840,7 @@
 </histogram>
 
 <histogram name="Enterprise.DeviceSettings.MissingPolicyMitigated"
-    enum="BooleanSuccess" expires_after="2024-06-01">
+    enum="BooleanSuccess" expires_after="2024-12-01">
   <owner>rbock@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <owner>managed-devices@google.com</owner>
@@ -852,7 +852,7 @@
 </histogram>
 
 <histogram name="Enterprise.DeviceSettings.UpdatedStatus"
-    enum="DeviceSettingsStatus" expires_after="2024-06-01">
+    enum="DeviceSettingsStatus" expires_after="2024-12-01">
   <owner>rbock@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <owner>managed-devices@google.com</owner>
@@ -1853,7 +1853,7 @@
 </histogram>
 
 <histogram name="Enterprise.DMServerRequestSuccess{EnterpriseDMServerRequest}"
-    enum="EnterpriseDMServerRequestSuccess" expires_after="2024-09-01">
+    enum="EnterpriseDMServerRequestSuccess" expires_after="2024-12-01">
   <owner>rbock@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <owner>managed-devices@google.com</owner>
@@ -2001,7 +2001,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrolledDevicePolicyPresent" enum="Boolean"
-    expires_after="2024-09-01">
+    expires_after="2024-12-01">
   <owner>igorcov@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
@@ -2027,7 +2027,7 @@
 </histogram>
 
 <histogram name="Enterprise.Enrollment" enum="EnterpriseEnrollmentType"
-    expires_after="2024-09-01">
+    expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>sergiyb@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2037,7 +2037,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrollmentAttestationBased"
-    enum="EnterpriseEnrollmentType" expires_after="2024-09-01">
+    enum="EnterpriseEnrollmentType" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>sergiyb@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2051,7 +2051,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrollmentForced" enum="EnterpriseEnrollmentType"
-    expires_after="2024-06-30">
+    expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>sergiyb@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2061,7 +2061,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrollmentForcedAttestationBased"
-    enum="EnterpriseEnrollmentType" expires_after="2024-09-01">
+    enum="EnterpriseEnrollmentType" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>sergiyb@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2072,7 +2072,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrollmentForcedInitial"
-    enum="EnterpriseEnrollmentType" expires_after="2024-06-01">
+    enum="EnterpriseEnrollmentType" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>sergiyb@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2083,7 +2083,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrollmentForcedInitialAttestationBased"
-    enum="EnterpriseEnrollmentType" expires_after="2024-09-29">
+    enum="EnterpriseEnrollmentType" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>sergiyb@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2094,7 +2094,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrollmentForcedInitialManualFallback"
-    enum="EnterpriseEnrollmentType" expires_after="2024-08-11">
+    enum="EnterpriseEnrollmentType" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>sergiyb@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2105,7 +2105,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrollmentForcedManualFallback"
-    enum="EnterpriseEnrollmentType" expires_after="2024-09-22">
+    enum="EnterpriseEnrollmentType" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>sergiyb@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2141,7 +2141,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrollmentRecovery" enum="EnterpriseEnrollmentType"
-    expires_after="2024-06-01">
+    expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>sergiyb@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2153,7 +2153,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrollmentRollbackAttestation"
-    enum="EnterpriseEnrollmentType" expires_after="2024-06-01">
+    enum="EnterpriseEnrollmentType" expires_after="2024-12-01">
   <owner>crisguerrero@chromium.org</owner>
   <owner>mpolzer@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2166,7 +2166,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrollmentRollbackManualFallback"
-    enum="EnterpriseEnrollmentType" expires_after="2024-06-01">
+    enum="EnterpriseEnrollmentType" expires_after="2024-12-01">
   <owner>crisguerrero@chromium.org</owner>
   <owner>mpolzer@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2180,7 +2180,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrollmentTime.Cancel" units="ms"
-    expires_after="2024-06-01">
+    expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>sergiyb@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2190,7 +2190,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrollmentTime.Failure" units="ms"
-    expires_after="2024-10-06">
+    expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>sergiyb@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2200,7 +2200,7 @@
 </histogram>
 
 <histogram name="Enterprise.EnrollmentTime.Success" units="ms"
-    expires_after="2024-09-01">
+    expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>sergiyb@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2306,7 +2306,7 @@
 </histogram>
 
 <histogram name="Enterprise.InstallAttributes.ValidOnEnrolledDevice"
-    enum="Boolean" expires_after="2024-12-07">
+    enum="Boolean" expires_after="2024-12-01">
   <owner>igorcov@chromium.org</owner>
   <owner>emaxx@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2318,7 +2318,7 @@
 </histogram>
 
 <histogram name="Enterprise.InvalidDevicePolicyFilesStatus"
-    enum="InvalidDevicePolicyFilesStatus" expires_after="2024-09-01">
+    enum="InvalidDevicePolicyFilesStatus" expires_after="2024-12-01">
   <owner>emaxx@chromium.org</owner>
   <owner>igorcov@chromium.org</owner>
   <owner>vsavu@google.com</owner>
@@ -2330,7 +2330,7 @@
 </histogram>
 
 <histogram name="Enterprise.KeySignatureVerification"
-    enum="EnterpriseKeySignatureVerification" expires_after="2024-12-14">
+    enum="EnterpriseKeySignatureVerification" expires_after="2024-12-01">
   <owner>igorcov@chromium.org</owner>
   <owner>emaxx@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2536,7 +2536,7 @@
 </histogram>
 
 <histogram name="Enterprise.Policies" enum="EnterprisePolicies"
-    expires_after="2024-09-01">
+    expires_after="2024-12-01">
   <owner>vsavu@google.com</owner>
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2547,7 +2547,7 @@
 </histogram>
 
 <histogram name="Enterprise.Policies.Sources" enum="EnterprisePoliciesSources"
-    expires_after="2024-09-01">
+    expires_after="2024-12-01">
   <owner>zmin@chromium.org</owner>
   <owner>igorruvinov@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2561,7 +2561,7 @@
 </histogram>
 
 <histogram name="Enterprise.Policies.{PolicyLevel}" enum="EnterprisePolicies"
-    expires_after="2024-09-01">
+    expires_after="2024-12-01">
   <owner>zmin@chromium.org</owner>
   <owner>qiutanw@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2574,7 +2574,7 @@
 </histogram>
 
 <histogram name="Enterprise.PolicyInvalidations"
-    enum="EnterprisePolicyInvalidations" expires_after="2024-06-01">
+    enum="EnterprisePolicyInvalidations" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
@@ -2595,7 +2595,7 @@
 </histogram>
 
 <histogram name="Enterprise.PolicyRefresh2" enum="EnterprisePolicyRefresh"
-    expires_after="2024-06-01">
+    expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
@@ -2668,7 +2668,7 @@
 </histogram>
 
 <histogram name="Enterprise.PolicyUpdatePeriod.Device" units="days"
-    expires_after="2024-06-01">
+    expires_after="2024-12-01">
   <owner>rbock@google.com</owner>
   <owner>igorcov@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2688,7 +2688,7 @@
 </histogram>
 
 <histogram name="Enterprise.PolicyUpdatePeriod.User" units="days"
-    expires_after="2024-10-06">
+    expires_after="2024-12-01">
   <owner>rbock@google.com</owner>
   <owner>igorcov@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -2698,7 +2698,7 @@
 </histogram>
 
 <histogram name="Enterprise.PolicyUserVerification"
-    enum="EnterprisePolicyUserVerification" expires_after="2024-11-30">
+    enum="EnterprisePolicyUserVerification" expires_after="2024-12-01">
   <owner>poromov@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>Tracking the results of policy user verification.</summary>
@@ -3135,7 +3135,7 @@
 </histogram>
 
 <histogram name="Enterprise.UserPolicyChromeOS.InitialFetch.OAuth2Error"
-    enum="GoogleServiceAuthError" expires_after="2024-10-06">
+    enum="GoogleServiceAuthError" expires_after="2024-12-01">
   <owner>igorcov@chromium.org</owner>
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -3149,7 +3149,7 @@
 
 <histogram name="Enterprise.UserPolicyChromeOS.ReregistrationResult"
     enum="EnterpriseUserPolicyChromeOSReregistrationResult"
-    expires_after="2024-10-06">
+    expires_after="2024-12-01">
   <owner>hendrich@chromium.org</owner>
   <owner>rbock@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
@@ -3159,7 +3159,7 @@
 
 <histogram
     name="Enterprise.UserRemoteCommand.Executed{Enterprise_RemoteCommandType}"
-    enum="RemoteCommandExecutionStatus" expires_after="2024-06-01">
+    enum="RemoteCommandExecutionStatus" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
@@ -3175,7 +3175,7 @@
 </histogram>
 
 <histogram name="Enterprise.UserRemoteCommand.Received"
-    enum="RemoteCommandReceivedStatus" expires_after="2024-09-29">
+    enum="RemoteCommandReceivedStatus" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
@@ -3187,7 +3187,7 @@
 </histogram>
 
 <histogram name="Enterprise.UserRemoteCommandInvalidations"
-    enum="EnterprisePolicyInvalidations" expires_after="2024-06-01">
+    enum="EnterprisePolicyInvalidations" expires_after="2024-12-01">
   <owner>asumaneev@google.com</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
@@ -3310,7 +3310,7 @@
 </histogram>
 
 <histogram name="EnterpriseCheck.InvalidJsonPolicies" enum="EnterprisePolicies"
-    expires_after="2024-06-01">
+    expires_after="2024-12-01">
   <owner>olsen@chromium.org</owner>
   <owner>chromeos-commercial-remote-management@google.com</owner>
   <summary>
diff --git a/tools/metrics/histograms/metadata/families/enums.xml b/tools/metrics/histograms/metadata/families/enums.xml
index 11f2e937..ea6de1c7 100644
--- a/tools/metrics/histograms/metadata/families/enums.xml
+++ b/tools/metrics/histograms/metadata/families/enums.xml
@@ -268,15 +268,40 @@
   <int value="6" label="Requests Disabled"/>
 </enum>
 
+<!-- LINT.IfChange(SupervisedUserExtension2) -->
+
 <enum name="SupervisedUserExtension2">
   <summary>
     Tracks the state of a supervised user trying to install an extension.
   </summary>
-  <int value="0" label="Extension Approval Granted"/>
-  <int value="1" label="Permissions Increase Granted"/>
-  <int value="2" label="Extension Approval Removed"/>
+  <int value="0" label="Extension Approval Granted">
+    Incremented when the custodian explicitly grants approval to install an
+    extension for the first time. This is not output if the parent configuration
+    is set to not require approvals.
+  </int>
+  <int value="1" label="Permissions Increase Granted">
+    Incremeted when the custodian approves a newer version of an existing
+    extension with increased permissions.
+  </int>
+  <int value="2" label="Extension Approval Removed">
+    Incremented when the supervised user removes an extension (which removes the
+    previously granted custodian approval).
+  </int>
+  <int value="3" label="Extension Approval Granted by Default">
+    Incremented when the supervised user installs an extension, and the parent
+    configuration is set to not require approvals. The approval is therefore
+    granted implicitly.
+  </int>
+  <int value="4" label="Local Extension Approval Granted">
+    Incremented when an extension is marked as approved only on this device.
+    This happens on Windows/Mac/Linux when a supervised user had
+    previously-installed extensions, and the
+    SkipParentApprovalToInstallExtensions feature is first released.
+  </int>
 </enum>
 
+<!-- LINT.ThenChange(//chrome/browser/supervised_user/supervised_user_extensions_metrics_recorder.h:UmaExtensionState) -->
+
 <enum name="SupervisedUserExtensionEnablement">
   <summary>
     Tracks supervised user actions to enable or disable extensions.
diff --git a/tools/metrics/histograms/metadata/families/histograms.xml b/tools/metrics/histograms/metadata/families/histograms.xml
index 8ce57f1..6b5660d 100644
--- a/tools/metrics/histograms/metadata/families/histograms.xml
+++ b/tools/metrics/histograms/metadata/families/histograms.xml
@@ -658,13 +658,10 @@
   <owner>courtneywong@chromium.org</owner>
   <owner>agawronska@chromium.org</owner>
   <owner>cros-families-eng@google.com</owner>
+  <owner>chrome-kids-eng@google.com</owner>
   <summary>
     Records the progress of supervised users as they try to install Chrome
-    extensions. Extension Approval Granted count increments when the custodian
-    initially grants approval to install the extension. Permissions Increase
-    Granted count increments when the supervised user approves a newer version
-    of an existing extension with increased permissions. Extension Approval
-    Removed count increments when the supervised user removes an extension.
+    extensions. See the descriptions in the individual enum buckets.
   </summary>
 </histogram>
 
diff --git a/tools/metrics/histograms/metadata/media/histograms.xml b/tools/metrics/histograms/metadata/media/histograms.xml
index 396959b11..e620c02 100644
--- a/tools/metrics/histograms/metadata/media/histograms.xml
+++ b/tools/metrics/histograms/metadata/media/histograms.xml
@@ -6218,17 +6218,6 @@
   </summary>
 </histogram>
 
-<histogram name="Media.VideoCapture.Win.MappingAcquireMutexDelayMs" units="ms"
-    expires_after="2024-09-29">
-  <owner>ilnik@google.com</owner>
-  <owner>video-cmi-mpp@google.com</owner>
-  <summary>
-    Counts how long texture mutex acquisition took in ms during mapping process.
-    Recorded after each AcquireSync API call in the mapping subroutine.
-    Temporary metric, for debug purposes only.
-  </summary>
-</histogram>
-
 <histogram name="Media.VideoCapture.Windows.BackendUsed"
     enum="VideoCaptureWinBackendUsed" expires_after="M77">
   <owner>chfremer@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/password/histograms.xml b/tools/metrics/histograms/metadata/password/histograms.xml
index 2703e1c..cea8146 100644
--- a/tools/metrics/histograms/metadata/password/histograms.xml
+++ b/tools/metrics/histograms/metadata/password/histograms.xml
@@ -704,7 +704,7 @@
 </histogram>
 
 <histogram name="PasswordManager.AffiliationFetcher.FailedToParseResponse"
-    enum="Boolean" expires_after="M126">
+    enum="Boolean" expires_after="M130">
   <owner>vsemeniuk@google.com</owner>
   <owner>vasilii@chromium.org</owner>
   <summary>
@@ -3620,6 +3620,17 @@
   </summary>
 </histogram>
 
+<histogram name="PasswordManager.TimesReceivedFillDataForForm" units="count"
+    expires_after="2024-11-01">
+  <owner>kazinova@google.com</owner>
+  <owner>vasilii@chromium.org</owner>
+  <summary>
+    How many times the browser sent fill data for the given form to the
+    renderer. Recorded only for forms, for which the data was sent at least
+    once. Recorded when the form dissapears (e.g. upon page navigation).
+  </summary>
+</histogram>
+
 <histogram name="PasswordManager.TouchToFill.CredentialIndex" units="index"
     expires_after="2024-09-22">
   <owner>ioanap@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/web_apk/histograms.xml b/tools/metrics/histograms/metadata/web_apk/histograms.xml
index ebdc24f..54f3fb3 100644
--- a/tools/metrics/histograms/metadata/web_apk/histograms.xml
+++ b/tools/metrics/histograms/metadata/web_apk/histograms.xml
@@ -304,7 +304,7 @@
   <summary>
     Records which app type the Universal Install dialog was shown. Recorded once
     per dialog shown, after we've figured out which type app it is. Note: In
-    versions prior to 124 this metric overcounted app types in scenarios where
+    versions prior to 125 this metric overcounted app types in scenarios where
     the dialog redirects to the install dialog (instead of showing) because we
     detect that only one action was meaningful to the user.
   </summary>
diff --git a/ui/ozone/platform/wayland/host/wayland_bubble.cc b/ui/ozone/platform/wayland/host/wayland_bubble.cc
index 6a52984..d05d80e 100644
--- a/ui/ozone/platform/wayland/host/wayland_bubble.cc
+++ b/ui/ozone/platform/wayland/host/wayland_bubble.cc
@@ -10,6 +10,7 @@
 #include "ui/ozone/platform/wayland/host/wayland_connection.h"
 #include "ui/ozone/platform/wayland/host/wayland_data_drag_controller.h"
 #include "ui/ozone/platform/wayland/host/wayland_window_manager.h"
+#include "ui/ozone/platform/wayland/host/wayland_zaura_shell.h"
 #include "ui/platform_window/platform_window_init_properties.h"
 
 namespace ui {
@@ -44,6 +45,9 @@
   }
 
   WaylandWindow::Hide();
+  if (root_surface()) {
+    root_surface()->ResetZAuraSurface();
+  }
 
   Deactivate();
 
@@ -92,6 +96,30 @@
   WaylandWindow::Deactivate();
 }
 
+void WaylandBubble::ShowTooltip(const std::u16string& text,
+                                const gfx::Point& position,
+                                const PlatformWindowTooltipTrigger trigger,
+                                const base::TimeDelta show_delay,
+                                const base::TimeDelta hide_delay) {
+  auto* zaura_surface = GetZAuraSurface();
+  const auto zaura_shell_trigger =
+      trigger == PlatformWindowTooltipTrigger::kCursor
+          ? ZAURA_SURFACE_TOOLTIP_TRIGGER_CURSOR
+          : ZAURA_SURFACE_TOOLTIP_TRIGGER_KEYBOARD;
+  if (zaura_surface &&
+      zaura_surface->ShowTooltip(text, position, zaura_shell_trigger,
+                                 show_delay, hide_delay)) {
+    connection()->Flush();
+  }
+}
+
+void WaylandBubble::HideTooltip() {
+  auto* zaura_surface = GetZAuraSurface();
+  if (zaura_surface && zaura_surface->HideTooltip()) {
+    connection()->Flush();
+  }
+}
+
 void WaylandBubble::UpdateWindowScale(bool update_bounds) {
   WaylandWindow::UpdateWindowScale(update_bounds);
   if (subsurface_) {
@@ -134,6 +162,10 @@
       root_surface()->CreateSubsurface(parent_window()->root_surface());
   DCHECK(subsurface_);
 
+  if (auto* zaura_surface = root_surface()->CreateZAuraSurface()) {
+    zaura_surface->set_delegate(AsWeakPtr());
+  }
+
   SetSubsurfacePosition();
 
   // The associaded widget of this platform_window has a ui::Compositor and
diff --git a/ui/ozone/platform/wayland/host/wayland_bubble.h b/ui/ozone/platform/wayland/host/wayland_bubble.h
index e91a5e2..f185be42 100644
--- a/ui/ozone/platform/wayland/host/wayland_bubble.h
+++ b/ui/ozone/platform/wayland/host/wayland_bubble.h
@@ -31,6 +31,12 @@
   void SetInputRegion(std::optional<std::vector<gfx::Rect>> region_px) override;
   void Activate() override;
   void Deactivate() override;
+  void ShowTooltip(const std::u16string& text,
+                   const gfx::Point& position,
+                   const PlatformWindowTooltipTrigger trigger,
+                   const base::TimeDelta show_delay,
+                   const base::TimeDelta hide_delay) override;
+  void HideTooltip() override;
 
   // WaylandWindow overrides:
   void UpdateWindowScale(bool update_bounds) override;
diff --git a/v8 b/v8
index e6d52a0..c61acc7 160000
--- a/v8
+++ b/v8
@@ -1 +1 @@
-Subproject commit e6d52a000f69b64a37d1d025c90a1dfa5d57330f
+Subproject commit c61acc78d87d6796b8555c28ee5026281f543073