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

Issue 914693002: Push API: Fix unsubscribing from GCM on Android (Closed)

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

Description

Push API: Fix unsubscribing from GCM on Android We were calling Android GCM's unregister API, which clears all of an app's subscriptions (all sender ids and subtypes). Since from Android's point of view, the app is Chrome, if any webapp unsubscribed from push messaging, all webapps would be unsubscribed! Instead now we call the unsubscribe API, which only unsubscribes a specific (sender_id,subtype) pair (where the subtype corresponds to GCMDriver's app_id). So now if a Service Worker calls pushSubscription.unsubscribe(), it'll only unsubscribe that SW's push subscription. In order for this to work, we now also call the corresponding subscribe API (accepting a single sender_id) instead of register. GoogleCloudMessagingV2.java is still temporary code, that will be removed once we switch to the Google Play Services client library. BUG=457374 Committed: https://crrev.com/07b355ac6423c7957c87c66bd0f36220ca2aeaa2 Cr-Commit-Position: refs/heads/master@{#317062}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Now compiles and passes tests (and uses CHECK_EQ) #

Total comments: 14

Patch Set 3 : Address Jian's comments #

Patch Set 4 : Comment nits I missed earlier #

Total comments: 6

Patch Set 5 : Add GCMDriver::UnregisterWithSender instead of changing all callers #

Patch Set 6 : Whitespace nit #

Patch Set 7 : Rebase #

Patch Set 8 : Compile fix #

Total comments: 20

Patch Set 9 : Address peter & jianli's review comments #

Total comments: 8

Patch Set 10 : Addressed peter's nits #

Total comments: 2

Patch Set 11 : Tweak comment per jianli #

Total comments: 2

Patch Set 12 : Rebase #

Patch Set 13 : Rebase due to https://codereview.chromium.org/930083002 #

Patch Set 14 : Fix compile #

