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

Issue 778243002: Push API: Return cached registration if available. (Closed)

Created:
6 years ago by johnme
Modified:
6 years ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, asvitkine+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@store2
Project:
chromium
Visibility:
Public.

Description

Push API: Return cached registration if available. This is the implementation for the following steps of the register algorithm[1]: 'If the webapp is already registered, run the following substeps: 1. Retrieve the push registration associated with the webapp. 2. If there is an error, reject promise with a DOMException whose name is "AbortError" and terminate these steps. 3. When the request has been completed, resolve promise with a PushRegistration providing the details of the retrieved push registration.' Currently the implementation assumes that errors can be recovered from and attempts to do a fresh push registration if accessing storage fails; I left a TODO for us to decide this case later. Depends on https://codereview.chromium.org/785983002 [1]: https://w3c.github.io/push-api/#widl-PushRegistrationManager-register-Promise-PushRegistration BUG=401422, 429212 Committed: https://crrev.com/ce39d41c13db11a69564ba2299f7e83d3fa05c3c Cr-Commit-Position: refs/heads/master@{#308135}

Patch Set 1 #

Patch Set 2 : Add test, refactor and rebase #

Total comments: 4

Patch Set 3 : Address review comments #

Total comments: 6

Patch Set 4 : Address review comments v2 #

Patch Set 5 : Rebase #

Patch Set 6 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+210 lines, -69 lines) Patch
M chrome/browser/services/gcm/push_messaging_browsertest.cc View 1 2 3 4 7 chunks +89 lines, -44 lines 0 comments Download
M chrome/browser/services/gcm/push_messaging_service_impl.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/push_messaging/push_test.js View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
A + chrome/test/data/push_messaging/subscope1/service_worker.js View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A chrome/test/data/push_messaging/subscope1/test.html View 1 2 3 4 1 chunk +11 lines, -0 lines 0 comments Download
A + chrome/test/data/push_messaging/subscope2/service_worker.js View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A chrome/test/data/push_messaging/subscope2/test.html View 1 2 3 4 1 chunk +11 lines, -0 lines 0 comments Download
M content/browser/push_messaging/push_messaging_message_filter.h View 1 2 3 4 2 chunks +13 lines, -0 lines 0 comments Download
M content/browser/push_messaging/push_messaging_message_filter.cc View 1 2 3 4 7 chunks +59 lines, -14 lines 0 comments Download
M content/public/common/push_messaging_status.h View 1 2 2 chunks +11 lines, -3 lines 0 comments Download
M content/public/common/push_messaging_status.cc View 1 2 2 chunks +5 lines, -2 lines 0 comments Download
M content/shell/browser/layout_test/layout_test_push_messaging_service.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M tools/metrics/histograms/histograms.xml View 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 23 (6 generated)
johnme
mvanouwerkerk@chromium.org: Please review overall patch. avi@chromium.org: Please approve changes to content/public/common/push_messaging_status.* isherman@chromium.org: Please review changes ...
6 years ago (2014-12-08 18:56:41 UTC) #2
Ilya Sherman
On 2014/12/08 18:56:41, johnme wrote: > mailto:isherman@chromium.org: Please review changes to > tools/metrics/histograms/histograms.xml > (note ...
6 years ago (2014-12-09 00:30:06 UTC) #3
Ilya Sherman
https://codereview.chromium.org/778243002/diff/20001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/778243002/diff/20001/tools/metrics/histograms/histograms.xml#newcode53743 tools/metrics/histograms/histograms.xml:53743: + <int value="1" label="Successful (from cache)"/> Is the is ...
6 years ago (2014-12-09 00:30:53 UTC) #4
Avi (use Gerrit)
content/public lgtm
6 years ago (2014-12-09 06:22:52 UTC) #5
Michael van Ouwerkerk
https://codereview.chromium.org/778243002/diff/20001/chrome/browser/services/gcm/push_messaging_browsertest.cc File chrome/browser/services/gcm/push_messaging_browsertest.cc (right): https://codereview.chromium.org/778243002/diff/20001/chrome/browser/services/gcm/push_messaging_browsertest.cc#newcode193 chrome/browser/services/gcm/push_messaging_browsertest.cc:193: ASSERT_EQ("ok - service worker registered", script_result); It would be ...
6 years ago (2014-12-09 11:34:56 UTC) #6
johnme
Addressed review comments On 2014/12/09 00:30:06, Ilya Sherman wrote: > On 2014/12/08 18:56:41, johnme wrote: ...
6 years ago (2014-12-11 16:15:17 UTC) #7
Michael van Ouwerkerk
https://codereview.chromium.org/778243002/diff/40001/chrome/browser/services/gcm/push_messaging_browsertest.cc File chrome/browser/services/gcm/push_messaging_browsertest.cc (right): https://codereview.chromium.org/778243002/diff/40001/chrome/browser/services/gcm/push_messaging_browsertest.cc#newcode150 chrome/browser/services/gcm/push_messaging_browsertest.cc:150: void LoadSubscope1TestPage() { These methods repeat a lot of ...
6 years ago (2014-12-11 17:12:53 UTC) #8
johnme
Addressed Michael's review comments v2 https://codereview.chromium.org/778243002/diff/40001/chrome/browser/services/gcm/push_messaging_browsertest.cc File chrome/browser/services/gcm/push_messaging_browsertest.cc (right): https://codereview.chromium.org/778243002/diff/40001/chrome/browser/services/gcm/push_messaging_browsertest.cc#newcode150 chrome/browser/services/gcm/push_messaging_browsertest.cc:150: void LoadSubscope1TestPage() { On ...
6 years ago (2014-12-11 18:32:34 UTC) #9
Michael van Ouwerkerk
lgtm thanks John!
6 years ago (2014-12-11 18:53:11 UTC) #10
Ilya Sherman
histograms lgtm -- thanks
6 years ago (2014-12-11 23:38:55 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/778243002/60001
6 years ago (2014-12-12 09:56:42 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/30006)
6 years ago (2014-12-12 10:00:59 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/778243002/80001
6 years ago (2014-12-12 14:47:30 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_clang_dbg_recipe/builds/30412) linux_chromium_gn_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_rel/builds/42422)
6 years ago (2014-12-12 15:08:23 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/778243002/100001
6 years ago (2014-12-12 17:49:48 UTC) #21
commit-bot: I haz the power
Committed patchset #6 (id:100001)
6 years ago (2014-12-12 18:59:24 UTC) #22
commit-bot: I haz the power
6 years ago (2014-12-12 19:00:19 UTC) #23
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/ce39d41c13db11a69564ba2299f7e83d3fa05c3c
Cr-Commit-Position: refs/heads/master@{#308135}

Powered by Google App Engine
This is Rietveld 408576698