From 32930d28a7ba2f8cca710a526eb64cf76a70e7f8 Mon Sep 17 00:00:00 2001 From: NejcZdovc Date: Mon, 5 Nov 2018 18:12:42 +0100 Subject: [PATCH] Splits contribution into seperate file for better organization Resolves https://github.com/brave/brave-browser/issues/1987 --- DEPS | 2 +- .../brave_rewards/browser/rewards_service_impl.cc | 12 ++++++------ .../brave_rewards/browser/rewards_service_impl.h | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/DEPS b/DEPS index da9013a5b35..58d6daa25f3 100644 --- a/DEPS +++ b/DEPS @@ -11,7 +11,7 @@ deps = { "vendor/python-patch": "https://github.com/svn2github/python-patch@a336a458016ced89aba90dfc3f4c8222ae3b1403", "vendor/omaha": "https://github.com/brave/omaha.git@dc2582d63a5b92dd39bf7bfd07612e501e133143", "vendor/sparkle": "https://github.com/brave/Sparkle.git@c0759cce415d7c0feae45005c8a013b1898711f0", - "vendor/bat-native-ledger": "https://github.com/brave-intl/bat-native-ledger@dafdd9a3d597cd704ecfd6eb0bfd854ee06d669a", + "vendor/bat-native-ledger": "https://github.com/brave-intl/bat-native-ledger@0866b291b4fcaae933509c8db9bc51f848d83cce", "vendor/bat-native-rapidjson": "https://github.com/brave-intl/bat-native-rapidjson.git@86aafe2ef89835ae71c9ed7c2527e3bb3000930e", "vendor/bip39wally-core-native": "https://github.com/brave-intl/bip39wally-core-native.git@9b119931c702d55be994117eb505d56310720b1d", "vendor/bat-native-anonize": "https://github.com/brave-intl/bat-native-anonize.git@adeff3254bb90ccdc9699040d5a4e1cd6b8393b7", diff --git a/components/brave_rewards/browser/rewards_service_impl.cc b/components/brave_rewards/browser/rewards_service_impl.cc index 9fe5cb3e385..88de28cd76d 100644 --- a/components/brave_rewards/browser/rewards_service_impl.cc +++ b/components/brave_rewards/browser/rewards_service_impl.cc @@ -753,7 +753,7 @@ void RewardsServiceImpl::LoadPublisherInfoList( uint32_t start, uint32_t limit, ledger::PublisherInfoFilter filter, - ledger::GetPublisherInfoListCallback callback) { + ledger::PublisherInfoListCallback callback) { auto now = base::Time::Now(); filter.month = GetPublisherMonth(now); filter.year = GetPublisherYear(now); @@ -774,7 +774,7 @@ void RewardsServiceImpl::LoadCurrentPublisherInfoList( uint32_t start, uint32_t limit, ledger::PublisherInfoFilter filter, - ledger::GetPublisherInfoListCallback callback) { + ledger::PublisherInfoListCallback callback) { base::PostTaskAndReplyWithResult(file_task_runner_.get(), FROM_HERE, base::Bind(&LoadPublisherInfoListOnFileTaskRunner, start, limit, filter, @@ -789,7 +789,7 @@ void RewardsServiceImpl::LoadCurrentPublisherInfoList( void RewardsServiceImpl::OnPublisherInfoListLoaded( uint32_t start, uint32_t limit, - ledger::GetPublisherInfoListCallback callback, + ledger::PublisherInfoListCallback callback, const ledger::PublisherInfoList& list) { uint32_t next_record = 0; if (list.size() == limit) @@ -1425,12 +1425,12 @@ ledger::PublisherInfoList GetRecurringDonationsOnFileTaskRunner(PublisherInfoDat return list; } -void RewardsServiceImpl::OnRecurringDonationsData(const ledger::RecurringDonationCallback callback, +void RewardsServiceImpl::OnRecurringDonationsData(const ledger::PublisherInfoListCallback callback, const ledger::PublisherInfoList list) { - callback(list); + callback(list, 0); } -void RewardsServiceImpl::GetRecurringDonations(ledger::RecurringDonationCallback callback) { +void RewardsServiceImpl::GetRecurringDonations(ledger::PublisherInfoListCallback callback) { base::PostTaskAndReplyWithResult(file_task_runner_.get(), FROM_HERE, base::Bind(&GetRecurringDonationsOnFileTaskRunner, publisher_info_backend_.get()), diff --git a/components/brave_rewards/browser/rewards_service_impl.h b/components/brave_rewards/browser/rewards_service_impl.h index 6717c33ea2c..aa533753612 100644 --- a/components/brave_rewards/browser/rewards_service_impl.h +++ b/components/brave_rewards/browser/rewards_service_impl.h @@ -156,7 +156,7 @@ class RewardsServiceImpl : public RewardsService, std::unique_ptr info); void OnPublisherInfoListLoaded(uint32_t start, uint32_t limit, - ledger::GetPublisherInfoListCallback callback, + ledger::PublisherInfoListCallback callback, const ledger::PublisherInfoList& list); void OnPublishersListSaved(ledger::LedgerCallbackHandler* handler, bool success); @@ -168,7 +168,7 @@ class RewardsServiceImpl : public RewardsService, void OnContributionInfoSaved(const ledger::PUBLISHER_CATEGORY category, bool success); void OnRecurringDonationSaved(bool success); void SaveRecurringDonation(const std::string& publisher_key, const int amount); - void OnRecurringDonationsData(const ledger::RecurringDonationCallback callback, + void OnRecurringDonationsData(const ledger::PublisherInfoListCallback callback, const ledger::PublisherInfoList list); void OnRecurringDonationUpdated(const ledger::PublisherInfoList& list); void OnTipsUpdatedData(const ledger::PublisherInfoList list); @@ -212,12 +212,12 @@ class RewardsServiceImpl : public RewardsService, uint32_t start, uint32_t limit, ledger::PublisherInfoFilter filter, - ledger::GetPublisherInfoListCallback callback) override; + ledger::PublisherInfoListCallback callback) override; void LoadCurrentPublisherInfoList( uint32_t start, uint32_t limit, ledger::PublisherInfoFilter filter, - ledger::GetPublisherInfoListCallback callback) override; + ledger::PublisherInfoListCallback callback) override; void SavePublishersList(const std::string& publishers_list, ledger::LedgerCallbackHandler* handler) override; void SetTimer(uint64_t time_offset, uint32_t& timer_id) override; @@ -260,7 +260,7 @@ class RewardsServiceImpl : public RewardsService, const uint32_t date, const std::string& publisher_key, const ledger::PUBLISHER_CATEGORY category) override; - void GetRecurringDonations(ledger::RecurringDonationCallback callback) override; + void GetRecurringDonations(ledger::PublisherInfoListCallback callback) override; void Log(ledger::LogLevel level, const std::string& text) override; void OnIOTaskComplete(std::function callback);