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

Issue 2436393002: Disallow repeated PushManager.subscribes with different sender ids (Closed)

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

Description

Disallow repeated PushManager.subscribes with different sender ids - Now we throw an InvalidStateError if you try to subscribe again with a different sender id without unsubscribing first (instead of confusingly returning the end point associated with the previous sender id). - This still allows resubscribing with no key if the first subscription used a numeric gcm sender id and the second subscription is from a service worker (see crbug.com/659230) BUG=638924 Committed: https://crrev.com/b9dabcc3e279cb499c74e7d7e57765af5c21d91e Cr-Commit-Position: refs/heads/master@{#430692}

Patch Set 1 #

Patch Set 2 : Get registration id and sender id from storage at once #

Patch Set 3 : Add value to histograms enum, tidy blink test #

Patch Set 4 : Remove leftover method declaration from header file #

Patch Set 5 : Fail with an InvalidStateError, instead of an AbortError #

Patch Set 6 : Rename registration_id -> push_registration_id #

Total comments: 13

Patch Set 7 : make things const; fix up html test file #

Patch Set 8 : Make resubscribing for push with a different key trigger an InvalidStateError #

Patch Set 9 : rebase on b659230 fix; add browser test #

Total comments: 2

Patch Set 10 : Remove unnecessary ternary #

Patch Set 11 : Re-rebase on base patch #

Total comments: 6

Patch Set 12 : rebase and comments #

Total comments: 3

Patch Set 13 : oops - forgot js changes required for new browser test to pass #

