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

Issue 2469293002: Handle push resubscribes with no sender info (avoids DCHECK) (Closed)

Created:
4 years, 1 month ago by awdf
Modified:
4 years, 1 month ago
Reviewers:
johnme, harkness
CC:
chromium-reviews, Peter Beverloo, darin-cc_chromium.org, johnme+watch_chromium.org, jam, harkness+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Handle push resubscribes with no sender info (avoids DCHECK) - Prior to this patch you would fail a DCHECK if you called PushManager.subscribe() with a sender id or key and then PushManager.subscribe() without a sender id or key. - This fixes that and only allows resubscribing with no sender info when the original subscribe was made with a gcm_sender_id. Otherwise we throw an AbortError - no key provided. BUG=659230 Committed: https://crrev.com/d8e7aa32e6e15b1ce0cde3a6ccf878fb16ffc816 Cr-Commit-Position: refs/heads/master@{#430601}

Patch Set 1 #

Total comments: 18

Patch Set 2 : Review comments, fixup SubscribeWorker test #

Total comments: 7

Patch Set 3 : Move logic to DidGetSenderIdFromStorage #

Patch Set 4 : Remove redundant bool from DidGetSenderId and tidy it up a bit #

Total comments: 6

Patch Set 5 : Comments from patch set 4 #

Patch Set 6 : rebase #

Total comments: 47

Patch Set 7 : Addressing johnme@'s comments on push_messaging_message_filter code #

Patch Set 8 : Split the code path for registered/unregistered as in patch set 2; comments #

Total comments: 6

Patch Set 9 : responding to more comments #

Total comments: 1

