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 concurrency #1531

Merged
merged 2 commits into from
Feb 4, 2019
Merged

Fix concurrency #1531

merged 2 commits into from
Feb 4, 2019

Conversation

iefremov
Copy link
Contributor

@iefremov iefremov commented Jan 31, 2019

Submitter Checklist:

Fix brave/brave-browser#3176

  • 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:

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

@iefremov
Copy link
Contributor Author

please review per-commit, since I've run clang-format on changed files.

base::PostTaskWithTraits(
FROM_HERE, {BrowserThread::UI},
base::Bind(&BraveNetworkDelegateBase::GetReferralHeaders,
base::Bind(&BraveNetworkDelegateBase::InitPrefChangeRegistrarOnUI,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the problem here is that this really doesn't seem like the right place for this stuff in the first place. I think it should be in BraveReferralsService and it can provide a static method that can be accessed from the IO thread. Since this is local_state it isn't profile-specific so we can track it globally

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, this is exactly what I mentioned in the TODO comment. I propose to merge this until I refactor the whole thing globally.

Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry, missed that. I'm good with merging and follow-up refactor as well

Copy link
Member

@bbondy bbondy left a comment

Choose a reason for hiding this comment

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

I think this is ok for now but please post an issue for the refactor mentioned in the TODO.
CC @emerick to spot check.

@emerick
Copy link
Contributor

emerick commented Feb 1, 2019

@iefremov Looks good, we should flag this for QA to ensure that it doesn't affect referrals functionality. cc: @kjozwiak

@iefremov
Copy link
Contributor Author

iefremov commented Feb 4, 2019

Filed the follow-up brave/brave-browser#3206

@iefremov iefremov merged commit 3279b50 into master Feb 4, 2019
@iefremov iefremov deleted the fix_concurrency branch February 4, 2019 08:18
@NejcZdovc NejcZdovc added this to the 0.62.x - Nightly milestone Feb 4, 2019
@kjozwiak
Copy link
Member

kjozwiak commented Feb 5, 2019

@emerick for this specific PR, should QA basically go through referrals to make sure they're still working? Does this include QAing the pings or just making sure that the x-brave-partner headers are still working?

@emerick
Copy link
Contributor

emerick commented Feb 5, 2019

@kjozwiak Yeah, it's just making sure that X-Brave-Partner is being set as expected.

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.

Unsafe memory write in BraveNetworkDelegateBase
6 participants