New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 602244 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Notification grace should use an engagement based heuristic.

Project Member Reported by harkness@chromium.org, Apr 11 2016

Issue description

In chromium, developers are required to show a notification whenever they receive a push message when their webapp is not the foreground tab. If the app doesn't show a notification, then chromium shows a default notification.

In case the webapp makes an occasional mistake and doesn't show a notification when it needs to, the system has a grace limit, where it will suppress the default notification. That level is currently hard coded to 1 out of 10 notifications can be "missed" without triggering the default notification.

We should replace this hard coded limit with something more flexible, based on the Site Engagement Service which is available in 51. 
 

Comment 1 by peter@chromium.org, Apr 11 2016

Cc: peter@chromium.org
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/373eb22ed62aaacd9d9e77c3843601eb88de7bf7

commit 373eb22ed62aaacd9d9e77c3843601eb88de7bf7
Author: harkness <harkness@chromium.org>
Date: Tue Apr 12 14:40:46 2016

Background service worker push message processing

This is the first part of a many-part project to add a framework for
service workers to perform background processing on behalf of the user
in response to a push message but without always showing a visible
notification to the user.

In the inital implementation, chrome's 1 in 10 grace period will be
replaced with a heuristic based budget derrived from the Site Engagement
Score.

This patch begins the road to that goal. We have created a new class,
the BackgroundBudgetService which lives in chrome/browser/push_messaging.
The implementation of the class is just to provide the grace period
tracking that was previously provided in
content/public/browser/push_messaging_service.cc. The backing storage has
also been changed to the user prefs instead of the service_worker_context
storage.

The next stage of implementation will replace the grace period tracking
with budget tracking and tie into the SiteEngagementService.

BUG=576837, 602244 

Review URL: https://codereview.chromium.org/1861683002

