Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Issue 2255813002: AddEngagementBudget and SpendBudget added to BudgetDatabase. (Closed)

Created:
4 years, 4 months ago by harkness
Modified:
4 years, 3 months ago
Reviewers:
johnme, Peter Beverloo
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

AddEngagementBudget and SpendBudget added to BudgetDatabase. The BudgetDatabase already had a basic AddBudget method which would add a fixed amount of budget. This CL adds an engagement based budget increment which takes the SES score and adds a percentage of the score to the budget based on when the last award grant was added. For instance, if the budget was last added a day ago, then AddEngagementBudget will add 1/3 of the SES score to the budget. This functionality required adding another parameter to the database, which is the last time the budget was incremented with engagement-based budget. This CL also adds SpendBudget, which will reduce the budget by the amount requested if it is available, and will invoke the callback with false otherwise. BUG=617971 Committed: https://crrev.com/e0e2609b94ad995b18286f1e82cb7cb41c926708 Cr-Commit-Position: refs/heads/master@{#413995}

Patch Set 1 #

Patch Set 2 : Added expiration check in SpendBudget #

Total comments: 52

Patch Set 3 : Code review comments #

Total comments: 20

Patch Set 4 : Cleanup #

Unified diffs Side-by-side diffs Delta from patch set Stats (+293 lines, -56 lines) Patch
M chrome/browser/budget_service/budget.proto View 1 2 1 chunk +5 lines, -1 line 0 comments Download
M chrome/browser/budget_service/budget_database.h View 1 2 3 5 chunks +36 lines, -6 lines 0 comments Download
M chrome/browser/budget_service/budget_database.cc View 1 2 3 7 chunks +115 lines, -19 lines 0 comments Download
M chrome/browser/budget_service/budget_database_unittest.cc View 1 2 3 8 chunks +137 lines, -30 lines 0 comments Download

Messages

Total messages: 17 (8 generated)
harkness
4 years, 4 months ago (2016-08-17 16:13:20 UTC) #2
johnme
https://codereview.chromium.org/2255813002/diff/20001/chrome/browser/budget_service/budget.proto File chrome/browser/budget_service/budget.proto (right): https://codereview.chromium.org/2255813002/diff/20001/chrome/browser/budget_service/budget.proto#newcode19 chrome/browser/budget_service/budget.proto:19: optional int64 last_updated = 2; Nit: rename this to ...
4 years, 4 months ago (2016-08-19 18:48:36 UTC) #3
harkness
https://codereview.chromium.org/2255813002/diff/20001/chrome/browser/budget_service/budget.proto File chrome/browser/budget_service/budget.proto (right): https://codereview.chromium.org/2255813002/diff/20001/chrome/browser/budget_service/budget.proto#newcode19 chrome/browser/budget_service/budget.proto:19: optional int64 last_updated = 2; On 2016/08/19 18:48:35, johnme ...
4 years, 4 months ago (2016-08-22 13:46:27 UTC) #4
johnme
lgtm with nits https://codereview.chromium.org/2255813002/diff/20001/chrome/browser/budget_service/budget_database.cc File chrome/browser/budget_service/budget_database.cc (right): https://codereview.chromium.org/2255813002/diff/20001/chrome/browser/budget_service/budget_database.cc#newcode104 chrome/browser/budget_service/budget_database.cc:104: int elapsedHours = elapsed.InHours(); On 2016/08/22 ...
4 years, 4 months ago (2016-08-22 14:50:31 UTC) #5
Peter Beverloo
lgtm % nits https://codereview.chromium.org/2255813002/diff/40001/chrome/browser/budget_service/budget_database.cc File chrome/browser/budget_service/budget_database.cc (right): https://codereview.chromium.org/2255813002/diff/40001/chrome/browser/budget_service/budget_database.cc#newcode91 chrome/browser/budget_service/budget_database.cc:91: double sesScore, nit: s/sesScore/score/ https://codereview.chromium.org/2255813002/diff/40001/chrome/browser/budget_service/budget_database.cc#newcode97 chrome/browser/budget_service/budget_database.cc:97: ...
4 years, 4 months ago (2016-08-22 18:04:27 UTC) #6
harkness
https://codereview.chromium.org/2255813002/diff/40001/chrome/browser/budget_service/budget_database.cc File chrome/browser/budget_service/budget_database.cc (right): https://codereview.chromium.org/2255813002/diff/40001/chrome/browser/budget_service/budget_database.cc#newcode91 chrome/browser/budget_service/budget_database.cc:91: double sesScore, On 2016/08/22 18:04:27, Peter Beverloo wrote: > ...
4 years, 4 months ago (2016-08-23 09:55:56 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2255813002/60001
4 years, 3 months ago (2016-08-24 06:24:58 UTC) #14
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 3 months ago (2016-08-24 06:29:52 UTC) #15
commit-bot: I haz the power
4 years, 3 months ago (2016-08-24 06:31:28 UTC) #17
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/e0e2609b94ad995b18286f1e82cb7cb41c926708
Cr-Commit-Position: refs/heads/master@{#413995}

Powered by Google App Engine
This is Rietveld 408576698