-
Notifications
You must be signed in to change notification settings - Fork 879
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
Anti-Targeting for Brave Ads #8167
Conversation
29b7e60
to
2cef13c
Compare
2cef13c
to
a98c68a
Compare
e1a66fe
to
f099e14
Compare
a2c15fd
to
bff6d16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stubs look good, implementation of the callback just needs fixing but other than that 👍
08a7e7f
to
e32906e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iOS++
8031132
to
ca67885
Compare
# Remove when https://github.com/brave/brave-browser/issues/10639 is resolved | ||
check_includes = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should have been removed @moritzhaller
@@ -94,6 +97,7 @@ class BatAdsAdNotificationPacingTest : public UnitTestBase { | |||
std::unique_ptr<AdTargeting> ad_targeting_; | |||
std::unique_ptr<ad_targeting::geographic::SubdivisionTargeting> | |||
subdivision_targeting_; | |||
std::unique_ptr<resource::AntiTargeting> anti_targeting_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: anti_targeting_resource_
@@ -33,7 +38,8 @@ class AdServing { | |||
public: | |||
AdServing( | |||
AdTargeting* ad_targeting, | |||
ad_targeting::geographic::SubdivisionTargeting* subdivision_targeting); | |||
ad_targeting::geographic::SubdivisionTargeting* subdivision_targeting, | |||
resource::AntiTargeting* anti_targeting); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: anti_targeting_resource
@@ -97,6 +106,8 @@ class AdServing { | |||
|
|||
ad_targeting::geographic::SubdivisionTargeting* | |||
subdivision_targeting_; // NOT OWNED | |||
|
|||
resource::AntiTargeting* anti_targeting_; // NOT OWNED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: anti_targeting_resource_
return; | ||
} | ||
|
||
BLOG(1, "Successfully loaded resource " << kResourceId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Successfully loaded anti-targeting resource ... (same for other logs, check if console logs contain filename and if so we then do not need the verbosity)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file name shows in log, so keeping as is for now
|
||
AntiTargetingInfo anti_targeting = anti_targeting_->get(); | ||
const auto iter = anti_targeting.sites.find(ad.creative_set_id); | ||
// Always respect if creative set has no anti-targeting sites |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: move to inside if
statement
vendor/brave-ios/Ads/BATBraveAds.mm
Outdated
- (void)getBrowsingHistory:(const int)max_count | ||
forDays:(const int)days_ago | ||
callback:(ads::GetBrowsingHistoryCallback)callback { | ||
// Not implemented for iOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: 'To be implementedwith a link to a
brave-ios` issue so that the work can be prioritized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM++
ca67885
to
564a3e5
Compare
564a3e5
to
75e7d7f
Compare
Resolves brave/brave-browser#14224
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Detailed test plan https://github.com/brave/internal/issues/767
mkdhnfmjhklfnamlheoliekgeohamoig
is added to the staging component for the respective country (matching the test machine system's settings) and the componentsmodels.json
has been updated.[87942:775:0401/172513.733280:VERBOSE2:exclusion_rule_util.h(26)] creativeSetId 5bdeab83-048f-48a7-9602-a1092ded123c excluded as user has previously visited an anti-targeting site
Example anti-targeting test lists