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

Fixed shields v2 crash with multiple windows #12984

Merged
merged 1 commit into from
Apr 14, 2022
Merged

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Apr 12, 2022

fix brave/brave-browser#22224
fix brave/brave-browser#21575
fix brave/brave-browser#22031
fix brave/brave-browser#21934

ShieldsPanelDataHandler should keep observed data controller
instead of getting data controller from active web contents of current
active window because active window could be different on it's created
or destroyed.
Crash happened because ShieldsPanelDataHandler tried to remove itself
from wrong data controller due to above reason.

Resolves

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • 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, npm run lint, 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:

See the linked issue

@simonhong simonhong force-pushed the crash_shields_v2 branch 2 times, most recently from 47e40b3 to 0602c1f Compare April 12, 2022 23:27
@nullhook
Copy link
Contributor

this issue seems related: brave/brave-browser#22275

Copy link
Contributor

@nullhook nullhook left a comment

Choose a reason for hiding this comment

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

lgtm - other than the comment change

browser/ui/webui/brave_shields/shields_panel_ui.cc Outdated Show resolved Hide resolved
@simonhong simonhong force-pushed the crash_shields_v2 branch 2 times, most recently from 7e190a8 to a93666c Compare April 14, 2022 00:00
fix brave/brave-browser#22224

ShieldsPanelDataHandler should keep observed data controller
instead of getting data controller from active web contents of current
active window because active window could be different on it's created
or destroyed.
Crash happened because ShieldsPanelDataHandler tried to remove itself
from wrong data controller due to above reason.
@stephendonner
Copy link
Contributor

Verified PASSED using

Brave 1.39.61 Chromium: 100.0.4896.88 (Official Build) nightly (x86_64)
Revision 4450653bfa91182e85723d8f1dee64dd6ce40ed4-refs/branch-heads/4896@{#1086}
OS macOS Version 12.4 (Build 21F5048e)

Confirmed no more/new crashes when following my original steps + exploratory testing, too.

@stephendonner
Copy link
Contributor

Verified PASSED using

Brave 1.39.68 Chromium: 101.0.4951.34 (Official Build) nightly (x86_64)
Revision 8f93af5d759634c5256b65997dedd138ed60992f-refs/branch-heads/4951@{#710}
OS macOS Version 12.4 (Build 21F5048e)

Checked:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment