Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autofill related crash due to our disabling of optimization hints #20415

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

emerick
Copy link
Contributor

@emerick emerick commented Oct 5, 2023

Resolves brave/brave-browser#33426

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run lint, npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

@emerick emerick requested a review from a team as a code owner October 5, 2023 13:44
@emerick emerick self-assigned this Oct 5, 2023
@@ -34,6 +34,10 @@ class BraveChromeAutofillClient : public ChromeAutofillClient {
public:
using ChromeAutofillClient::ChromeAutofillClient;

AutofillOptimizationGuide* GetAutofillOptimizationGuide() const override {
return nullptr;
Copy link
Collaborator

@mkarolin mkarolin Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking in case we ever decide to flip the feature back on and not necessarily remember about this override it might be good to make this depend on the feature, same as in https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/optimization_guide/optimization_guide_keyed_service_factory.cc;l=19, like

#include "components/optimization_guide/core/optimization_guide_features.h"

AutofillOptimizationGuide* GetAutofillOptimizationGuide() const override {
  if (optimization_guide::features::IsOptimizationHintsEnabled()) {
    return ChromeAutofillClient::GetAutofillOptimizationGuide();
  }
  return nullptr;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense, fixed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great call, @mkarolin 😄

@emerick emerick force-pushed the cr118-followup-fix-autofill-client-crash branch from 6760d9e to 9c1cfea Compare October 5, 2023 14:02
Copy link
Collaborator

@mkarolin mkarolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++! 😄

@emerick emerick merged commit 3e93095 into master Oct 5, 2023
@emerick emerick deleted the cr118-followup-fix-autofill-client-crash branch October 5, 2023 18:07
@emerick emerick added this to the 1.61.x - Nightly milestone Oct 5, 2023
brave-builds added a commit that referenced this pull request Oct 5, 2023
brave-builds added a commit that referenced this pull request Oct 5, 2023
@MadhaviSeelam
Copy link

Verification PASSED using

Brave | 1.61.3 Chromium: 118.0.5993.54 (Official Build) nightly (64-bit)
-- | --
Revision | 65de72604895b354f3a9c4ad818b993028096814
OS | Windows 11 Version 22H2 (Build 22621.2283)

Verified using the original STR from brave/brave-browser#33426 (comment)

Confirmed no crash occurred and Send a Wire or ACH transfer page is shown as expected

image

kjozwiak pushed a commit that referenced this pull request Oct 6, 2023
… (uplift to 1.59.x) (#20422)

Uplift of #20415 (squashed) to release
kjozwiak pushed a commit that referenced this pull request Oct 6, 2023
… (uplift to 1.60.x) (#20421)

Uplift of #20415 (squashed) to beta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Brave crashed when clicked Add account/recipient link in Bank of America site
4 participants