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 BraveBrowserView::OnThemeChanged is called infinitely #924

Merged
merged 1 commit into from
Nov 22, 2018

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Nov 18, 2018

Fix brave/brave-browser#1643
Fix brave/brave-browser#1791

In the below situation, BraveBrowserView::OnThemeChanged() is called
infinitely on linux.

  • Open normal window and private window and change theme
  • Open normal window and guest/tor window

This might be the reason of unresponsiveness of windows icon and
cpu spike.

Instead of notifying to native theme observer in BraveThemeService::OnThemeChanged(), BraveThemeService::OnPreferenceChanged() would be much better to prevent infinite OnThemeChanged() calling.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Verified that these changes build without errors on
    • Windows
    • macOS
    • Linux
  • Verified that these changes pass automated tests (npm test brave_unit_tests && npm test brave_browser_tests) on
    • Windows
    • macOS
    • Linux
  • Ran git rebase master (if needed).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Yes or QA/No) to include the closed issue in milestone

Test Plan:

yarn test brave_browser_tests --filter=BraveThemeServiceTest.NativeThemeObserverTest

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

In the below situation, BraveBrowserView::OnThemeChanged() is called
infinitely on linux.
* Open normal window and private window and change theme
* Open normal window and guest/tor window

This might be the reason of unresponsiveness of windows icon and
cpu spike.
@simonhong simonhong self-assigned this Nov 18, 2018
@simonhong
Copy link
Member Author

simonhong commented Nov 18, 2018

Maybe I couldn't response review comment because of holidays.
So, I don't mind whoever modifying instead of me.(Or I'll follow up when I'm available)

@bbondy
Copy link
Member

bbondy commented Nov 20, 2018

@petemill do you have any other review comments on this?

@petemill petemill merged commit d1787ab into master Nov 22, 2018
@petemill petemill deleted the linux_freezing branch November 22, 2018 04:37
@bbondy
Copy link
Member

bbondy commented Nov 22, 2018

Please indicate merge flag

@kjozwiak
Copy link
Member

kjozwiak commented Nov 26, 2018

Approving uplift to 0.57.x after deliberating with @rebron 👍

@simonhong next time when requesting approval to the beta channel, please make sure you merge the changes into the dev channel from master. As @bbondy mentioned, please also add the merged flags.

bbondy pushed a commit that referenced this pull request Nov 27, 2018
Fix BraveBrowserView::OnThemeChanged is called infinitely
bbondy pushed a commit that referenced this pull request Nov 27, 2018
Fix BraveBrowserView::OnThemeChanged is called infinitely
@bbondy
Copy link
Member

bbondy commented Nov 27, 2018

master: d1787ab
0.58.x: 82b9d8e
0.57.x: 26b4695

bbondy added a commit that referenced this pull request Nov 30, 2018
bbondy [4:58 PM]
trying to get tests working on 0.58.x and noticed this is failing for tests:
#924

I noticed this is in 0.57.x and 0.58.x but it needs a dependency for
which was added with this f929cbc
now I'm just going to add the dep for now ,but I want to make sure this is not a problem
and check in case we needed the other PR in those branches too
or to revert 924 from them

petemill [5:04 PM]
hmm good spot. I don't think there is anything else that makes 924 depend on 774. We probably don't need 774 on 0.57 as it's not urgent. I don't know how urgent 924 is but it sounds like it could be if it was causing an infinite loop. So safest is probably to add the dep.

bbondy [5:06 PM]
great thx for confirming, added the dep
bbondy added a commit that referenced this pull request Dec 1, 2018
bbondy [4:58 PM]
trying to get tests working on 0.58.x and noticed this is failing for tests:
#924

I noticed this is in 0.57.x and 0.58.x but it needs a dependency for
which was added with this f929cbc
now I'm just going to add the dep for now ,but I want to make sure this is not a problem
and check in case we needed the other PR in those branches too
or to revert 924 from them

petemill [5:04 PM]
hmm good spot. I don't think there is anything else that makes 924 depend on 774. We probably don't need 774 on 0.57 as it's not urgent. I don't know how urgent 924 is but it sounds like it could be if it was causing an infinite loop. So safest is probably to add the dep.

bbondy [5:06 PM]
great thx for confirming, added the dep
@bbondy bbondy added this to the 0.57.x - Release milestone Jan 14, 2019
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.

Tor window freezes browser Ubuntu 16.04 Guest/Tor window cannot be closed via browser action button
4 participants