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

Add support for regional Ad Block lists #119

Merged
merged 3 commits into from
Jun 4, 2018
Merged

Conversation

emerick
Copy link
Contributor

@emerick emerick commented May 30, 2018

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).
  • 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.

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

@emerick emerick self-assigned this May 30, 2018
@emerick emerick requested a review from bbondy May 30, 2018 18:07
@emerick
Copy link
Contributor Author

emerick commented May 30, 2018

@bbondy I'll switch from using ad_block_regional_updater_list.h and just retrieve the public key and component id from ad block's regions.h instead (just let me know if my approach in the current pull request I have open against ad-block is acceptable!) Figured I'd get this review in front of you now, though.

@emerick emerick changed the title WIP: Add support for regional Ad Block lists Add support for regional Ad Block lists Jun 2, 2018
@emerick
Copy link
Contributor Author

emerick commented Jun 4, 2018

@bbondy This one's ready for review again!

bbondy
bbondy previously approved these changes Jun 4, 2018
[locale](const FilterList& filter_list) {
return std::find_if(filter_list.langs.begin(),
filter_list.langs.end(),
[locale](const std::string& lang) {
Copy link
Member

Choose a reason for hiding this comment

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

I think you could capture locale by reference for the lambda here with [&locale]


void AdBlockRegionalService::Cleanup() {
AdBlockBaseService::Cleanup();
}
Copy link
Member

Choose a reason for hiding this comment

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

You can just remove the override completely here

}

AdBlockService::~AdBlockService() {
Cleanup();
}

void AdBlockService::Cleanup() {
ad_block_client_.reset();
AdBlockBaseService::Cleanup();
}
Copy link
Member

Choose a reason for hiding this comment

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

Ditto here, you can remove this Cleanup completely.

}

AdBlockRegionalService::~AdBlockRegionalService() {
Cleanup();
Copy link
Member

Choose a reason for hiding this comment

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

I think the base class will already pick this up, so no need to call Cleanup here.

g_ad_block_component_base64_public_key_),
ad_block_client_(new AdBlockClient()),
weak_factory_(this) {
AdBlockService::AdBlockService() {
}

AdBlockService::~AdBlockService() {
Cleanup();
Copy link
Member

Choose a reason for hiding this comment

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

I think the base class will already pick this up, so no need to call Cleanup here.

</script>

Ad banner:
<img id='adImage' src='/ad_fr.png'>
Copy link
Member

Choose a reason for hiding this comment

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

Just making sure the normal adblock will not pick this up as well. Pls verify if you didn't already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I verified that.

@emerick
Copy link
Contributor Author

emerick commented Jun 4, 2018

@bbondy Updated with code review feedback.

@emerick emerick merged commit 2242c6c into master Jun 4, 2018
@bsclifton bsclifton deleted the regional-ad-block branch June 18, 2018 06:28
NejcZdovc pushed a commit that referenced this pull request Dec 10, 2018
Fixes #118, order_by ordering
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.

2 participants