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

Issue 1861683002: Background service worker push message processing (Closed)

Created:
4 years, 8 months ago by harkness
Modified:
4 years, 8 months ago
CC:
chromium-reviews, Peter Beverloo, johnme+watch_chromium.org, jam, mvanouwerkerk+watch_chromium.org, darin-cc_chromium.org, harkness+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7 Cr-Commit-Position: refs/heads/master@{#386683}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Switched the key to origin and added tests. #

Total comments: 30

Patch Set 3 : Integrated code review comments #

Total comments: 8

Patch Set 4 : Made service static and synchronous #

Total comments: 4

Patch Set 5 : Cleaned up unit test #

Patch Set 6 : Removed RunLoop #

Total comments: 12

Patch Set 7 : Integrate code review comments #

Total comments: 1

Patch Set 8 : dcheck ordering #

Unified diffs Side-by-side diffs Delta from patch set Stats (+165 lines, -108 lines) Patch
M chrome/browser/prefs/browser_prefs.cc View 2 chunks +2 lines, -0 lines 0 comments Download
A chrome/browser/push_messaging/background_budget_service.h View 1 2 3 4 5 6 1 chunk +43 lines, -0 lines 0 comments Download
A chrome/browser/push_messaging/background_budget_service.cc View 1 2 3 1 chunk +48 lines, -0 lines 0 comments Download
A chrome/browser/push_messaging/background_budget_service_unittest.cc View 1 2 3 4 5 6 7 1 chunk +50 lines, -0 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_notification_manager.h View 1 chunk +6 lines, -9 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_notification_manager.cc View 1 2 3 5 chunks +9 lines, -22 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/pref_names.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M content/public/browser/push_messaging_service.h View 2 chunks +0 lines, -17 lines 0 comments Download
M content/public/browser/push_messaging_service.cc View 4 chunks +0 lines, -60 lines 0 comments Download

Messages

Total messages: 41 (15 generated)
harkness
4 years, 8 months ago (2016-04-05 13:35:25 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1861683002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1861683002/1
4 years, 8 months ago (2016-04-05 14:01:36 UTC) #4
Michael van Ouwerkerk
https://codereview.chromium.org/1861683002/diff/1/chrome/common/pref_names.cc File chrome/common/pref_names.cc (right): https://codereview.chromium.org/1861683002/diff/1/chrome/common/pref_names.cc#newcode1204 chrome/common/pref_names.cc:1204: // Maps from service worker id to background budget ...
4 years, 8 months ago (2016-04-05 14:05:52 UTC) #5
harkness
https://codereview.chromium.org/1861683002/diff/1/chrome/common/pref_names.cc File chrome/common/pref_names.cc (right): https://codereview.chromium.org/1861683002/diff/1/chrome/common/pref_names.cc#newcode1204 chrome/common/pref_names.cc:1204: // Maps from service worker id to background budget ...
4 years, 8 months ago (2016-04-05 14:33:40 UTC) #6
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-05 15:03:36 UTC) #8
harkness
Switched the key for the prefs info over to origin. Also added some unit tests.
4 years, 8 months ago (2016-04-05 15:36:16 UTC) #9
harkness
Updated for real now.
4 years, 8 months ago (2016-04-05 16:05:35 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1861683002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1861683002/20001
4 years, 8 months ago (2016-04-05 16:06:02 UTC) #12
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-05 17:15:26 UTC) #14
Peter Beverloo
Cool, great to see the progress here :-). Because this CL already moves storage of ...
4 years, 8 months ago (2016-04-08 10:41:11 UTC) #15
harkness
High level comments: - My first start on the implementation was doing the SES and ...
4 years, 8 months ago (2016-04-08 14:11:43 UTC) #17
Peter Beverloo
https://codereview.chromium.org/1861683002/diff/20001/chrome/browser/push_messaging/background_budget_service.cc File chrome/browser/push_messaging/background_budget_service.cc (right): https://codereview.chromium.org/1861683002/diff/20001/chrome/browser/push_messaging/background_budget_service.cc#newcode45 chrome/browser/push_messaging/background_budget_service.cc:45: callback.Run(map_value); On 2016/04/08 14:11:43, harkness wrote: > On 2016/04/08 ...
4 years, 8 months ago (2016-04-08 14:29:38 UTC) #18
harkness
On 2016/04/08 14:29:38, Peter Beverloo wrote: > If the code will by synchronous, let's not ...
4 years, 8 months ago (2016-04-11 09:37:37 UTC) #19
Peter Beverloo
lgtm, but please file and associate a bug for the larger project. https://codereview.chromium.org/1861683002/diff/60001/chrome/browser/push_messaging/background_budget_service_unittest.cc File chrome/browser/push_messaging/background_budget_service_unittest.cc ...
4 years, 8 months ago (2016-04-11 10:55:59 UTC) #20
harkness
https://codereview.chromium.org/1861683002/diff/60001/chrome/browser/push_messaging/background_budget_service_unittest.cc File chrome/browser/push_messaging/background_budget_service_unittest.cc (right): https://codereview.chromium.org/1861683002/diff/60001/chrome/browser/push_messaging/background_budget_service_unittest.cc#newcode52 chrome/browser/push_messaging/background_budget_service_unittest.cc:52: base::RunLoop().RunUntilIdle(); On 2016/04/11 10:55:59, Peter Beverloo wrote: > Please ...
4 years, 8 months ago (2016-04-11 13:21:35 UTC) #22
harkness
bauerb@chromium.org: Please review changes in chrome/browser/prefs/browser_prefs.cc
4 years, 8 months ago (2016-04-11 13:23:13 UTC) #24
Bernhard Bauer
https://codereview.chromium.org/1861683002/diff/100001/chrome/browser/push_messaging/background_budget_service.h File chrome/browser/push_messaging/background_budget_service.h (right): https://codereview.chromium.org/1861683002/diff/100001/chrome/browser/push_messaging/background_budget_service.h#newcode19 chrome/browser/push_messaging/background_budget_service.h:19: // A budget service to help chrome decide how ...
4 years, 8 months ago (2016-04-11 13:58:42 UTC) #25
harkness
https://codereview.chromium.org/1861683002/diff/100001/chrome/browser/push_messaging/background_budget_service.h File chrome/browser/push_messaging/background_budget_service.h (right): https://codereview.chromium.org/1861683002/diff/100001/chrome/browser/push_messaging/background_budget_service.h#newcode19 chrome/browser/push_messaging/background_budget_service.h:19: // A budget service to help chrome decide how ...
4 years, 8 months ago (2016-04-12 08:43:35 UTC) #26
Bernhard Bauer
LGTM https://codereview.chromium.org/1861683002/diff/120001/chrome/browser/push_messaging/background_budget_service_unittest.cc File chrome/browser/push_messaging/background_budget_service_unittest.cc (right): https://codereview.chromium.org/1861683002/diff/120001/chrome/browser/push_messaging/background_budget_service_unittest.cc#newcode38 chrome/browser/push_messaging/background_budget_service_unittest.cc:38: EXPECT_EQ(budget_string, std::string()); And expected value first, please :)
4 years, 8 months ago (2016-04-12 08:48:26 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1861683002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1861683002/140001
4 years, 8 months ago (2016-04-12 13:36:11 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/167498)
4 years, 8 months ago (2016-04-12 13:46:33 UTC) #32
harkness
avi@chromium.org: Please review changes in content/public/browser/push_messaging_service.*
4 years, 8 months ago (2016-04-12 13:57:42 UTC) #34
Avi (use Gerrit)
content lgtm
4 years, 8 months ago (2016-04-12 14:03:43 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1861683002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1861683002/140001
4 years, 8 months ago (2016-04-12 14:21:38 UTC) #37
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 8 months ago (2016-04-12 14:40:56 UTC) #39
commit-bot: I haz the power
4 years, 8 months ago (2016-04-12 14:43:06 UTC) #41
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/373eb22ed62aaacd9d9e77c3843601eb88de7bf7
Cr-Commit-Position: refs/heads/master@{#386683}

Powered by Google App Engine
This is Rietveld 408576698