Skip to content

Commit

Permalink
Remove Brave Ads creative instance per hour frequency cap for New Tab…
Browse files Browse the repository at this point in the history
… Page ads
  • Loading branch information
tmancey committed Aug 19, 2022
1 parent c6891c5 commit 626f79a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "bat/ads/internal/ads/serving/eligible_ads/exclusion_rules/marked_as_inappropriate_exclusion_rule.h"
#include "bat/ads/internal/ads/serving/eligible_ads/exclusion_rules/marked_to_no_longer_receive_exclusion_rule.h"
#include "bat/ads/internal/ads/serving/eligible_ads/exclusion_rules/per_day_exclusion_rule.h"
#include "bat/ads/internal/ads/serving/eligible_ads/exclusion_rules/per_hour_exclusion_rule.h"
#include "bat/ads/internal/ads/serving/eligible_ads/exclusion_rules/per_month_exclusion_rule.h"
#include "bat/ads/internal/ads/serving/eligible_ads/exclusion_rules/per_week_exclusion_rule.h"
#include "bat/ads/internal/ads/serving/eligible_ads/exclusion_rules/split_test_exclusion_rule.h"
Expand Down Expand Up @@ -87,9 +86,6 @@ ExclusionRulesBase::ExclusionRulesBase(

daypart_exclusion_rule_ = std::make_unique<DaypartExclusionRule>();
exclusion_rules_.push_back(daypart_exclusion_rule_.get());

per_hour_exclusion_rule_ = std::make_unique<PerHourExclusionRule>(ad_events);
exclusion_rules_.push_back(per_hour_exclusion_rule_.get());
}

ExclusionRulesBase::~ExclusionRulesBase() = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class DislikeExclusionRule;
class MarkedAsInappropriateExclusionRule;
class MarkedToNoLongerReceiveExclusionRule;
class PerDayExclusionRule;
class PerHourExclusionRule;
class PerMonthExclusionRule;
class PerWeekExclusionRule;
class SplitTestExclusionRule;
Expand Down Expand Up @@ -77,7 +76,6 @@ class ExclusionRulesBase {
std::unique_ptr<MarkedToNoLongerReceiveExclusionRule>
marked_to_no_longer_receive_exclusion_rule_;
std::unique_ptr<PerDayExclusionRule> per_day_exclusion_rule_;
std::unique_ptr<PerHourExclusionRule> per_hour_exclusion_rule_;
std::unique_ptr<PerMonthExclusionRule> per_month_exclusion_rule_;
std::unique_ptr<PerWeekExclusionRule> per_week_exclusion_rule_;
std::unique_ptr<SplitTestExclusionRule> split_test_exclusion_rule_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "bat/ads/internal/ads/serving/eligible_ads/exclusion_rules/inline_content_ads/inline_content_ad_exclusion_rules.h"

#include "bat/ads/internal/ads/serving/eligible_ads/exclusion_rules/per_hour_exclusion_rule.h"
#include "bat/ads/internal/geographic/subdivision/subdivision_targeting.h"
#include "bat/ads/internal/resources/behavioral/anti_targeting/anti_targeting_resource.h"

Expand All @@ -19,7 +20,10 @@ ExclusionRules::ExclusionRules(
: ExclusionRulesBase(ad_events,
subdivision_targeting,
anti_targeting_resource,
browsing_history) {}
browsing_history) {
per_hour_exclusion_rule_ = std::make_unique<PerHourExclusionRule>(ad_events);
exclusion_rules_.push_back(per_hour_exclusion_rule_.get());
}

ExclusionRules::~ExclusionRules() = default;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#ifndef BRAVE_VENDOR_BAT_NATIVE_ADS_SRC_BAT_ADS_INTERNAL_ADS_SERVING_ELIGIBLE_ADS_EXCLUSION_RULES_INLINE_CONTENT_ADS_INLINE_CONTENT_AD_EXCLUSION_RULES_H_
#define BRAVE_VENDOR_BAT_NATIVE_ADS_SRC_BAT_ADS_INTERNAL_ADS_SERVING_ELIGIBLE_ADS_EXCLUSION_RULES_INLINE_CONTENT_ADS_INLINE_CONTENT_AD_EXCLUSION_RULES_H_

#include <memory>

#include "bat/ads/internal/ads/serving/eligible_ads/exclusion_rules/exclusion_rules_base.h"

namespace ads {
Expand All @@ -18,6 +20,8 @@ namespace resource {
class AntiTargeting;
} // namespace resource

class PerHourExclusionRule;

namespace inline_content_ads {

class ExclusionRules final : public ExclusionRulesBase {
Expand All @@ -31,6 +35,8 @@ class ExclusionRules final : public ExclusionRulesBase {
private:
ExclusionRules(const ExclusionRules&) = delete;
ExclusionRules& operator=(const ExclusionRules&) = delete;

std::unique_ptr<PerHourExclusionRule> per_hour_exclusion_rule_;
};

} // namespace inline_content_ads
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "bat/ads/internal/ads/serving/eligible_ads/exclusion_rules/notification_ads/notification_ad_exclusion_rules.h"

#include "bat/ads/internal/ads/serving/eligible_ads/exclusion_rules/dismissed_exclusion_rule.h"
#include "bat/ads/internal/ads/serving/eligible_ads/exclusion_rules/per_hour_exclusion_rule.h"
#include "bat/ads/internal/geographic/subdivision/subdivision_targeting.h"
#include "bat/ads/internal/resources/behavioral/anti_targeting/anti_targeting_resource.h"

Expand All @@ -24,6 +25,9 @@ ExclusionRules::ExclusionRules(
dismissed_exclusion_rule_ =
std::make_unique<DismissedExclusionRule>(ad_events);
exclusion_rules_.push_back(dismissed_exclusion_rule_.get());

per_hour_exclusion_rule_ = std::make_unique<PerHourExclusionRule>(ad_events);
exclusion_rules_.push_back(per_hour_exclusion_rule_.get());
}

ExclusionRules::~ExclusionRules() = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class AntiTargeting;
} // namespace resource

class DismissedExclusionRule;
class PerHourExclusionRule;

namespace notification_ads {

Expand All @@ -37,6 +38,7 @@ class ExclusionRules final : public ExclusionRulesBase {
ExclusionRules& operator=(const ExclusionRules&) = delete;

std::unique_ptr<DismissedExclusionRule> dismissed_exclusion_rule_;
std::unique_ptr<PerHourExclusionRule> per_hour_exclusion_rule_;
};

} // namespace notification_ads
Expand Down

0 comments on commit 626f79a

Please sign in to comment.