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

Unified Diff: third_party/WebKit/Source/modules/budget/BudgetService.cpp

Issue 2620393002: Refactor budget computation to be more tuneable. (Closed)
Patch Set: Formatting Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/budget/BudgetService.cpp
diff --git a/third_party/WebKit/Source/modules/budget/BudgetService.cpp b/third_party/WebKit/Source/modules/budget/BudgetService.cpp
index 5308d8691bdaea1f879a4b86eb8d2bc15396d761..82080dd9609005d18ce08bcdd9d2f3ea1aa981c1 100644
--- a/third_party/WebKit/Source/modules/budget/BudgetService.cpp
+++ b/third_party/WebKit/Source/modules/budget/BudgetService.cpp
@@ -114,9 +114,10 @@ void BudgetService::gotBudget(
// Copy the chunks into the budget array.
Peter Beverloo 2017/01/12 14:40:04 nit: Please document why we're flooring.
harkness 2017/01/12 17:44:15 Done.
HeapVector<Member<BudgetState>> budget(expectations.size());
- for (size_t i = 0; i < expectations.size(); i++)
- budget[i] =
- new BudgetState(expectations[i]->budget_at, expectations[i]->time);
+ for (size_t i = 0; i < expectations.size(); i++) {
+ budget[i] = new BudgetState(floor(expectations[i]->budget_at),
+ expectations[i]->time);
+ }
resolver->resolve(budget);
}

Powered by Google App Engine
This is Rietveld 408576698