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

Remove Brave Ads page classification scores from locally persisted diagnostic log #6420

Merged
merged 1 commit into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions components/brave_ads/browser/ads_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -947,13 +947,7 @@ void AdsServiceImpl::OnClose(
const std::string& uuid,
const bool by_user,
base::OnceClosure completed_closure) {
if (StopNotificationTimeoutTimer(uuid)) {
if (by_user) {
VLOG(1) << "Cancelled timeout for ad notification with uuid " << uuid;
} else {
VLOG(1) << "Timed out ad notification with uuid " << uuid;
}
}
StopNotificationTimeoutTimer(uuid);

if (connected()) {
const ads::AdNotificationEventType event_type =
Expand Down
1 change: 0 additions & 1 deletion vendor/bat-native-ads/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ source_set("ads") {
"src/bat/ads/internal/privacy/unblinded_tokens/unblinded_token_info.h",
"src/bat/ads/internal/privacy/unblinded_tokens/unblinded_tokens.cc",
"src/bat/ads/internal/privacy/unblinded_tokens/unblinded_tokens.h",
"src/bat/ads/internal/reports/event_type_load_info.h",
"src/bat/ads/internal/reports/reports.cc",
"src/bat/ads/internal/reports/reports.h",
"src/bat/ads/internal/search_engine/search_provider_info.cc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

#include "bat/ads/internal/ad_events/ad_notification_event_clicked.h"

#include <string>

#include "bat/ads/ad_notification_info.h"
#include "bat/ads/confirmation_type.h"
#include "bat/ads/internal/ad_notifications/ad_notifications.h"
#include "bat/ads/internal/ads_impl.h"
#include "bat/ads/internal/confirmations/confirmations.h"
#include "bat/ads/internal/logging.h"
#include "bat/ads/internal/reports/reports.h"

namespace ads {

namespace {
const ConfirmationType kConfirmationType = ConfirmationType::kClicked;
} // namespace

AdNotificationEventClicked::AdNotificationEventClicked(
AdsImpl* ads)
: ads_(ads) {
Expand All @@ -26,17 +26,17 @@ AdNotificationEventClicked::AdNotificationEventClicked(
AdNotificationEventClicked::~AdNotificationEventClicked() = default;

void AdNotificationEventClicked::Trigger(
const AdNotificationInfo& info) {
ads_->get_ad_notifications()->Remove(info.uuid, true);
const AdNotificationInfo& ad_notification) {
BLOG(3, "Clicked ad notification with uuid " << ad_notification.uuid
<< " and " << ad_notification.creative_instance_id
<< " creative instance id");

Reports reports(ads_);
const std::string report = reports.GenerateAdNotificationEventReport(info,
AdNotificationEventType::kClicked);
BLOG(3, "Event log: " << report);
ads_->get_ad_notifications()->Remove(ad_notification.uuid,
/* should dismiss */ true);

ads_->get_confirmations()->ConfirmAd(info, ConfirmationType::kClicked);
ads_->AppendAdNotificationToHistory(ad_notification, kConfirmationType);

ads_->AppendAdNotificationToHistory(info, ConfirmationType::kClicked);
ads_->get_confirmations()->ConfirmAd(ad_notification, kConfirmationType);
}

} // namespace ads
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AdNotificationEventClicked : public AdEvent<AdNotificationInfo> {
~AdNotificationEventClicked() override;

void Trigger(
const AdNotificationInfo& info) override;
const AdNotificationInfo& ad_notification) override;

private:
AdsImpl* ads_; // NOT OWNED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

#include "bat/ads/internal/ad_events/ad_notification_event_dismissed.h"

#include <string>

#include "bat/ads/ad_notification_info.h"
#include "bat/ads/confirmation_type.h"
#include "bat/ads/internal/ad_notifications/ad_notifications.h"
#include "bat/ads/internal/ads_impl.h"
#include "bat/ads/internal/confirmations/confirmations.h"
#include "bat/ads/internal/logging.h"
#include "bat/ads/internal/reports/reports.h"

namespace ads {

namespace {
const ConfirmationType kConfirmationType = ConfirmationType::kDismissed;
} // namespace

AdNotificationEventDismissed::AdNotificationEventDismissed(
AdsImpl* ads)
: ads_(ads) {
Expand All @@ -26,17 +26,17 @@ AdNotificationEventDismissed::AdNotificationEventDismissed(
AdNotificationEventDismissed::~AdNotificationEventDismissed() = default;

void AdNotificationEventDismissed::Trigger(
const AdNotificationInfo& info) {
ads_->get_ad_notifications()->Remove(info.uuid, false);
const AdNotificationInfo& ad_notification) {
BLOG(3, "Dismissed ad notification with uuid " << ad_notification.uuid
<< " and " << ad_notification.creative_instance_id
<< " creative instance id");

Reports reports(ads_);
const std::string report = reports.GenerateAdNotificationEventReport(info,
AdNotificationEventType::kDismissed);
BLOG(3, "Event log: " << report);
ads_->get_ad_notifications()->Remove(ad_notification.uuid,
/* should dismiss */ false);

ads_->get_confirmations()->ConfirmAd(info, ConfirmationType::kDismissed);
ads_->AppendAdNotificationToHistory(ad_notification, kConfirmationType);

ads_->AppendAdNotificationToHistory(info, ConfirmationType::kDismissed);
ads_->get_confirmations()->ConfirmAd(ad_notification, kConfirmationType);
}

} // namespace ads
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AdNotificationEventDismissed : public AdEvent<AdNotificationInfo> {
~AdNotificationEventDismissed() override;

void Trigger(
const AdNotificationInfo& info) override;
const AdNotificationInfo& ad_notification) override;

private:
AdsImpl* ads_; // NOT OWNED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@

#include "bat/ads/internal/ad_events/ad_notification_event_timed_out.h"

#include <string>

#include "bat/ads/ad_notification_info.h"
#include "bat/ads/internal/ad_notifications/ad_notifications.h"
#include "bat/ads/internal/ads_impl.h"
#include "bat/ads/internal/logging.h"
#include "bat/ads/internal/reports/reports.h"

namespace ads {

Expand All @@ -24,13 +20,13 @@ AdNotificationEventTimedOut::AdNotificationEventTimedOut(
AdNotificationEventTimedOut::~AdNotificationEventTimedOut() = default;

void AdNotificationEventTimedOut::Trigger(
const AdNotificationInfo& info) {
ads_->get_ad_notifications()->Remove(info.uuid, false);
const AdNotificationInfo& ad_notification) {
BLOG(3, "Timed out ad notification with uuid " << ad_notification.uuid
<< " and " << ad_notification.creative_instance_id
<< " creative instance id");

Reports reports(ads_);
const std::string report = reports.GenerateAdNotificationEventReport(info,
AdNotificationEventType::kTimedOut);
BLOG(3, "Event log: " << report);
ads_->get_ad_notifications()->Remove(ad_notification.uuid,
/* should dismiss */ false);
}

} // namespace ads
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AdNotificationEventTimedOut : public AdEvent<AdNotificationInfo> {
~AdNotificationEventTimedOut() override;

void Trigger(
const AdNotificationInfo& info) override;
const AdNotificationInfo& ad_notification) override;

private:
AdsImpl* ads_; // NOT OWNED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@

#include "bat/ads/internal/ad_events/ad_notification_event_viewed.h"

#include <string>

#include "bat/ads/ad_notification_info.h"
#include "bat/ads/confirmation_type.h"
#include "bat/ads/internal/ads_impl.h"
#include "bat/ads/internal/confirmations/confirmations.h"
#include "bat/ads/internal/logging.h"
#include "bat/ads/internal/reports/reports.h"

namespace ads {

namespace {
const ConfirmationType kConfirmationType = ConfirmationType::kViewed;
} // namespace

AdNotificationEventViewed::AdNotificationEventViewed(
AdsImpl* ads)
: ads_(ads) {
Expand All @@ -25,17 +25,15 @@ AdNotificationEventViewed::AdNotificationEventViewed(
AdNotificationEventViewed::~AdNotificationEventViewed() = default;

void AdNotificationEventViewed::Trigger(
const AdNotificationInfo& info) {
ads_->set_last_shown_ad_notification(info);
const AdNotificationInfo& ad_notification) {
BLOG(3, "Viewed ad notification with uuid " << ad_notification.uuid << " and "
<< ad_notification.creative_instance_id << " creative instance id");

Reports reports(ads_);
const std::string report = reports.GenerateAdNotificationEventReport(info,
AdNotificationEventType::kViewed);
BLOG(3, "Event log: " << report);
ads_->set_last_shown_ad_notification(ad_notification);

ads_->get_confirmations()->ConfirmAd(info, ConfirmationType::kViewed);
ads_->AppendAdNotificationToHistory(ad_notification, kConfirmationType);

ads_->AppendAdNotificationToHistory(info, ConfirmationType::kViewed);
ads_->get_confirmations()->ConfirmAd(ad_notification, kConfirmationType);
}

} // namespace ads
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AdNotificationEventViewed : public AdEvent<AdNotificationInfo> {
~AdNotificationEventViewed() override;

void Trigger(
const AdNotificationInfo& info) override;
const AdNotificationInfo& ad_notification) override;

private:
AdsImpl* ads_; // NOT OWNED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#include "bat/ads/internal/classification/page_classifier/page_classifier_user_models.h"
#include "bat/ads/internal/classification/page_classifier/page_classifier_util.h"
#include "bat/ads/internal/logging.h"
#include "bat/ads/internal/reports/event_type_load_info.h"
#include "bat/ads/internal/reports/reports.h"
#include "bat/ads/internal/url_util.h"

namespace ads {
Expand Down Expand Up @@ -73,15 +71,6 @@ std::string PageClassifier::MaybeClassifyPage(
const std::string page_classification =
ShouldClassifyPages() ? ClassifyPage(url, content) : kUntargeted;

LoadInfo load_info;
load_info.tab_id = ads_->get_active_tab_id();
load_info.tab_url = ads_->get_active_tab_url();
load_info.tab_classification = page_classification;

const Reports reports(ads_);
const std::string report = reports.GenerateLoadEventReport(load_info);
BLOG(3, "Event log: " << report);

if (page_classification == kUntargeted) {
const std::string locale =
brave_l10n::LocaleHelper::GetInstance()->GetLocale();
Expand Down

This file was deleted.

Loading