Cr-Commit-Position: refs/heads/master@{#386683}

[modify] https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7/chrome/browser/prefs/browser_prefs.cc
[add] https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7/chrome/browser/push_messaging/background_budget_service.cc
[add] https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7/chrome/browser/push_messaging/background_budget_service.h
[add] https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7/chrome/browser/push_messaging/background_budget_service_unittest.cc
[modify] https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7/chrome/browser/push_messaging/push_messaging_notification_manager.cc
[modify] https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7/chrome/browser/push_messaging/push_messaging_notification_manager.h
[modify] https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7/chrome/chrome_browser.gypi
[modify] https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7/chrome/chrome_tests_unit.gypi
[modify] https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7/chrome/common/pref_names.cc
[modify] https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7/chrome/common/pref_names.h
[modify] https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7/content/public/browser/push_messaging_service.cc
[modify] https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7/content/public/browser/push_messaging_service.h

Project Member

Comment 3 by bugdroid1@chromium.org, Apr 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0c1cff9f04f8884ff43d6be2ee003618c80a9db5

commit 0c1cff9f04f8884ff43d6be2ee003618c80a9db5
Author: harkness <harkness@chromium.org>
Date: Fri Apr 15 13:24:24 2016

This code converts the previously static class of BackgroundBudgetService to a
KeyedService, which is tied to the lifetime of the Profile.

This immediately gives dependency tracking via the factory dependency, and
allows better test writing going forward.

This is part of a many-part project to add a framework for
service workers to perform background processing on behalf of the user
in response to a push message but without always showing a visible
notification to the user.

BUG= 602244 

Review URL: https://codereview.chromium.org/1889513004

Cr-Commit-Position: refs/heads/master@{#387587}

[modify] https://crrev.com/0c1cff9f04f8884ff43d6be2ee003618c80a9db5/chrome/browser/push_messaging/background_budget_service.cc
[modify] https://crrev.com/0c1cff9f04f8884ff43d6be2ee003618c80a9db5/chrome/browser/push_messaging/background_budget_service.h
[add] https://crrev.com/0c1cff9f04f8884ff43d6be2ee003618c80a9db5/chrome/browser/push_messaging/background_budget_service_factory.cc
[add] https://crrev.com/0c1cff9f04f8884ff43d6be2ee003618c80a9db5/chrome/browser/push_messaging/background_budget_service_factory.h
[modify] https://crrev.com/0c1cff9f04f8884ff43d6be2ee003618c80a9db5/chrome/browser/push_messaging/background_budget_service_unittest.cc
[modify] https://crrev.com/0c1cff9f04f8884ff43d6be2ee003618c80a9db5/chrome/browser/push_messaging/push_messaging_notification_manager.cc
[modify] https://crrev.com/0c1cff9f04f8884ff43d6be2ee003618c80a9db5/chrome/browser/push_messaging/push_messaging_service_factory.cc
[modify] https://crrev.com/0c1cff9f04f8884ff43d6be2ee003618c80a9db5/chrome/chrome_browser.gypi

Project Member

Comment 4 by bugdroid1@chromium.org, May 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a942309be50c300eb6b18142e3feacf04d66649d

commit a942309be50c300eb6b18142e3feacf04d66649d
Author: harkness <harkness@chromium.org>
Date: Fri May 13 16:15:41 2016

This code replaces the existing 1 in 10 grace period with an accumulating
budget based on the site engagemene score for the origin.

This also allowed extensive simplification in the
PushMessagingNotificationManager, since we no longer need to update the
stored information when a notification is displayed.

This is the second part of a many-part project to add a framework for
service workers to perform background processing on behalf of the user
in response to a push message but without always showing a visible
notification to the user.

BUG= 602244 

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

[modify] https://crrev.com/a942309be50c300eb6b18142e3feacf04d66649d/chrome/browser/push_messaging/background_budget_service.cc
[modify] https://crrev.com/a942309be50c300eb6b18142e3feacf04d66649d/chrome/browser/push_messaging/background_budget_service.h
[modify] https://crrev.com/a942309be50c300eb6b18142e3feacf04d66649d/chrome/browser/push_messaging/background_budget_service_factory.cc
[modify] https://crrev.com/a942309be50c300eb6b18142e3feacf04d66649d/chrome/browser/push_messaging/background_budget_service_unittest.cc
[modify] https://crrev.com/a942309be50c300eb6b18142e3feacf04d66649d/chrome/browser/push_messaging/push_messaging_browsertest.cc
[modify] https://crrev.com/a942309be50c300eb6b18142e3feacf04d66649d/chrome/browser/push_messaging/push_messaging_notification_manager.cc
[modify] https://crrev.com/a942309be50c300eb6b18142e3feacf04d66649d/chrome/browser/push_messaging/push_messaging_notification_manager.h

Project Member

Comment 5 by bugdroid1@chromium.org, May 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3f1dda7398a661f1c4e7834674bd450500007ff9

commit 3f1dda7398a661f1c4e7834674bd450500007ff9
Author: harkness <harkness@chromium.org>
Date: Thu May 19 23:30:56 2016

Added UMA stats to track the budget for any service worker which receives a
push notification and the SES score for service workers which have a low/no
budget at the time of processing a push notification.

This will be used to tune the heuristic for allowing service workers to do
background processing without notifying the user every time.

BUG= 602244 

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

[modify] https://crrev.com/3f1dda7398a661f1c4e7834674bd450500007ff9/chrome/browser/push_messaging/background_budget_service.cc
[modify] https://crrev.com/3f1dda7398a661f1c4e7834674bd450500007ff9/chrome/browser/push_messaging/background_budget_service.h
[modify] https://crrev.com/3f1dda7398a661f1c4e7834674bd450500007ff9/chrome/browser/push_messaging/background_budget_service_unittest.cc
[modify] https://crrev.com/3f1dda7398a661f1c4e7834674bd450500007ff9/chrome/browser/push_messaging/push_messaging_browsertest.cc
[modify] https://crrev.com/3f1dda7398a661f1c4e7834674bd450500007ff9/chrome/browser/push_messaging/push_messaging_notification_manager.cc
[modify] https://crrev.com/3f1dda7398a661f1c4e7834674bd450500007ff9/chrome/browser/push_messaging/push_messaging_notification_manager.h
[modify] https://crrev.com/3f1dda7398a661f1c4e7834674bd450500007ff9/tools/metrics/histograms/histograms.xml

Project Member

Comment 6 by bugdroid1@chromium.org, Jun 2 2016

Status: Fixed (was: Assigned)

Sign in to add a comment