Patch Set 10 : call it fixed_sender_id when it is (hopefully) fixed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+309 lines, -32 lines) Patch
M chrome/browser/push_messaging/push_messaging_browsertest.cc View 1 2 3 4 5 6 7 8 4 chunks +237 lines, -18 lines 0 comments Download
M chrome/test/data/push_messaging/push_test.js View 1 2 3 4 5 6 7 2 chunks +20 lines, -1 line 0 comments Download
M chrome/test/data/push_messaging/service_worker.js View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
A + chrome/test/data/push_messaging/test_no_manifest.html View 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/push_messaging/push_messaging_message_filter.cc View 1 2 3 4 5 6 7 8 9 4 chunks +49 lines, -12 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 47 (21 generated)
awdf
+harkness for review
4 years, 1 month ago (2016-11-02 13:52:06 UTC) #4
chromium-reviews
Forgot to say, you might wanna check out the doc linked on the ticket if ...
4 years, 1 month ago (2016-11-02 13:56:50 UTC) #5
awdf
https://codereview.chromium.org/2469293002/diff/1/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/2469293002/diff/1/content/browser/push_messaging/push_messaging_message_filter.cc#newcode386 content/browser/push_messaging/push_messaging_message_filter.cc:386: // Reject subscribes with no sender info, unless the ...
4 years, 1 month ago (2016-11-02 15:03:01 UTC) #8
harkness
https://codereview.chromium.org/2469293002/diff/1/chrome/browser/push_messaging/push_messaging_browsertest.cc File chrome/browser/push_messaging/push_messaging_browsertest.cc (right): https://codereview.chromium.org/2469293002/diff/1/chrome/browser/push_messaging/push_messaging_browsertest.cc#newcode677 chrome/browser/push_messaging/push_messaging_browsertest.cc:677: // This should also fail as the original key ...
4 years, 1 month ago (2016-11-02 18:48:12 UTC) #9
awdf
I am still working on the further refactor to move logic to DidGetSenderIdFromStorage - I ...
4 years, 1 month ago (2016-11-03 14:10:11 UTC) #10
awdf
https://codereview.chromium.org/2469293002/diff/1/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/2469293002/diff/1/content/browser/push_messaging/push_messaging_message_filter.cc#newcode294 content/browser/push_messaging/push_messaging_message_filter.cc:294: const std::vector<std::string>& push_registration_id_and_sender_id, On 2016/11/03 14:10:11, awdf wrote: > ...
4 years, 1 month ago (2016-11-03 14:21:21 UTC) #11
awdf
Moved the logic to the other method in the latest patch. Which involved changing its ...
4 years, 1 month ago (2016-11-03 15:08:27 UTC) #12
harkness
https://codereview.chromium.org/2469293002/diff/1/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/2469293002/diff/1/content/browser/push_messaging/push_messaging_message_filter.cc#newcode294 content/browser/push_messaging/push_messaging_message_filter.cc:294: const std::vector<std::string>& push_registration_id_and_sender_id, On 2016/11/03 14:21:21, awdf wrote: > ...
4 years, 1 month ago (2016-11-03 15:09:28 UTC) #13
awdf
https://codereview.chromium.org/2469293002/diff/20001/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/2469293002/diff/20001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode300 content/browser/push_messaging/push_messaging_message_filter.cc:300: const auto& stored_sender_id = push_registration_id_and_sender_id[1]; On 2016/11/03 15:09:28, harkness ...
4 years, 1 month ago (2016-11-03 15:44:14 UTC) #14
harkness
https://codereview.chromium.org/2469293002/diff/20001/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/2469293002/diff/20001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode301 content/browser/push_messaging/push_messaging_message_filter.cc:301: bool stored_sender_id_is_numeric = On 2016/11/03 15:44:13, awdf wrote: > ...
4 years, 1 month ago (2016-11-03 17:05:22 UTC) #19
awdf
https://codereview.chromium.org/2469293002/diff/60001/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/2469293002/diff/60001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode316 content/browser/push_messaging/push_messaging_message_filter.cc:316: // There is no existing registration and the sender_info ...
4 years, 1 month ago (2016-11-03 17:19:43 UTC) #20
harkness
lgtm
4 years, 1 month ago (2016-11-03 18:08:21 UTC) #21
awdf
+johnme@ for OWNERS review
4 years, 1 month ago (2016-11-03 18:24:56 UTC) #25
johnme
Initial comments (haven't yet looked at tests) https://codereview.chromium.org/2469293002/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/2469293002/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode283 content/browser/push_messaging/push_messaging_message_filter.cc:283: data.requesting_origin = ...
4 years, 1 month ago (2016-11-04 14:46:12 UTC) #26
awdf
let me know if this is good enough or you want something more similar to ...
4 years, 1 month ago (2016-11-04 16:21:36 UTC) #27
johnme
On 2016/11/04 16:21:36, awdf wrote: > let me know if this is good enough or ...
4 years, 1 month ago (2016-11-04 16:48:19 UTC) #28
johnme
Tests look good. I left a few comments (on patch set 6, which was current ...
4 years, 1 month ago (2016-11-04 17:43:37 UTC) #29
awdf
On 2016/11/04 16:48:19, johnme wrote: > On 2016/11/04 16:21:36, awdf wrote: > > let me ...
4 years, 1 month ago (2016-11-07 12:24:59 UTC) #30
johnme
On 2016/11/07 12:24:59, awdf wrote: > On 2016/11/04 16:48:19, johnme wrote: > > On 2016/11/04 ...
4 years, 1 month ago (2016-11-07 13:38:54 UTC) #31
awdf
https://codereview.chromium.org/2469293002/diff/1/chrome/test/data/push_messaging/service_worker.js File chrome/test/data/push_messaging/service_worker.js (right): https://codereview.chromium.org/2469293002/diff/1/chrome/test/data/push_messaging/service_worker.js#newcode54 chrome/test/data/push_messaging/service_worker.js:54: } else if (event.data.command == 'workerSubscribePushWithNumber') { On 2016/11/03 ...
4 years, 1 month ago (2016-11-07 16:54:31 UTC) #34
johnme
Code looks good, thanks! A few replies and nits about the tests. https://codereview.chromium.org/2469293002/diff/100001/chrome/browser/push_messaging/push_messaging_browsertest.cc File chrome/browser/push_messaging/push_messaging_browsertest.cc ...
4 years, 1 month ago (2016-11-07 18:11:59 UTC) #35
awdf
https://codereview.chromium.org/2469293002/diff/100001/chrome/browser/push_messaging/push_messaging_browsertest.cc File chrome/browser/push_messaging/push_messaging_browsertest.cc (right): https://codereview.chromium.org/2469293002/diff/100001/chrome/browser/push_messaging/push_messaging_browsertest.cc#newcode593 chrome/browser/push_messaging/push_messaging_browsertest.cc:593: ResubscribeWithoutKeyAfterSubscribingWithKeyInManifest) { On 2016/11/07 18:11:59, johnme wrote: > On ...
4 years, 1 month ago (2016-11-07 19:13:23 UTC) #36
johnme
lgtm, looks great, thanks for your patience! :) https://codereview.chromium.org/2469293002/diff/200001/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/2469293002/diff/200001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode327 content/browser/push_messaging/push_messaging_message_filter.cc:327: // ...
4 years, 1 month ago (2016-11-08 11:58:08 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2469293002/220001
4 years, 1 month ago (2016-11-08 13:00:07 UTC) #44
commit-bot: I haz the power
Committed patchset #10 (id:220001)
4 years, 1 month ago (2016-11-08 14:01:37 UTC) #45
commit-bot: I haz the power
4 years, 1 month ago (2016-11-08 14:05:30 UTC) #47
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/d8e7aa32e6e15b1ce0cde3a6ccf878fb16ffc816
Cr-Commit-Position: refs/heads/master@{#430601}

Powered by Google App Engine
This is Rietveld 408576698