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

Issue 883743002: Push API: Grace - allow one in ten pushes to show no notification. (Closed)

Created:
5 years, 11 months ago by johnme
Modified:
5 years, 10 months ago
CC:
chromium-reviews, zea+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@userdata
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Push API: Grace - allow one in ten pushes to show no notification. For developers who have opted in to showing a user-visible UI change on every push (in exchange for showing the user a less scary permission prompt), we currently[1] enforce that each push shows a notification. This patch allows one in ten pushes to show no notification, so occasional bugs in developer push handlers don't needlessly spam the user. Specifically, it keeps track of whether the last (up to) 10 push messages showed a notification (ignoring pushes didn't show a notification but were exempt, e.g. due to https://crrev.com/866443003) and only shows a forced notification if one of those (up to) 10 also failed to show a notification. [1]: (since https://crrev.com/842233003) BUG=437277 Committed: https://crrev.com/8b5b00d6cc8f02139c1d15209612ab4126de5add Cr-Commit-Position: refs/heads/master@{#314851}

Patch Set 1 #

Patch Set 2 : Use static methods on PushMessagingService to save state #

Total comments: 14

Patch Set 3 : Address review comments (e.g. use bitset) #

Total comments: 2

Patch Set 4 : Use anonymouse namespace #

Patch Set 5 : Fix Android to_string compile #

Patch Set 6 : Fix typo (invesed needed but not shown logic) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+292 lines, -86 lines) Patch
M chrome/browser/services/gcm/push_messaging_browsertest.cc View 1 2 chunks +40 lines, -21 lines 0 comments Download
M chrome/browser/services/gcm/push_messaging_service_impl.h View 1 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/services/gcm/push_messaging_service_impl.cc View 1 2 3 4 5 3 chunks +126 lines, -65 lines 0 comments Download
M content/content_browser.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/public/browser/push_messaging_service.h View 1 2 1 chunk +23 lines, -0 lines 0 comments Download
A content/public/browser/push_messaging_service.cc View 1 2 3 1 chunk +95 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (7 generated)
johnme
avi: please review content/public/browser/push_messaging_service.{h,cc} I added static methods to PushMessagingService as recommended by jochen/michaeln in ...
5 years, 10 months ago (2015-02-04 14:00:35 UTC) #2
Michael van Ouwerkerk
https://codereview.chromium.org/883743002/diff/20001/content/public/browser/push_messaging_service.cc File content/public/browser/push_messaging_service.cc (right): https://codereview.chromium.org/883743002/diff/20001/content/public/browser/push_messaging_service.cc#newcode1 content/public/browser/push_messaging_service.cc:1: // Copyright 2015 The Chromium Authors. All rights reserved. ...
5 years, 10 months ago (2015-02-04 15:51:33 UTC) #3
Avi (use Gerrit)
I must admit to being rather confused as to the whole UserData thing used here ...
5 years, 10 months ago (2015-02-04 16:16:57 UTC) #4
johnme
Thanks, addressed review comments. avi wrote: > I must admit to being rather confused as ...
5 years, 10 months ago (2015-02-04 17:57:41 UTC) #5
Avi (use Gerrit)
lgtm https://codereview.chromium.org/883743002/diff/40001/content/public/browser/push_messaging_service.cc File content/public/browser/push_messaging_service.cc (right): https://codereview.chromium.org/883743002/diff/40001/content/public/browser/push_messaging_service.cc#newcode12 content/public/browser/push_messaging_service.cc:12: static const char kNotificationsShownServiceWorkerKey[] = Don't use static ...
5 years, 10 months ago (2015-02-04 21:24:22 UTC) #6
Michael van Ouwerkerk
lgtm
5 years, 10 months ago (2015-02-05 11:23:20 UTC) #7
johnme
Thanks :) https://codereview.chromium.org/883743002/diff/40001/content/public/browser/push_messaging_service.cc File content/public/browser/push_messaging_service.cc (right): https://codereview.chromium.org/883743002/diff/40001/content/public/browser/push_messaging_service.cc#newcode12 content/public/browser/push_messaging_service.cc:12: static const char kNotificationsShownServiceWorkerKey[] = On 2015/02/04 ...
5 years, 10 months ago (2015-02-05 11:34:26 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/883743002/60001
5 years, 10 months ago (2015-02-05 11:35:42 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/56200)
5 years, 10 months ago (2015-02-05 11:45:47 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/883743002/100001
5 years, 10 months ago (2015-02-05 18:07:27 UTC) #17
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 10 months ago (2015-02-05 19:16:52 UTC) #18
commit-bot: I haz the power
5 years, 10 months ago (2015-02-05 19:18:39 UTC) #19
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/8b5b00d6cc8f02139c1d15209612ab4126de5add
Cr-Commit-Position: refs/heads/master@{#314851}

Powered by Google App Engine
This is Rietveld 408576698