Skip to content

Commit 0c322a1

Browse files
committed
Moves recurring tips table
1 parent 03db29e commit 0c322a1

31 files changed

+400
-680
lines changed

components/brave_rewards/browser/BUILD.gn

-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ source_set("browser") {
9696
"database/database_promotion.h",
9797
"database/database_promotion_creds.cc",
9898
"database/database_promotion_creds.h",
99-
"database/database_recurring_tip.cc",
100-
"database/database_recurring_tip.h",
10199
"database/database_table.cc",
102100
"database/database_table.h",
103101
"database/database_unblinded_token.cc",

components/brave_rewards/browser/database/database_recurring_tip.cc

-206
This file was deleted.

components/brave_rewards/browser/database/database_recurring_tip.h

-48
This file was deleted.

components/brave_rewards/browser/database/publisher_info_database.cc

-43
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ PublisherInfoDatabase::PublisherInfoDatabase(
7070

7171
media_publisher_info_ =
7272
std::make_unique<DatabaseMediaPublisherInfo>(GetCurrentVersion());
73-
74-
recurring_tip_ =
75-
std::make_unique<DatabaseRecurringTip>(GetCurrentVersion());
7673
}
7774

7875
PublisherInfoDatabase::~PublisherInfoDatabase() {
@@ -229,38 +226,6 @@ PublisherInfoDatabase::GetMediaPublisherInfo(const std::string& media_key) {
229226
return media_publisher_info_->GetRecord(&GetDB(), media_key);
230227
}
231228

232-
/**
233-
*
234-
* RECURRING TIPS
235-
*
236-
*/
237-
bool PublisherInfoDatabase::InsertOrUpdateRecurringTip(
238-
ledger::RecurringTipPtr info) {
239-
if (!IsInitialized()) {
240-
return false;
241-
}
242-
243-
return recurring_tip_->InsertOrUpdate(&GetDB(), std::move(info));
244-
}
245-
246-
void PublisherInfoDatabase::GetRecurringTips(
247-
ledger::PublisherInfoList* list) {
248-
if (!IsInitialized()) {
249-
return;
250-
}
251-
252-
recurring_tip_->GetAllRecords(&GetDB(), list);
253-
}
254-
255-
bool PublisherInfoDatabase::RemoveRecurringTip(
256-
const std::string& publisher_key) {
257-
if (!IsInitialized()) {
258-
return false;
259-
}
260-
261-
return recurring_tip_->DeleteRecord(&GetDB(), publisher_key);
262-
}
263-
264229
/**
265230
*
266231
* PENDING CONTRIBUTION
@@ -584,10 +549,6 @@ bool PublisherInfoDatabase::MigrateV1toV2() {
584549
return false;
585550
}
586551

587-
if (!recurring_tip_->Migrate(&GetDB(), 2)) {
588-
return false;
589-
}
590-
591552
return true;
592553
}
593554

@@ -754,10 +715,6 @@ bool PublisherInfoDatabase::MigrateV14toV15() {
754715
return false;
755716
}
756717

757-
if (!recurring_tip_->Migrate(&GetDB(), 15)) {
758-
return false;
759-
}
760-
761718
if (!unblinded_token_->Migrate(&GetDB(), 15)) {
762719
return false;
763720
}

components/brave_rewards/browser/database/publisher_info_database.h

-8
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include "brave/components/brave_rewards/browser/database/database_media_publisher_info.h"
2525
#include "brave/components/brave_rewards/browser/database/database_pending_contribution.h"
2626
#include "brave/components/brave_rewards/browser/database/database_promotion.h"
27-
#include "brave/components/brave_rewards/browser/database/database_recurring_tip.h"
2827
#include "brave/components/brave_rewards/browser/database/database_unblinded_token.h"
2928
#include "brave/components/brave_rewards/browser/pending_contribution.h"
3029
#include "build/build_config.h"
@@ -61,12 +60,6 @@ class PublisherInfoDatabase {
6160
ledger::PublisherInfoPtr GetMediaPublisherInfo(
6261
const std::string& media_key);
6362

64-
bool InsertOrUpdateRecurringTip(ledger::RecurringTipPtr info);
65-
66-
void GetRecurringTips(ledger::PublisherInfoList* list);
67-
68-
bool RemoveRecurringTip(const std::string& publisher_key);
69-
7063
bool InsertPendingContribution(ledger::PendingContributionList list);
7164

7265
double GetReservedAmount();
@@ -200,7 +193,6 @@ class PublisherInfoDatabase {
200193
std::unique_ptr<DatabaseContributionInfo> contribution_info_;
201194
std::unique_ptr<DatabasePendingContribution> pending_contribution_;
202195
std::unique_ptr<DatabaseMediaPublisherInfo> media_publisher_info_;
203-
std::unique_ptr<DatabaseRecurringTip> recurring_tip_;
204196

205197
SEQUENCE_CHECKER(sequence_checker_);
206198
DISALLOW_COPY_AND_ASSIGN(PublisherInfoDatabase);

0 commit comments

Comments
 (0)