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

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

Issue 2620393002: Refactor budget computation to be more tuneable. (Closed)
Patch Set: Changed LayoutTest to expect integral budgets. (Also rebased) 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/budget/budget-service-mock.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1def7099bdffe9f51fb6de1af893276ef914aaaf 100644
--- a/third_party/WebKit/Source/modules/budget/BudgetService.cpp
+++ b/third_party/WebKit/Source/modules/budget/BudgetService.cpp
@@ -114,9 +114,12 @@ void BudgetService::gotBudget(
// Copy the chunks into the budget array.
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++) {
+ // Return the largest integer less than the budget, so it's easier for
+ // developer to reason about budget.
+ budget[i] = new BudgetState(floor(expectations[i]->budget_at),
+ expectations[i]->time);
+ }
resolver->resolve(budget);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/budget/budget-service-mock.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698