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
Moves pending contributon into mojom definition #2510
Merged
+183
−445
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
Loading status checks…
Moves pending contributon into mojom definition
Resolves brave/brave-browser#4620
- Loading branch information
NejcZdovc
committed
May 28, 2019
NejcZdovc
Nejc Zdovc
commit 574f947b7633e710de64679d1cf289979e7e4d68
Verified
This commit was signed with a verified signature.
GPG key ID: F55DDADFE8E43B0F
Learn about signing commits
| @@ -2751,13 +2751,13 @@ void RewardsServiceImpl::OnSavePendingContribution(ledger::Result result) { | ||
| } | ||
|
|
||
| void RewardsServiceImpl::SavePendingContribution( | ||
| const ledger::PendingContributionList& list) { | ||
| ledger::PendingContributionList list) { | ||
| base::PostTaskAndReplyWithResult( | ||
| file_task_runner_.get(), | ||
| FROM_HERE, | ||
| base::Bind(&SavePendingContributionOnFileTaskRunner, | ||
| publisher_info_backend_.get(), | ||
| list), | ||
| std::move(list)), | ||
| base::Bind(&RewardsServiceImpl::OnSavePendingContribution, | ||
| AsWeakPtr())); | ||
| } | ||
| @@ -3034,32 +3034,30 @@ ledger::PendingContributionInfoList PendingContributionsOnFileTaskRunner( | ||
| } | ||
|
|
||
| PendingContributionInfo PendingContributionLedgerToRewards( | ||
| const ledger::PendingContributionInfo& contribution) { | ||
| const ledger::PendingContributionInfoPtr contribution) { | ||
| PendingContributionInfo info; | ||
| info.publisher_key = contribution.publisher_key; | ||
| info.category = contribution.category; | ||
| info.verified = contribution.verified; | ||
| info.name = contribution.name; | ||
| info.url = contribution.url; | ||
| info.provider = contribution.provider; | ||
| info.favicon_url = contribution.favicon_url; | ||
| info.amount = contribution.amount; | ||
| info.added_date = contribution.added_date; | ||
| info.viewing_id = contribution.viewing_id; | ||
| info.expiration_date = contribution.expiration_date; | ||
| info.publisher_key = contribution->publisher_key; | ||
| info.category = contribution->category; | ||
| info.verified = contribution->verified; | ||
| info.name = contribution->name; | ||
| info.url = contribution->url; | ||
| info.provider = contribution->provider; | ||
| info.favicon_url = contribution->favicon_url; | ||
| info.amount = contribution->amount; | ||
| info.added_date = contribution->added_date; | ||
| info.viewing_id = contribution->viewing_id; | ||
| info.expiration_date = contribution->expiration_date; | ||
| return info; | ||
| } | ||
|
|
||
| void RewardsServiceImpl::OnGetPendingContributionsUI( | ||
| GetPendingContributionsCallback callback, | ||
| const std::vector<std::string>& json_list) { | ||
| ledger::PendingContributionInfoList list) { | ||
|
This conversation was marked as resolved
by tmancey
NejcZdovc
Author
Member
|
||
| std::unique_ptr<brave_rewards::PendingContributionInfoList> new_list( | ||
| new brave_rewards::PendingContributionInfoList); | ||
| for (auto &json_contribution : json_list) { | ||
| ledger::PendingContributionInfo contribution; | ||
| contribution.loadFromJson(json_contribution); | ||
| for (auto &item : list) { | ||
| brave_rewards::PendingContributionInfo new_contribution = | ||
| PendingContributionLedgerToRewards(contribution); | ||
| PendingContributionLedgerToRewards(std::move(item)); | ||
| new_list->push_back(new_contribution); | ||
| } | ||
|
|
||
| @@ -3076,12 +3074,12 @@ void RewardsServiceImpl::GetPendingContributionsUI( | ||
|
|
||
| void RewardsServiceImpl::OnGetPendingContributions( | ||
| const ledger::PendingContributionInfoListCallback& callback, | ||
| const ledger::PendingContributionInfoList& list) { | ||
| ledger::PendingContributionInfoList list) { | ||
| if (!Connected()) { | ||
| return; | ||
| } | ||
|
|
||
| callback(list); | ||
| callback(std::move(list)); | ||
| } | ||
|
|
||
| void RewardsServiceImpl::GetPendingContributions( | ||
Oops, something went wrong.
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
listshould beconst