New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 8 users
Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jun 28
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment
Implement the Budget API
Project Member Reported by harkness@chromium.org, Jun 7 2016 Back to list
The system should provide a developer query-able API to get current and future budget information, so that developers can provide a more app-like experience. This budget can be used by user agent developers to control access to resource intensive background operations.

As a first implementation, we should allow push messages to trigger background processing without always showing a notification.

The Web Push API (https://www.w3.org/TR/push-api/) defines a PushSubscriptionOptions object which allows a subscription to specify whether it is userVisibleOnly. If a subscription is userVisibleOnly, then the service worker will always display some user visible effect when allowed to run as a result of a push message. Currently, Chrome only supports subscriptions with userVisibleOnly set to true.

Chrome has already shifted the existing default notification grace count to using a budget service based on the user's engagement with the site. That system should be expanded to allow limited processing without visible effects. 



 
Project Member Comment 1 by bugdroid1@chromium.org, Jun 8 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fe1b0492f0f91a26fb113bffc37576c2781920de

commit fe1b0492f0f91a26fb113bffc37576c2781920de
Author: harkness <harkness@chromium.org>
Date: Wed Jun 08 10:56:32 2016

Create new directory for budget_service.

The budget service is going to be expanded in the future.
Rather than pollute the push_messaging directory with the
general purpose budget service, this separates it out into
its own directory.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2039283002
Cr-Commit-Position: refs/heads/master@{#398518}

[add] https://crrev.com/fe1b0492f0f91a26fb113bffc37576c2781920de/chrome/browser/budget_service/OWNERS
[add] https://crrev.com/fe1b0492f0f91a26fb113bffc37576c2781920de/chrome/browser/budget_service/PRESUBMIT.py
[rename] https://crrev.com/fe1b0492f0f91a26fb113bffc37576c2781920de/chrome/browser/budget_service/background_budget_service.cc
[rename] https://crrev.com/fe1b0492f0f91a26fb113bffc37576c2781920de/chrome/browser/budget_service/background_budget_service.h
[rename] https://crrev.com/fe1b0492f0f91a26fb113bffc37576c2781920de/chrome/browser/budget_service/background_budget_service_factory.cc
[rename] https://crrev.com/fe1b0492f0f91a26fb113bffc37576c2781920de/chrome/browser/budget_service/background_budget_service_factory.h
[rename] https://crrev.com/fe1b0492f0f91a26fb113bffc37576c2781920de/chrome/browser/budget_service/background_budget_service_unittest.cc
[modify] https://crrev.com/fe1b0492f0f91a26fb113bffc37576c2781920de/chrome/browser/prefs/browser_prefs.cc
[modify] https://crrev.com/fe1b0492f0f91a26fb113bffc37576c2781920de/chrome/browser/push_messaging/push_messaging_notification_manager.cc
[modify] https://crrev.com/fe1b0492f0f91a26fb113bffc37576c2781920de/chrome/browser/push_messaging/push_messaging_service_factory.cc
[modify] https://crrev.com/fe1b0492f0f91a26fb113bffc37576c2781920de/chrome/chrome_browser.gypi
[modify] https://crrev.com/fe1b0492f0f91a26fb113bffc37576c2781920de/chrome/chrome_tests_unit.gypi

Project Member Comment 2 by bugdroid1@chromium.org, Jun 20 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8e81c750cf56b698d4a1a04bfc2a2ed425d01d41

commit 8e81c750cf56b698d4a1a04bfc2a2ed425d01d41
Author: harkness <harkness@chromium.org>
Date: Mon Jun 20 17:26:05 2016

This CL converts the GetBudget and StoreBudget calls on the
BackgroundBudgetService to be asynchonous. This is a step on the path to
converting BackgroundBudgetService budget storage to use a LevelDB storage
instead of prefs storage, which will require some of the budget service's
methods to run on a thread other than the UI thread.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2058523003
Cr-Commit-Position: refs/heads/master@{#400707}

[modify] https://crrev.com/8e81c750cf56b698d4a1a04bfc2a2ed425d01d41/chrome/browser/budget_service/background_budget_service.cc
[modify] https://crrev.com/8e81c750cf56b698d4a1a04bfc2a2ed425d01d41/chrome/browser/budget_service/background_budget_service.h
[modify] https://crrev.com/8e81c750cf56b698d4a1a04bfc2a2ed425d01d41/chrome/browser/budget_service/background_budget_service_unittest.cc
[modify] https://crrev.com/8e81c750cf56b698d4a1a04bfc2a2ed425d01d41/chrome/browser/push_messaging/push_messaging_notification_manager.cc
[modify] https://crrev.com/8e81c750cf56b698d4a1a04bfc2a2ed425d01d41/chrome/browser/push_messaging/push_messaging_notification_manager.h

Project Member Comment 3 by bugdroid1@chromium.org, Jul 18 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/883658b07cc779484d846289669570b54af5e7f3

commit 883658b07cc779484d846289669570b54af5e7f3
Author: harkness <harkness@chromium.org>
Date: Mon Jul 18 11:37:53 2016

Add the future storage framework for the BudgetDatabase. This isn't
currently plugged into the BackgroundBudgetService, but will be in future
work.

It will be able to store objects that fit the Budget protobuf type, which
has pieces of budget that have been allocated, an expiration time for those
pieces, and how much (if any) in debt a service worker is.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2107173002
Cr-Commit-Position: refs/heads/master@{#405975}

[modify] https://crrev.com/883658b07cc779484d846289669570b54af5e7f3/chrome/browser/BUILD.gn
[add] https://crrev.com/883658b07cc779484d846289669570b54af5e7f3/chrome/browser/budget_service/BUILD.gn
[add] https://crrev.com/883658b07cc779484d846289669570b54af5e7f3/chrome/browser/budget_service/budget.proto
[add] https://crrev.com/883658b07cc779484d846289669570b54af5e7f3/chrome/browser/budget_service/budget_database.cc
[add] https://crrev.com/883658b07cc779484d846289669570b54af5e7f3/chrome/browser/budget_service/budget_database.h
[add] https://crrev.com/883658b07cc779484d846289669570b54af5e7f3/chrome/browser/budget_service/budget_database_unittest.cc
[modify] https://crrev.com/883658b07cc779484d846289669570b54af5e7f3/chrome/chrome_browser.gypi
[modify] https://crrev.com/883658b07cc779484d846289669570b54af5e7f3/chrome/chrome_tests_unit.gypi
[modify] https://crrev.com/883658b07cc779484d846289669570b54af5e7f3/tools/metrics/histograms/histograms.xml

Project Member Comment 4 by bugdroid1@chromium.org, Jul 27 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/804b612a628958aef2f1f21fdda3c56c827cb2cb

commit 804b612a628958aef2f1f21fdda3c56c827cb2cb
Author: harkness <harkness@chromium.org>
Date: Wed Jul 27 12:53:31 2016

Expand the functionality of the BudgetDatabase.

Adds a GetBudgetDetails call which returns full information about the
expected budget at future times.

Also adds a cache layer so that multiple GetBudgetDetails calls can't
hammer the filesystem I/O.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2173833002
Cr-Commit-Position: refs/heads/master@{#408104}

[modify] https://crrev.com/804b612a628958aef2f1f21fdda3c56c827cb2cb/chrome/browser/budget_service/budget.proto
[modify] https://crrev.com/804b612a628958aef2f1f21fdda3c56c827cb2cb/chrome/browser/budget_service/budget_database.cc
[modify] https://crrev.com/804b612a628958aef2f1f21fdda3c56c827cb2cb/chrome/browser/budget_service/budget_database.h
[modify] https://crrev.com/804b612a628958aef2f1f21fdda3c56c827cb2cb/chrome/browser/budget_service/budget_database_unittest.cc

Summary: Budget API: Allow push messages to trigger background processing without always showing a notification (was: Allow push messages to trigger background processing without always showing a notification)
Summary: Implement the Budget API (was: Budget API: Allow push messages to trigger background processing without always showing a notification)
Description: Show this description
Project Member Comment 8 by bugdroid1@chromium.org, Aug 8 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f8c9343991218892a376c89ae95e2bd9e6a1275a

commit f8c9343991218892a376c89ae95e2bd9e6a1275a
Author: harkness <harkness@chromium.org>
Date: Mon Aug 08 15:41:59 2016

Adding more functionality to BudgetDatabase.

The BudgetDatabase now has a clock, which it uses to timestamp budget chunks
with expiration times when an AddBudget is called.  (The clock from
BackgroundBudgetService will be removed when it switches to the BudgetDatabase.)

The unit tests were converted to use the new AddBudget instead of SetValue, and
SetValue and GetValue (which did not use the new cache scheme) were removed.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2188953004
Cr-Commit-Position: refs/heads/master@{#410364}

[modify] https://crrev.com/f8c9343991218892a376c89ae95e2bd9e6a1275a/chrome/browser/budget_service/budget_database.cc
[modify] https://crrev.com/f8c9343991218892a376c89ae95e2bd9e6a1275a/chrome/browser/budget_service/budget_database.h
[modify] https://crrev.com/f8c9343991218892a376c89ae95e2bd9e6a1275a/chrome/browser/budget_service/budget_database_unittest.cc

Project Member Comment 9 by bugdroid1@chromium.org, Aug 8 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/868da920b60dc73aafa236c288f4cf93a6610a4c

commit 868da920b60dc73aafa236c288f4cf93a6610a4c
Author: harkness <harkness@chromium.org>
Date: Mon Aug 08 16:30:21 2016

Basic framework for Budget API.

This implements the basic framework for the Budget API in blink. Only the
getCost and getBudget methods are defined, and a LayoutTest is specified
which checks that the interfaces exist.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2110833002
Cr-Commit-Position: refs/heads/master@{#410378}

[add] https://crrev.com/868da920b60dc73aafa236c288f4cf93a6610a4c/third_party/WebKit/LayoutTests/http/tests/budget/interfaces.html
[modify] https://crrev.com/868da920b60dc73aafa236c288f4cf93a6610a4c/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[add] https://crrev.com/868da920b60dc73aafa236c288f4cf93a6610a4c/third_party/WebKit/Source/modules/budget/Budget.cpp
[add] https://crrev.com/868da920b60dc73aafa236c288f4cf93a6610a4c/third_party/WebKit/Source/modules/budget/Budget.h
[add] https://crrev.com/868da920b60dc73aafa236c288f4cf93a6610a4c/third_party/WebKit/Source/modules/budget/Budget.idl
[add] https://crrev.com/868da920b60dc73aafa236c288f4cf93a6610a4c/third_party/WebKit/Source/modules/budget/BudgetChunk.idl
[add] https://crrev.com/868da920b60dc73aafa236c288f4cf93a6610a4c/third_party/WebKit/Source/modules/budget/NavigatorBudget.cpp
[add] https://crrev.com/868da920b60dc73aafa236c288f4cf93a6610a4c/third_party/WebKit/Source/modules/budget/NavigatorBudget.h
[add] https://crrev.com/868da920b60dc73aafa236c288f4cf93a6610a4c/third_party/WebKit/Source/modules/budget/NavigatorBudget.idl
[add] https://crrev.com/868da920b60dc73aafa236c288f4cf93a6610a4c/third_party/WebKit/Source/modules/budget/OWNERS
[modify] https://crrev.com/868da920b60dc73aafa236c288f4cf93a6610a4c/third_party/WebKit/Source/modules/modules.gypi
[modify] https://crrev.com/868da920b60dc73aafa236c288f4cf93a6610a4c/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in

Project Member Comment 10 by bugdroid1@chromium.org, Aug 9 2016
Project Member Comment 11 by bugdroid1@chromium.org, Aug 10 2016
Project Member Comment 12 by bugdroid1@chromium.org, Aug 11 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/eba38fdd93655ae7f7116e3c7846b5607e0ce3c5

commit eba38fdd93655ae7f7116e3c7846b5607e0ce3c5
Author: harkness <harkness@chromium.org>
Date: Thu Aug 11 13:55:18 2016

Convert Budget to BudgetService.

In the specification, the NavigatorBudget has a BudgetService member, not a
Budget member. Converting the code to match the spec.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2229283003
Cr-Commit-Position: refs/heads/master@{#411316}

[modify] https://crrev.com/eba38fdd93655ae7f7116e3c7846b5607e0ce3c5/third_party/WebKit/LayoutTests/http/tests/budget/interfaces.html
[modify] https://crrev.com/eba38fdd93655ae7f7116e3c7846b5607e0ce3c5/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[rename] https://crrev.com/eba38fdd93655ae7f7116e3c7846b5607e0ce3c5/third_party/WebKit/Source/modules/budget/BudgetService.cpp
[rename] https://crrev.com/eba38fdd93655ae7f7116e3c7846b5607e0ce3c5/third_party/WebKit/Source/modules/budget/BudgetService.h
[rename] https://crrev.com/eba38fdd93655ae7f7116e3c7846b5607e0ce3c5/third_party/WebKit/Source/modules/budget/BudgetService.idl
[modify] https://crrev.com/eba38fdd93655ae7f7116e3c7846b5607e0ce3c5/third_party/WebKit/Source/modules/budget/NavigatorBudget.cpp
[modify] https://crrev.com/eba38fdd93655ae7f7116e3c7846b5607e0ce3c5/third_party/WebKit/Source/modules/budget/NavigatorBudget.h
[modify] https://crrev.com/eba38fdd93655ae7f7116e3c7846b5607e0ce3c5/third_party/WebKit/Source/modules/budget/NavigatorBudget.idl
[modify] https://crrev.com/eba38fdd93655ae7f7116e3c7846b5607e0ce3c5/third_party/WebKit/Source/modules/modules.gypi

Project Member Comment 13 by bugdroid1@chromium.org, Aug 16 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bea56c2aeaab7efdbc8dd938b53de48daf5a00cb

commit bea56c2aeaab7efdbc8dd938b53de48daf5a00cb
Author: harkness <harkness@chromium.org>
Date: Tue Aug 16 07:23:00 2016

Rename BackgroundBudgetService to BudgetManager

It's clear that there's only going to be a single budget service, so "Background" didn't
make sense anymore. Also, with an interface named BudgetService and a Mojo service named
BudgetService, we needed something other than another BudgetService. The component does
manage calls from the Blink and browser layers into the guts of the BudgetDatabase, so
BudgetManager makes sense.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2243813002
Cr-Commit-Position: refs/heads/master@{#412186}

[delete] https://crrev.com/ebbb79d24ceb6625788dc9b121b880700b6340d6/chrome/browser/budget_service/background_budget_service_factory.cc
[delete] https://crrev.com/ebbb79d24ceb6625788dc9b121b880700b6340d6/chrome/browser/budget_service/background_budget_service_factory.h
[modify] https://crrev.com/bea56c2aeaab7efdbc8dd938b53de48daf5a00cb/chrome/browser/budget_service/budget_database.cc
[rename] https://crrev.com/bea56c2aeaab7efdbc8dd938b53de48daf5a00cb/chrome/browser/budget_service/budget_manager.cc
[rename] https://crrev.com/bea56c2aeaab7efdbc8dd938b53de48daf5a00cb/chrome/browser/budget_service/budget_manager.h
[add] https://crrev.com/bea56c2aeaab7efdbc8dd938b53de48daf5a00cb/chrome/browser/budget_service/budget_manager_factory.cc
[add] https://crrev.com/bea56c2aeaab7efdbc8dd938b53de48daf5a00cb/chrome/browser/budget_service/budget_manager_factory.h
[rename] https://crrev.com/bea56c2aeaab7efdbc8dd938b53de48daf5a00cb/chrome/browser/budget_service/budget_manager_unittest.cc
[modify] https://crrev.com/bea56c2aeaab7efdbc8dd938b53de48daf5a00cb/chrome/browser/prefs/browser_prefs.cc
[modify] https://crrev.com/bea56c2aeaab7efdbc8dd938b53de48daf5a00cb/chrome/browser/push_messaging/push_messaging_notification_manager.cc
[modify] https://crrev.com/bea56c2aeaab7efdbc8dd938b53de48daf5a00cb/chrome/browser/push_messaging/push_messaging_service_factory.cc
[modify] https://crrev.com/bea56c2aeaab7efdbc8dd938b53de48daf5a00cb/chrome/chrome_browser.gypi
[modify] https://crrev.com/bea56c2aeaab7efdbc8dd938b53de48daf5a00cb/chrome/chrome_tests_unit.gypi
[modify] https://crrev.com/bea56c2aeaab7efdbc8dd938b53de48daf5a00cb/tools/metrics/histograms/histograms.xml

Project Member Comment 14 by bugdroid1@chromium.org, Aug 24 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e0e2609b94ad995b18286f1e82cb7cb41c926708

commit e0e2609b94ad995b18286f1e82cb7cb41c926708
Author: harkness <harkness@chromium.org>
Date: Wed Aug 24 06:29:32 2016

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 

Review-Url: https://codereview.chromium.org/2255813002
Cr-Commit-Position: refs/heads/master@{#413995}

[modify] https://crrev.com/e0e2609b94ad995b18286f1e82cb7cb41c926708/chrome/browser/budget_service/budget.proto
[modify] https://crrev.com/e0e2609b94ad995b18286f1e82cb7cb41c926708/chrome/browser/budget_service/budget_database.cc
[modify] https://crrev.com/e0e2609b94ad995b18286f1e82cb7cb41c926708/chrome/browser/budget_service/budget_database.h
[modify] https://crrev.com/e0e2609b94ad995b18286f1e82cb7cb41c926708/chrome/browser/budget_service/budget_database_unittest.cc

Project Member Comment 15 by bugdroid1@chromium.org, Aug 25 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83

commit 7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83
Author: harkness <harkness@chromium.org>
Date: Thu Aug 25 02:24:28 2016

Added budget_service.mojom

This isn't implemented yet, but will be provide the Mojo service that will provide blink an access point to the BackgroundBudgetService.

This also adds a mock and a layout test to check the mojo service.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2231873002
Cr-Commit-Position: refs/heads/master@{#414265}

[add] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/LayoutTests/http/tests/budget/budget-service-mock.js
[add] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/LayoutTests/http/tests/budget/get-budget.html
[add] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/LayoutTests/http/tests/budget/get-cost.html
[modify] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/Source/modules/budget/BudgetService.cpp
[modify] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/Source/modules/budget/BudgetService.h
[modify] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/Source/modules/budget/BudgetService.idl
[add] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/Source/modules/budget/BudgetState.cpp
[add] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/Source/modules/budget/BudgetState.h
[rename] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/Source/modules/budget/BudgetState.idl
[modify] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/Source/modules/modules.gypi
[modify] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/public/BUILD.gn
[modify] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/public/blink.gyp
[add] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/public/platform/modules/budget_service/OWNERS
[add] https://crrev.com/7e00f5e7b1fdedd2a32ef8321bb13e2f0726bd83/third_party/WebKit/public/platform/modules/budget_service/budget_service.mojom

Project Member Comment 16 by bugdroid1@chromium.org, Aug 25 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4108cd014d785a83c19ade128fc15c72b1c672c4

commit 4108cd014d785a83c19ade128fc15c72b1c672c4
Author: harkness <harkness@chromium.org>
Date: Thu Aug 25 10:26:22 2016

Created Mojo BudgetService implementation in chrome/browser

This implementation will be invoked from Blink via Mojo and will return the
budget information specified in the BudgetAPI.

Current implementation only support the getCost call, although the GetBudget
call is also defined.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2265173002
Cr-Commit-Position: refs/heads/master@{#414382}

[modify] https://crrev.com/4108cd014d785a83c19ade128fc15c72b1c672c4/chrome/browser/DEPS
[modify] https://crrev.com/4108cd014d785a83c19ade128fc15c72b1c672c4/chrome/browser/budget_service/budget_manager.cc
[modify] https://crrev.com/4108cd014d785a83c19ade128fc15c72b1c672c4/chrome/browser/budget_service/budget_manager.h
[modify] https://crrev.com/4108cd014d785a83c19ade128fc15c72b1c672c4/chrome/browser/budget_service/budget_manager_unittest.cc
[add] https://crrev.com/4108cd014d785a83c19ade128fc15c72b1c672c4/chrome/browser/budget_service/budget_service_impl.cc
[add] https://crrev.com/4108cd014d785a83c19ade128fc15c72b1c672c4/chrome/browser/budget_service/budget_service_impl.h
[modify] https://crrev.com/4108cd014d785a83c19ade128fc15c72b1c672c4/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/4108cd014d785a83c19ade128fc15c72b1c672c4/chrome/browser/push_messaging/push_messaging_notification_manager.cc
[modify] https://crrev.com/4108cd014d785a83c19ade128fc15c72b1c672c4/chrome/chrome_browser.gypi

Project Member Comment 17 by bugdroid1@chromium.org, Aug 25 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/48002352c0a882279f25decc05b61c73c15795a5

commit 48002352c0a882279f25decc05b61c73c15795a5
Author: harkness <harkness@chromium.org>
Date: Thu Aug 25 23:19:29 2016

Framework and tests for WorkerNavigatorBudget

This CL provides a Worker entrypoint for the BudgetAPI. The WorkerNavigator
partial interface provides a BudgetService object, which is the same for
both Navigator and WorkerNavigator.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2273743002
Cr-Commit-Position: refs/heads/master@{#414579}

[add] https://crrev.com/48002352c0a882279f25decc05b61c73c15795a5/third_party/WebKit/LayoutTests/http/tests/budget/get-budget-in-service-worker.html
[add] https://crrev.com/48002352c0a882279f25decc05b61c73c15795a5/third_party/WebKit/LayoutTests/http/tests/budget/get-cost-fails-in-service-worker.html
[add] https://crrev.com/48002352c0a882279f25decc05b61c73c15795a5/third_party/WebKit/LayoutTests/http/tests/budget/get-cost-in-service-worker.html
[add] https://crrev.com/48002352c0a882279f25decc05b61c73c15795a5/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js
[modify] https://crrev.com/48002352c0a882279f25decc05b61c73c15795a5/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/48002352c0a882279f25decc05b61c73c15795a5/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/48002352c0a882279f25decc05b61c73c15795a5/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
[add] https://crrev.com/48002352c0a882279f25decc05b61c73c15795a5/third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.cpp
[add] https://crrev.com/48002352c0a882279f25decc05b61c73c15795a5/third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h
[add] https://crrev.com/48002352c0a882279f25decc05b61c73c15795a5/third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.idl
[modify] https://crrev.com/48002352c0a882279f25decc05b61c73c15795a5/third_party/WebKit/Source/modules/modules.gypi

Project Member Comment 18 by bugdroid1@chromium.org, Sep 2 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c3fb045f4ff19a65873bbcce47ffca0dd1a3b570

commit c3fb045f4ff19a65873bbcce47ffca0dd1a3b570
Author: harkness <harkness@chromium.org>
Date: Fri Sep 02 14:08:37 2016

Start plumbing connections from the BudgetManager to the BudgetDatabase

This adds the BudgetDatabase as a member of the manager, paving the way
for the switch from using the prefs to store budget to using the proto
database.

This also adds Reserve and Consume entrypoints on the BudgetManager.
Reserve is the entrypoint for the Mojo service to enable Javascript to
purchase reservations with budget. Consume is the entrypoint for clients
of the Manager to determine if an origin should be allowed an action,
either because it has a reservation or because it has enough budget to
cover the cost.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2272563005
Cr-Commit-Position: refs/heads/master@{#416260}

[modify] https://crrev.com/c3fb045f4ff19a65873bbcce47ffca0dd1a3b570/chrome/browser/budget_service/budget_database.cc
[modify] https://crrev.com/c3fb045f4ff19a65873bbcce47ffca0dd1a3b570/chrome/browser/budget_service/budget_database.h
[modify] https://crrev.com/c3fb045f4ff19a65873bbcce47ffca0dd1a3b570/chrome/browser/budget_service/budget_database_unittest.cc
[modify] https://crrev.com/c3fb045f4ff19a65873bbcce47ffca0dd1a3b570/chrome/browser/budget_service/budget_manager.cc
[modify] https://crrev.com/c3fb045f4ff19a65873bbcce47ffca0dd1a3b570/chrome/browser/budget_service/budget_manager.h
[modify] https://crrev.com/c3fb045f4ff19a65873bbcce47ffca0dd1a3b570/chrome/browser/budget_service/budget_manager_factory.cc
[modify] https://crrev.com/c3fb045f4ff19a65873bbcce47ffca0dd1a3b570/chrome/browser/budget_service/budget_manager_unittest.cc

Project Member Comment 19 by bugdroid1@chromium.org, Sep 7 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/df4af8684c8cee4e5b68691c03f62db259c5c07c

commit df4af8684c8cee4e5b68691c03f62db259c5c07c
Author: harkness <harkness@chromium.org>
Date: Wed Sep 07 11:06:49 2016

Plumb reserve method of the BudgetAPI

This CL adds the reserve method to both the budget_api mojo service and
to the BudgetService web platform API. This also provides a skeleton
implementation of the mojo service in chrome/browser, but the full
connection is left for a future CL. There are new LayoutTests and an
update to the BudgetService Javascript mock to test the new reserve
functionality.

This does provide some TODO cleanup, adding a success parameter to mojo
operations that could fail due to database errors, adding mappings from
strings to mojo values, and updating the LayoutTests to be more dynamic.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2309863002
Cr-Commit-Position: refs/heads/master@{#416905}

[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/chrome/browser/budget_service/budget_manager.cc
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/chrome/browser/budget_service/budget_service_impl.cc
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/chrome/browser/budget_service/budget_service_impl.h
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/LayoutTests/http/tests/budget/budget-service-mock.js
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/LayoutTests/http/tests/budget/get-budget-in-service-worker.html
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/LayoutTests/http/tests/budget/get-budget.html
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/LayoutTests/http/tests/budget/get-cost-fails-in-service-worker.html
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/LayoutTests/http/tests/budget/get-cost-in-service-worker.html
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/LayoutTests/http/tests/budget/get-cost.html
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/LayoutTests/http/tests/budget/interfaces.html
[add] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/LayoutTests/http/tests/budget/reserve-in-service-worker.html
[add] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/LayoutTests/http/tests/budget/reserve.html
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/Source/modules/budget/BudgetService.cpp
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/Source/modules/budget/BudgetService.h
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/Source/modules/budget/BudgetService.idl
[modify] https://crrev.com/df4af8684c8cee4e5b68691c03f62db259c5c07c/third_party/WebKit/public/platform/modules/budget_service/budget_service.mojom

Project Member Comment 20 by bugdroid1@chromium.org, Sep 8 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6f6b4143aa82b7876a8a0678e2cabb7074031ee5

commit 6f6b4143aa82b7876a8a0678e2cabb7074031ee5
Author: harkness <harkness@chromium.org>
Date: Thu Sep 08 09:17:28 2016

Full hookup of BudgetManager interfaces to BudgetDatabase.

This includes changing the GetBudgetDetails on BudgetDatabase to use the mojo
types and plumbing the result through the BudgetManager. It pulls out all of
the old implementation in BudetManager that used the prefs to store data
(although cleanup of that isn't quite complete). It also replaces the old
GetBudget/StoreBudget calls in the push messaging system with the new Consume
call.

Tests were added in BudgetManager for the new reserve functionality, and any
tests of GetBudget that were still applicable were moved from BudgetManager
to BudgetDatabase.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2281673002
Cr-Commit-Position: refs/heads/master@{#417236}

[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_database.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_database.h
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_database_unittest.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_manager.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_manager.h
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_manager_unittest.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_service_impl.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/push_messaging/push_messaging_browsertest.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/push_messaging/push_messaging_notification_manager.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/push_messaging/push_messaging_notification_manager.h

Project Member Comment 21 by bugdroid1@chromium.org, Sep 8 2016
Labels: merge-merged-2854
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6f6b4143aa82b7876a8a0678e2cabb7074031ee5

commit 6f6b4143aa82b7876a8a0678e2cabb7074031ee5
Author: harkness <harkness@chromium.org>
Date: Thu Sep 08 09:17:28 2016

Full hookup of BudgetManager interfaces to BudgetDatabase.

This includes changing the GetBudgetDetails on BudgetDatabase to use the mojo
types and plumbing the result through the BudgetManager. It pulls out all of
the old implementation in BudetManager that used the prefs to store data
(although cleanup of that isn't quite complete). It also replaces the old
GetBudget/StoreBudget calls in the push messaging system with the new Consume
call.

Tests were added in BudgetManager for the new reserve functionality, and any
tests of GetBudget that were still applicable were moved from BudgetManager
to BudgetDatabase.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2281673002
Cr-Commit-Position: refs/heads/master@{#417236}

[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_database.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_database.h
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_database_unittest.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_manager.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_manager.h
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_manager_unittest.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/budget_service/budget_service_impl.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/push_messaging/push_messaging_browsertest.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/push_messaging/push_messaging_notification_manager.cc
[modify] https://crrev.com/6f6b4143aa82b7876a8a0678e2cabb7074031ee5/chrome/browser/push_messaging/push_messaging_notification_manager.h

Project Member Comment 22 by bugdroid1@chromium.org, Sep 9 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/03be8a1d1c74c06fbe79b6cb79b879b50213b83a

commit 03be8a1d1c74c06fbe79b6cb79b879b50213b83a
Author: harkness <harkness@chromium.org>
Date: Fri Sep 09 16:01:12 2016

Replace GURL in BudgetDatabase/BudgetManager with url::Origin

The Mojo service uses url::Origin, and that's the better way to be
storing origins, so converting over to using that instead of GURL. This
also does a bit of cleanup on the tests, which had a mix of methods which
took an origin argument and methods which created the origin internally.
Now the test has a member which is calculated once.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2324133002
Cr-Commit-Position: refs/heads/master@{#417593}

[modify] https://crrev.com/03be8a1d1c74c06fbe79b6cb79b879b50213b83a/chrome/browser/budget_service/budget_database.cc
[modify] https://crrev.com/03be8a1d1c74c06fbe79b6cb79b879b50213b83a/chrome/browser/budget_service/budget_database.h
[modify] https://crrev.com/03be8a1d1c74c06fbe79b6cb79b879b50213b83a/chrome/browser/budget_service/budget_database_unittest.cc
[modify] https://crrev.com/03be8a1d1c74c06fbe79b6cb79b879b50213b83a/chrome/browser/budget_service/budget_manager.cc
[modify] https://crrev.com/03be8a1d1c74c06fbe79b6cb79b879b50213b83a/chrome/browser/budget_service/budget_manager.h
[modify] https://crrev.com/03be8a1d1c74c06fbe79b6cb79b879b50213b83a/chrome/browser/budget_service/budget_manager_unittest.cc
[modify] https://crrev.com/03be8a1d1c74c06fbe79b6cb79b879b50213b83a/chrome/browser/budget_service/budget_service_impl.cc
[modify] https://crrev.com/03be8a1d1c74c06fbe79b6cb79b879b50213b83a/chrome/browser/push_messaging/push_messaging_notification_manager.cc

Project Member Comment 23 by bugdroid1@chromium.org, Sep 13 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0f9724adff9b52cbf22a2c7f7fdc579c0aeb13b8

commit 0f9724adff9b52cbf22a2c7f7fdc579c0aeb13b8
Author: harkness <harkness@chromium.org>
Date: Tue Sep 13 14:43:12 2016

Connect Mojo budget_service to BudgetManager implementation of Reserve.

This connects the Mojo service to the pre-existing implementation of
Reserve. It also updates the Reserve implementation to track both whether
the origin had enough budget to spend as well as whether there was an
error in reading or writing the database. Tests were updated to reflect
the new parameters, but no new tests were needed.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2326523003
Cr-Commit-Position: refs/heads/master@{#418244}

[modify] https://crrev.com/0f9724adff9b52cbf22a2c7f7fdc579c0aeb13b8/chrome/browser/budget_service/budget_database.cc
[modify] https://crrev.com/0f9724adff9b52cbf22a2c7f7fdc579c0aeb13b8/chrome/browser/budget_service/budget_database.h
[modify] https://crrev.com/0f9724adff9b52cbf22a2c7f7fdc579c0aeb13b8/chrome/browser/budget_service/budget_database_unittest.cc
[modify] https://crrev.com/0f9724adff9b52cbf22a2c7f7fdc579c0aeb13b8/chrome/browser/budget_service/budget_manager.cc
[modify] https://crrev.com/0f9724adff9b52cbf22a2c7f7fdc579c0aeb13b8/chrome/browser/budget_service/budget_manager.h
[modify] https://crrev.com/0f9724adff9b52cbf22a2c7f7fdc579c0aeb13b8/chrome/browser/budget_service/budget_manager_unittest.cc
[modify] https://crrev.com/0f9724adff9b52cbf22a2c7f7fdc579c0aeb13b8/chrome/browser/budget_service/budget_service_impl.cc

Project Member Comment 25 by bugdroid1@chromium.org, Oct 3 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9f633be4d10a0a77f21186cdd514ad883ee07656

commit 9f633be4d10a0a77f21186cdd514ad883ee07656
Author: harkness <harkness@chromium.org>
Date: Mon Oct 03 15:57:27 2016

Added browser tests to test the BudgetAPI. Also added BudgetAPI to ExperimentalWebPlatformFeatures.

Added browser tests to test the BudgetAPI. These test the getBudget()
and reserve() methods from Blink into the chrome layer. The correct
functioning is then tested by a direct call to BudgetManager::Consume.

Also added BudgetAPI to ExperimentalWebPlatformFeatures.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2370103003
Cr-Commit-Position: refs/heads/master@{#422431}

[add] https://crrev.com/9f633be4d10a0a77f21186cdd514ad883ee07656/chrome/browser/budget_service/budget_manager_browsertest.cc
[modify] https://crrev.com/9f633be4d10a0a77f21186cdd514ad883ee07656/chrome/test/BUILD.gn
[add] https://crrev.com/9f633be4d10a0a77f21186cdd514ad883ee07656/chrome/test/data/budget_service/budget_test.js
[add] https://crrev.com/9f633be4d10a0a77f21186cdd514ad883ee07656/chrome/test/data/budget_service/service_worker.js
[add] https://crrev.com/9f633be4d10a0a77f21186cdd514ad883ee07656/chrome/test/data/budget_service/test.html
[modify] https://crrev.com/9f633be4d10a0a77f21186cdd514ad883ee07656/chrome/test/data/push_messaging/push_test.js
[modify] https://crrev.com/9f633be4d10a0a77f21186cdd514ad883ee07656/chrome/test/data/push_messaging/subscope1/test.html
[modify] https://crrev.com/9f633be4d10a0a77f21186cdd514ad883ee07656/chrome/test/data/push_messaging/subscope2/test.html
[modify] https://crrev.com/9f633be4d10a0a77f21186cdd514ad883ee07656/chrome/test/data/push_messaging/test.html
[modify] https://crrev.com/9f633be4d10a0a77f21186cdd514ad883ee07656/chrome/test/data/push_messaging/test_no_subscription_options.html
[add] https://crrev.com/9f633be4d10a0a77f21186cdd514ad883ee07656/chrome/test/data/result_queue.js
[modify] https://crrev.com/9f633be4d10a0a77f21186cdd514ad883ee07656/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in

Project Member Comment 26 by bugdroid1@chromium.org, Nov 14 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6d52fba2161db44cb252088ec54ea0ae3b059072

commit 6d52fba2161db44cb252088ec54ea0ae3b059072
Author: harkness <harkness@chromium.org>
Date: Mon Nov 14 23:35:15 2016

Change the default budget expiration window to 4 days from 10 days.

The budget system uses a sliding window which is currently 10 days. That
window is used to set the expiration time for new budget and also to
control how much budget an origin can "save up" for future use.

Based on the UMA data on the updated Site Engagement algorithm in M55,
we can narrow that window while still giving sites an incentive not to
overspend budget.

This CL reduces the window from 10 days to 4 days. It also updates the
relevant tests, in a way that will be more flexible going forward.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2487073004
Cr-Commit-Position: refs/heads/master@{#431971}

[modify] https://crrev.com/6d52fba2161db44cb252088ec54ea0ae3b059072/chrome/browser/budget_service/budget_database.cc
[modify] https://crrev.com/6d52fba2161db44cb252088ec54ea0ae3b059072/chrome/browser/budget_service/budget_database_unittest.cc

Project Member Comment 27 by bugdroid1@chromium.org, Dec 5 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2b5939812baa7c97c1d908b10150d7ad7109dc31

commit 2b5939812baa7c97c1d908b10150d7ad7109dc31
Author: harkness <harkness@chromium.org>
Date: Mon Dec 05 09:53:22 2016

Added UMA for usage of BudgetAPI calls.

Although there are metrics for the budget and SES at the time that budget
is consumed, there isn't currently any tracking for which events in the
budget system come via the Budget API interface.

This adds two new metrics, to track queries and reserve requests. It also
adds some basic testing to ensure the metrics are being recorded.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2524533002
Cr-Commit-Position: refs/heads/master@{#436249}

[modify] https://crrev.com/2b5939812baa7c97c1d908b10150d7ad7109dc31/chrome/browser/budget_service/budget_manager.cc
[modify] https://crrev.com/2b5939812baa7c97c1d908b10150d7ad7109dc31/chrome/browser/budget_service/budget_manager.h
[modify] https://crrev.com/2b5939812baa7c97c1d908b10150d7ad7109dc31/chrome/browser/budget_service/budget_manager_unittest.cc
[modify] https://crrev.com/2b5939812baa7c97c1d908b10150d7ad7109dc31/tools/metrics/histograms/histograms.xml

Project Member Comment 28 by bugdroid1@chromium.org, Jan 6 2017
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/66cd34190886e221b7d79beac0b19cf6b2ebf633

commit 66cd34190886e221b7d79beac0b19cf6b2ebf633
Author: harkness <harkness@chromium.org>
Date: Fri Jan 06 14:57:46 2017

Convert budget LayoutTests to use promise_test.

The infrastructure of async_test LayoutTests was changed recently, and
one effect is that an assert inside an event listener will cause the
test to time out instead of returning the error. This makes the test
much more difficult to debug failures. Additionally, promise_test is just
nicer when it's easy to return a promise.

This CL updates the existing budget tests which run in service workers to
use promise_test. It also cleans up a bit of style.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2600733002
Cr-Commit-Position: refs/heads/master@{#441931}

[modify] https://crrev.com/66cd34190886e221b7d79beac0b19cf6b2ebf633/third_party/WebKit/LayoutTests/http/tests/budget/get-budget-in-service-worker.html
[modify] https://crrev.com/66cd34190886e221b7d79beac0b19cf6b2ebf633/third_party/WebKit/LayoutTests/http/tests/budget/get-cost-fails-in-service-worker.html
[modify] https://crrev.com/66cd34190886e221b7d79beac0b19cf6b2ebf633/third_party/WebKit/LayoutTests/http/tests/budget/get-cost-in-service-worker.html
[modify] https://crrev.com/66cd34190886e221b7d79beac0b19cf6b2ebf633/third_party/WebKit/LayoutTests/http/tests/budget/interfaces-in-service-worker.html
[modify] https://crrev.com/66cd34190886e221b7d79beac0b19cf6b2ebf633/third_party/WebKit/LayoutTests/http/tests/budget/reserve-in-service-worker.html

Project Member Comment 29 by bugdroid1@chromium.org, Jan 16 2017
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ccdc3f3aef6ac41aba49b35a754e24961ace471a

commit ccdc3f3aef6ac41aba49b35a754e24961ace471a
Author: harkness <harkness@chromium.org>
Date: Mon Jan 16 12:42:17 2017

Refactor budget computation to be more tuneable.

Previously, the budget computation used a single master value,
kBudgetDurationInHours to control both how long awards were valid and
also indirectly, how much budget an origin received per hour. The fixed
value in the system was that an origin received SES_score budget per
kBudgetDurationInHours hours.

The side effect of this indirect effect is that if chromium wants
for awards to last shorter periods of time, then the origin will get
larger grants of budget. So modifying the duration increases the amount
of work the origin can do, which is usually unintended.

A previous CL did exactly that, decreasing the duration and unintentionally
increasing the amount of work that can be done.

This CL modifies the calculation to use two values. The duration is still
there and is used to determine how much budget the origin has been granted
recently and how long new grants should last. A new value provides a target
budget for a maximally engaged origin, is used to provide a fixed upper
limit for budget granted to the origin. Finally, this CL reverses the earlier
unintentional increase in daily budget. Before this patch, full engagement
origins received 100 budget per 4 days, now they receive 48 per 4 days.

Tests were also updated to use the new computation.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2620393002
Cr-Commit-Position: refs/heads/master@{#443874}

[modify] https://crrev.com/ccdc3f3aef6ac41aba49b35a754e24961ace471a/chrome/browser/budget_service/budget_database.cc
[modify] https://crrev.com/ccdc3f3aef6ac41aba49b35a754e24961ace471a/chrome/browser/budget_service/budget_database_unittest.cc
[modify] https://crrev.com/ccdc3f3aef6ac41aba49b35a754e24961ace471a/chrome/browser/budget_service/budget_manager_browsertest.cc
[modify] https://crrev.com/ccdc3f3aef6ac41aba49b35a754e24961ace471a/chrome/browser/budget_service/budget_manager_unittest.cc
[modify] https://crrev.com/ccdc3f3aef6ac41aba49b35a754e24961ace471a/chrome/browser/push_messaging/push_messaging_browsertest.cc
[modify] https://crrev.com/ccdc3f3aef6ac41aba49b35a754e24961ace471a/third_party/WebKit/LayoutTests/http/tests/budget/budget-service-mock.js
[modify] https://crrev.com/ccdc3f3aef6ac41aba49b35a754e24961ace471a/third_party/WebKit/Source/modules/budget/BudgetService.cpp

Project Member Comment 30 by bugdroid1@chromium.org, Feb 8 2017
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/24fb1c0d8ccf3d2ed71d341d925ac337253bfef3

commit 24fb1c0d8ccf3d2ed71d341d925ac337253bfef3
Author: harkness <harkness@chromium.org>
Date: Wed Feb 08 18:03:56 2017

Removing old prefs storage for BudgetManager

Originally, the BudgetManager stored the budget for an origin in the
prefs in kBacgkroundBudgetMap. As the data stored became more complicated,
it switched to using the BudgetDatabase, which is a LevelDB wrapper. The
prefs storage mechanism was deprecated in Chrome 56 and code added to
cleanup any stored data there.

Now that Chrome 57 has branched, we can remove the cleanup code and any
remaining prefs artifacts.

BUG= 617971 

Review-Url: https://codereview.chromium.org/2682073002
Cr-Commit-Position: refs/heads/master@{#449035}

[modify] https://crrev.com/24fb1c0d8ccf3d2ed71d341d925ac337253bfef3/chrome/browser/budget_service/budget_manager.cc
[modify] https://crrev.com/24fb1c0d8ccf3d2ed71d341d925ac337253bfef3/chrome/browser/budget_service/budget_manager.h
[modify] https://crrev.com/24fb1c0d8ccf3d2ed71d341d925ac337253bfef3/chrome/browser/prefs/browser_prefs.cc
[modify] https://crrev.com/24fb1c0d8ccf3d2ed71d341d925ac337253bfef3/chrome/common/pref_names.cc
[modify] https://crrev.com/24fb1c0d8ccf3d2ed71d341d925ac337253bfef3/chrome/common/pref_names.h

Status: Fixed
Sign in to add a comment