Skip to content

Commit

Permalink
Decouple Brave Ads serving pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
tmancey committed Oct 12, 2021
1 parent b1eda91 commit 88e110f
Show file tree
Hide file tree
Showing 105 changed files with 2,683 additions and 2,115 deletions.
10 changes: 7 additions & 3 deletions components/brave_ads/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ source_set("brave_ads_unit_tests") {
"//brave/vendor/bat-native-ads/src/bat/ads/internal/bundle/creative_ad_notification_unittest_util.h",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/bundle/creative_ad_unittest_util.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/bundle/creative_ad_unittest_util.h",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/bundle/creative_inline_content_ad_unittest_util.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/bundle/creative_inline_content_ad_unittest_util.h",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/catalog/catalog_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/catalog/catalog_util_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/container_util_unittest.cc",
Expand All @@ -81,13 +83,15 @@ source_set("brave_ads_unit_tests") {
"//brave/vendor/bat-native-ads/src/bat/ads/internal/database/tables/dayparts_database_table_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/database/tables/geo_targets_database_table_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/database/tables/segments_database_table_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_issue_17199_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_v1_issue_17199_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_v1_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_v2_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/eligible_ads/eligible_ads_features_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/eligible_ads/eligible_ads_features_util_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/eligible_ads/eligible_ads_predictor_util_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/eligible_ads/eligible_ads_util_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_v1_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_v2_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/eligible_ads/sample_ads_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/features/ad_rewards/ad_rewards_features_unittest.cc",
"//brave/vendor/bat-native-ads/src/bat/ads/internal/features/ad_serving/ad_serving_features_unittest.cc",
Expand Down
20 changes: 16 additions & 4 deletions vendor/bat-native-ads/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,15 @@ source_set("ads") {
"src/bat/ads/internal/database/tables/geo_targets_database_table.h",
"src/bat/ads/internal/database/tables/segments_database_table.cc",
"src/bat/ads/internal/database/tables/segments_database_table.h",
"src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications.cc",
"src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications.h",
"src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_aliases.h",
"src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_base.cc",
"src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_base.h",
"src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_factory.cc",
"src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_factory.h",
"src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_v1.cc",
"src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_v1.h",
"src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_v2.cc",
"src/bat/ads/internal/eligible_ads/ad_notifications/eligible_ad_notifications_v2.h",
"src/bat/ads/internal/eligible_ads/ad_predictor_info.cc",
"src/bat/ads/internal/eligible_ads/ad_predictor_info.h",
"src/bat/ads/internal/eligible_ads/eligible_ads_aliases.h",
Expand All @@ -503,9 +509,15 @@ source_set("ads") {
"src/bat/ads/internal/eligible_ads/eligible_ads_predictor_util.h",
"src/bat/ads/internal/eligible_ads/eligible_ads_util.h",
"src/bat/ads/internal/eligible_ads/eligible_ads_util_aliases.h",
"src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads.cc",
"src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads.h",
"src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_aliases.h",
"src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_base.cc",
"src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_base.h",
"src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_factory.cc",
"src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_factory.h",
"src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_v1.cc",
"src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_v1.h",
"src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_v2.cc",
"src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_v2.h",
"src/bat/ads/internal/eligible_ads/round_robin_ads.h",
"src/bat/ads/internal/eligible_ads/round_robin_advertisers.h",
"src/bat/ads/internal/eligible_ads/sample_ads.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace ads {

template <class T>
template <typename T>
class AdEvent {
public:
virtual ~AdEvent() = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ T PaceAds(const T& ads) {

T paced_ads = ads;

const auto iter = std::remove_if(
paced_ads.begin(), paced_ads.end(),
[&](const CreativeAdInfo& ad) { return ShouldPaceAd(ad); });
const auto iter = std::remove_if(paced_ads.begin(), paced_ads.end(),
[&](const CreativeAdInfo& creative_ad) {
return ShouldPaceAd(creative_ad);
});

paced_ads.erase(iter, paced_ads.end());

Expand Down
Loading

0 comments on commit 88e110f

Please sign in to comment.