Patch Set 15 : Remove obsolete PushEventNoPermission test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+399 lines, -261 lines) Patch
M chrome/browser/services/gcm/push_messaging_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +12 lines, -44 lines 0 comments Download
M chrome/browser/services/gcm/push_messaging_service_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +17 lines, -1 line 0 comments Download
M chrome/browser/services/gcm/push_messaging_service_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 10 chunks +76 lines, -41 lines 0 comments Download
M components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GCMDriver.java View 1 2 3 3 chunks +8 lines, -9 lines 0 comments Download
M components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GoogleCloudMessagingV2.java View 1 2 3 4 5 6 7 4 chunks +116 lines, -114 lines 0 comments Download
M components/gcm_driver/gcm_driver.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +23 lines, -3 lines 0 comments Download
M components/gcm_driver/gcm_driver.cc View 1 2 3 4 5 6 7 8 3 chunks +23 lines, -1 line 0 comments Download
M components/gcm_driver/gcm_driver_android.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M components/gcm_driver/gcm_driver_android.cc View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -4 lines 0 comments Download
M components/gcm_driver/gcm_driver_desktop_unittest.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/push_messaging/push_messaging_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +14 lines, -5 lines 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 12 9 chunks +45 lines, -15 lines 0 comments Download
M content/public/browser/push_messaging_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +13 lines, -7 lines 0 comments Download
M content/public/browser/push_messaging_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +36 lines, -15 lines 0 comments Download
M content/shell/browser/layout_test/layout_test_push_messaging_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M content/shell/browser/layout_test/layout_test_push_messaging_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 42 (15 generated)
johnme
5 years, 10 months ago (2015-02-10 20:28:41 UTC) #2
jianli
https://codereview.chromium.org/914693002/diff/1/chrome/browser/extensions/api/gcm/gcm_api.cc File chrome/browser/extensions/api/gcm/gcm_api.cc (right): https://codereview.chromium.org/914693002/diff/1/chrome/browser/extensions/api/gcm/gcm_api.cc#newcode139 chrome/browser/extensions/api/gcm/gcm_api.cc:139: LOG(FATAL) << "GcmUnregisterFunction is not implemented on Android"; I ...
5 years, 10 months ago (2015-02-10 23:19:25 UTC) #4
johnme
Replied to Jian's review comments, and made various fixes so this patch now compiles and ...
5 years, 10 months ago (2015-02-12 19:15:25 UTC) #5
jianli
https://codereview.chromium.org/914693002/diff/1/chrome/browser/extensions/api/gcm/gcm_api.cc File chrome/browser/extensions/api/gcm/gcm_api.cc (right): https://codereview.chromium.org/914693002/diff/1/chrome/browser/extensions/api/gcm/gcm_api.cc#newcode139 chrome/browser/extensions/api/gcm/gcm_api.cc:139: LOG(FATAL) << "GcmUnregisterFunction is not implemented on Android"; On ...
5 years, 10 months ago (2015-02-12 20:03:31 UTC) #6
johnme
Addressed Jian's comments - thanks :) https://codereview.chromium.org/914693002/diff/1/chrome/browser/extensions/api/gcm/gcm_api.cc File chrome/browser/extensions/api/gcm/gcm_api.cc (right): https://codereview.chromium.org/914693002/diff/1/chrome/browser/extensions/api/gcm/gcm_api.cc#newcode139 chrome/browser/extensions/api/gcm/gcm_api.cc:139: LOG(FATAL) << "GcmUnregisterFunction ...
5 years, 10 months ago (2015-02-13 19:11:56 UTC) #7
johnme
avi@chromium.org: Please review changes in content/public/browser/push_messaging_service.h
5 years, 10 months ago (2015-02-13 22:05:04 UTC) #9
jianli
Filip and I have discussed on the approach to fix this bug by adding sender ...
5 years, 10 months ago (2015-02-13 22:33:16 UTC) #10
Charlie Reis
content/public LGTM. (Didn't look at content/browser.)
5 years, 10 months ago (2015-02-13 23:11:17 UTC) #12
johnme
> Filip and I have discussed on the approach to fix this bug by adding ...
5 years, 10 months ago (2015-02-14 01:48:35 UTC) #14
Avi (use Gerrit)
lgtm
5 years, 10 months ago (2015-02-17 16:25:49 UTC) #17
Peter Beverloo
Mostly nits from my side. Thanks for the patch!! https://codereview.chromium.org/914693002/diff/140001/chrome/browser/services/gcm/fake_gcm_profile_service.cc File chrome/browser/services/gcm/fake_gcm_profile_service.cc (right): https://codereview.chromium.org/914693002/diff/140001/chrome/browser/services/gcm/fake_gcm_profile_service.cc#newcode72 chrome/browser/services/gcm/fake_gcm_profile_service.cc:72: ...
5 years, 10 months ago (2015-02-17 18:49:36 UTC) #19
jianli
https://codereview.chromium.org/914693002/diff/140001/components/gcm_driver/gcm_driver.h File components/gcm_driver/gcm_driver.h (right): https://codereview.chromium.org/914693002/diff/140001/components/gcm_driver/gcm_driver.h#newcode58 components/gcm_driver/gcm_driver.h:58: // Unregisters an app from using GCM, explicitly providing ...
5 years, 10 months ago (2015-02-17 19:17:39 UTC) #20
johnme
Address peter & jianli's review comments
5 years, 10 months ago (2015-02-17 21:23:32 UTC) #22
johnme
Addressed jianli@ & peter@'s review comments - thanks :) https://codereview.chromium.org/914693002/diff/140001/chrome/browser/services/gcm/fake_gcm_profile_service.cc File chrome/browser/services/gcm/fake_gcm_profile_service.cc (right): https://codereview.chromium.org/914693002/diff/140001/chrome/browser/services/gcm/fake_gcm_profile_service.cc#newcode72 chrome/browser/services/gcm/fake_gcm_profile_service.cc:72: ...
5 years, 10 months ago (2015-02-17 21:24:07 UTC) #23
Peter Beverloo
push lgtm, thanks :-) https://codereview.chromium.org/914693002/diff/160001/chrome/browser/services/gcm/push_messaging_browsertest.cc File chrome/browser/services/gcm/push_messaging_browsertest.cc (right): https://codereview.chromium.org/914693002/diff/160001/chrome/browser/services/gcm/push_messaging_browsertest.cc#newcode631 chrome/browser/services/gcm/push_messaging_browsertest.cc:631: message.data["data"] = "shownotification-without-waituntil"; nit: pass ...
5 years, 10 months ago (2015-02-17 21:51:05 UTC) #24
johnme
Addressed peter's nits https://codereview.chromium.org/914693002/diff/160001/chrome/browser/services/gcm/push_messaging_browsertest.cc File chrome/browser/services/gcm/push_messaging_browsertest.cc (right): https://codereview.chromium.org/914693002/diff/160001/chrome/browser/services/gcm/push_messaging_browsertest.cc#newcode631 chrome/browser/services/gcm/push_messaging_browsertest.cc:631: message.data["data"] = "shownotification-without-waituntil"; On 2015/02/17 21:51:05, ...
5 years, 10 months ago (2015-02-17 22:05:10 UTC) #26
jianli
lgtm https://codereview.chromium.org/914693002/diff/180001/components/gcm_driver/gcm_driver.h File components/gcm_driver/gcm_driver.h (right): https://codereview.chromium.org/914693002/diff/180001/components/gcm_driver/gcm_driver.h#newcode58 components/gcm_driver/gcm_driver.h:58: // Unregisters an app_id,sender_id pair from using GCM. ...
5 years, 10 months ago (2015-02-17 23:02:27 UTC) #27
johnme
https://codereview.chromium.org/914693002/diff/180001/components/gcm_driver/gcm_driver.h File components/gcm_driver/gcm_driver.h (right): https://codereview.chromium.org/914693002/diff/180001/components/gcm_driver/gcm_driver.h#newcode58 components/gcm_driver/gcm_driver.h:58: // Unregisters an app_id,sender_id pair from using GCM. Only ...
5 years, 10 months ago (2015-02-17 23:10:11 UTC) #29
fgorski
lgtm with a nit. John, thanks for being patient with us. I think we ended ...
5 years, 10 months ago (2015-02-17 23:31:58 UTC) #30
johnme
https://codereview.chromium.org/914693002/diff/200001/components/gcm_driver/gcm_driver.cc File components/gcm_driver/gcm_driver.cc (right): https://codereview.chromium.org/914693002/diff/200001/components/gcm_driver/gcm_driver.cc#newcode85 components/gcm_driver/gcm_driver.cc:85: const std::string* sender_id, On 2015/02/17 23:31:58, fgorski wrote: > ...
5 years, 10 months ago (2015-02-17 23:38:20 UTC) #31
johnme
Rebase
5 years, 10 months ago (2015-02-18 20:13:07 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/914693002/220001
5 years, 10 months ago (2015-02-18 21:45:28 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_dbg/builds/43875)
5 years, 10 months ago (2015-02-18 21:59:12 UTC) #37
johnme
Heads up to reviewers: I had to make quite a few changes when rebasing, especially ...
5 years, 10 months ago (2015-02-19 16:08:40 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/914693002/280001
5 years, 10 months ago (2015-02-19 16:12:21 UTC) #40
commit-bot: I haz the power
Committed patchset #15 (id:280001)
5 years, 10 months ago (2015-02-19 17:01:00 UTC) #41
commit-bot: I haz the power
5 years, 10 months ago (2015-02-19 17:01:53 UTC) #42
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/07b355ac6423c7957c87c66bd0f36220ca2aeaa2
Cr-Commit-Position: refs/heads/master@{#317062}

Powered by Google App Engine
This is Rietveld 408576698