Patch Set 14 : Make error message more informative #

Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -9 lines) Patch
M chrome/browser/push_messaging/push_messaging_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +56 lines, -0 lines 0 comments Download
M chrome/test/data/push_messaging/push_test.js View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/test/data/push_messaging/service_worker.js View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -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 10 11 1 chunk +4 lines, -2 lines 0 comments Download
M content/child/push_messaging/push_provider.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M content/public/common/push_messaging_status.h View 1 2 3 4 1 chunk +5 lines, -2 lines 0 comments Download
M content/public/common/push_messaging_status.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +5 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/push_messaging/subscribe-failure-mismatched-sender-id.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +57 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/push_messaging/PushError.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/modules/push_messaging/WebPushError.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 52 (25 generated)
awdf
+harkness for review
4 years, 1 month ago (2016-10-24 16:03:07 UTC) #11
harkness
https://codereview.chromium.org/2436393002/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/2436393002/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode300 content/browser/push_messaging/push_messaging_message_filter.cc:300: auto& sender_id = push_registration_id_and_sender_id[1]; These can be const. https://codereview.chromium.org/2436393002/diff/100001/third_party/WebKit/LayoutTests/http/tests/push_messaging/subscribe-failure-mismatched-sender-id.html ...
4 years, 1 month ago (2016-10-25 10:11:22 UTC) #12
johnme
Drive-by review comment https://codereview.chromium.org/2436393002/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/2436393002/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode301 content/browser/push_messaging/push_messaging_message_filter.cc:301: if (data.options.sender_info != sender_id) { data.options.sender_info ...
4 years, 1 month ago (2016-10-25 12:33:31 UTC) #13
awdf
On 2016/10/25 10:11:22, harkness wrote: > https://codereview.chromium.org/2436393002/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/2436393002/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode300 > ...
4 years, 1 month ago (2016-10-25 13:03:48 UTC) #14
blink-reviews
gah, replied in the wrong place, sorry. **runs off cursing rietveld** On Tue, 25 Oct ...
4 years, 1 month ago (2016-10-25 13:05:47 UTC) #15
chromium-reviews
gah, replied in the wrong place, sorry. **runs off cursing rietveld** On Tue, 25 Oct ...
4 years, 1 month ago (2016-10-25 13:05:48 UTC) #16
awdf
https://codereview.chromium.org/2436393002/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/2436393002/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode300 content/browser/push_messaging/push_messaging_message_filter.cc:300: auto& sender_id = push_registration_id_and_sender_id[1]; On 2016/10/25 10:11:22, harkness wrote: ...
4 years, 1 month ago (2016-10-25 13:18:18 UTC) #17
johnme
https://codereview.chromium.org/2436393002/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/2436393002/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode301 content/browser/push_messaging/push_messaging_message_filter.cc:301: if (data.options.sender_info != sender_id) { On 2016/10/25 13:18:18, awdf ...
4 years, 1 month ago (2016-10-25 13:28:25 UTC) #18
awdf
https://codereview.chromium.org/2436393002/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/2436393002/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode301 content/browser/push_messaging/push_messaging_message_filter.cc:301: if (data.options.sender_info != sender_id) { On 2016/10/25 13:28:25, johnme ...
4 years, 1 month ago (2016-10-25 13:50:37 UTC) #19
harkness
https://codereview.chromium.org/2436393002/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/2436393002/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode301 content/browser/push_messaging/push_messaging_message_filter.cc:301: if (data.options.sender_info != sender_id) { On 2016/10/25 13:50:36, awdf ...
4 years, 1 month ago (2016-10-25 14:25:21 UTC) #20
awdf
Have rebased on the other review for no-key-resubscribes ( https://codereview.chromium.org/2469293002/ ) so now the change ...
4 years, 1 month ago (2016-11-04 11:39:17 UTC) #21
awdf
https://codereview.chromium.org/2436393002/diff/160001/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/2436393002/diff/160001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode382 content/browser/push_messaging/push_messaging_message_filter.cc:382: data.options.sender_info.empty() ? sender_id[0] Here I can now always use ...
4 years, 1 month ago (2016-11-04 11:45:41 UTC) #22
awdf
https://codereview.chromium.org/2436393002/diff/160001/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/2436393002/diff/160001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode382 content/browser/push_messaging/push_messaging_message_filter.cc:382: data.options.sender_info.empty() ? sender_id[0] On 2016/11/04 11:45:41, awdf wrote: > ...
4 years, 1 month ago (2016-11-04 11:50:42 UTC) #23
harkness
lgtm % nits https://codereview.chromium.org/2436393002/diff/200001/chrome/browser/push_messaging/push_messaging_browsertest.cc File chrome/browser/push_messaging/push_messaging_browsertest.cc (right): https://codereview.chromium.org/2436393002/diff/200001/chrome/browser/push_messaging/push_messaging_browsertest.cc#newcode844 chrome/browser/push_messaging/push_messaging_browsertest.cc:844: EndpointToToken(script_result, false /* standard_protocol */)); If ...
4 years, 1 month ago (2016-11-08 11:56:59 UTC) #25
awdf
https://codereview.chromium.org/2436393002/diff/200001/chrome/browser/push_messaging/push_messaging_browsertest.cc File chrome/browser/push_messaging/push_messaging_browsertest.cc (right): https://codereview.chromium.org/2436393002/diff/200001/chrome/browser/push_messaging/push_messaging_browsertest.cc#newcode844 chrome/browser/push_messaging/push_messaging_browsertest.cc:844: EndpointToToken(script_result, false /* standard_protocol */)); On 2016/11/08 11:56:59, harkness ...
4 years, 1 month ago (2016-11-08 13:21:05 UTC) #26
awdf
+johnme@chromium.org for OWNERS review (you're an owner for all of it right?)
4 years, 1 month ago (2016-11-08 13:22:49 UTC) #28
johnme
lgtm with nit - thanks! > +johnme@chromium.org for OWNERS review (you're an owner for all ...
4 years, 1 month ago (2016-11-08 13:39:56 UTC) #31
awdf
https://codereview.chromium.org/2436393002/diff/220001/chrome/browser/push_messaging/push_messaging_browsertest.cc File chrome/browser/push_messaging/push_messaging_browsertest.cc (right): https://codereview.chromium.org/2436393002/diff/220001/chrome/browser/push_messaging/push_messaging_browsertest.cc#newcode833 chrome/browser/push_messaging/push_messaging_browsertest.cc:833: RunScript("workerSubscribePushWithNumericKey('11111')", &script_result)); I actually forgot to reapply the javascript ...
4 years, 1 month ago (2016-11-08 14:39:16 UTC) #32
harkness
lgtm still
4 years, 1 month ago (2016-11-08 16:18:35 UTC) #37
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/2436393002/260001
4 years, 1 month ago (2016-11-08 16:19:30 UTC) #40
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/299547)
4 years, 1 month ago (2016-11-08 16:27:44 UTC) #42
awdf
avi@chromium.org: Please review changes in content/public jwd@chromium.org: Please review changes in tools/metrics/histograms/histograms.xml Thanks!
4 years, 1 month ago (2016-11-08 17:32:06 UTC) #44
Avi (use Gerrit)
lgtm 👍
4 years, 1 month ago (2016-11-08 17:38:36 UTC) #45
jwd
lgtm
4 years, 1 month ago (2016-11-08 19:41:45 UTC) #46
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/2436393002/260001
4 years, 1 month ago (2016-11-08 19:51:28 UTC) #48
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 1 month ago (2016-11-08 20:04:32 UTC) #50
commit-bot: I haz the power
4 years, 1 month ago (2016-11-08 20:10:51 UTC) #52
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/b9dabcc3e279cb499c74e7d7e57765af5c21d91e
Cr-Commit-Position: refs/heads/master@{#430692}

Powered by Google App Engine
This is Rietveld 408576698