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

Issue 2473813002: Notify GCMAppHandlers when the store is reset, so they clear cached IDs (Closed)

Created:
4 years, 1 month ago by johnme
Modified:
4 years, 1 month ago
CC:
chromium-reviews, extensions-reviews_chromium.org, zea+watch_chromium.org, Peter Beverloo, johnme+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, harkness+watch_chromium.org, davemoore+watch_chromium.org, binjin
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Notify GCMAppHandlers when the store is reset, so they clear cached IDs The GCM Store can be reset due to corruption or GCM rejecting the checkin (with a HTTP_UNAUTHORIZED or HTTP_BAD_REQUEST response status). When this happens, the device ID changes and so all registrations are invalidated, hence app handlers should clear any registration IDs they store (locally and ideally remotely too). This patch does that for locally cached registration IDs; it does not yet attempt to clear remotely cached registration IDs. It does so by adding an OnStoreReset method to the GCMAppHandler interface, which suffers the known race condition that app handlers that are not yet registered will not find out about the store being reset (e.g. during startup); the comment on OnStoreReset warns about this. BUG=661660 TBR=rdevlin.cronin@chromium.org (based on jianli's review) Committed: https://crrev.com/93ec793ac69a542b2213297737178a55d069fd0d Cr-Commit-Position: refs/heads/master@{#432865}

Patch Set 1 #

Total comments: 12

Patch Set 2 : Major rewrite #

Patch Set 3 : Clearer comment in GCMAppHander #

Total comments: 6

Patch Set 4 : HeartbeatScheduler to call and test RefreshHeartbeatSettings #

Total comments: 2

Patch Set 5 : review comments and fix hearbeat scheduler tests #

Total comments: 2

Patch Set 6 : Update Cryptauth comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+207 lines, -12 lines) Patch
M chrome/browser/chromeos/policy/heartbeat_scheduler.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/policy/heartbeat_scheduler.cc View 1 2 3 4 3 chunks +10 lines, -1 line 0 comments Download
M chrome/browser/chromeos/policy/heartbeat_scheduler_unittest.cc View 1 2 3 4 2 chunks +64 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_gcm_app_handler.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/extension_gcm_app_handler.cc View 1 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_app_identifier.h View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_app_identifier.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_service_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_service_impl.cc View 1 1 chunk +13 lines, -0 lines 0 comments Download
M components/gcm_driver/default_gcm_app_handler.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/gcm_driver/default_gcm_app_handler.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M components/gcm_driver/fake_gcm_app_handler.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/gcm_driver/fake_gcm_app_handler.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M components/gcm_driver/gcm_account_mapper.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/gcm_driver/gcm_account_mapper.cc View 1 1 chunk +6 lines, -0 lines 0 comments Download
M components/gcm_driver/gcm_app_handler.h View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M components/gcm_driver/gcm_client.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M components/gcm_driver/gcm_client_impl.cc View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M components/gcm_driver/gcm_client_impl_unittest.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M components/gcm_driver/gcm_driver_desktop.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/gcm_driver/gcm_driver_desktop.cc View 1 2 3 4 3 chunks +17 lines, -0 lines 0 comments Download
M components/invalidation/impl/gcm_invalidation_bridge.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/invalidation/impl/gcm_invalidation_bridge.cc View 1 6 chunks +20 lines, -3 lines 0 comments Download
M components/invalidation/impl/gcm_invalidation_bridge_unittest.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M components/invalidation/impl/gcm_network_channel.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M components/invalidation/impl/gcm_network_channel.cc View 1 3 chunks +10 lines, -3 lines 0 comments Download
M components/invalidation/impl/gcm_network_channel_delegate.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M components/invalidation/impl/gcm_network_channel_unittest.cc View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 43 (19 generated)
johnme
4 years, 1 month ago (2016-11-02 17:41:53 UTC) #2
Peter Beverloo
+zea fyi GCM and push lgtm Please get OWNERS review for the features you're touching. ...
4 years, 1 month ago (2016-11-03 17:28:57 UTC) #4
johnme
Addressed review comments, and ended up rewriting most of the overrides of GCMAppHandler::OnStoreReset to clear ...
4 years, 1 month ago (2016-11-08 19:22:41 UTC) #5
johnme
zea: it'd be helpful to get a 2nd pair of eyes on this patch, as ...
4 years, 1 month ago (2016-11-08 19:48:36 UTC) #7
johnme
zea: it'd be helpful to get a 2nd pair of eyes on this patch, as ...
4 years, 1 month ago (2016-11-08 19:49:58 UTC) #9
jianli
https://codereview.chromium.org/2473813002/diff/40001/components/gcm_driver/gcm_client_impl.cc File components/gcm_driver/gcm_client_impl.cc (right): https://codereview.chromium.org/2473813002/diff/40001/components/gcm_driver/gcm_client_impl.cc#newcode815 components/gcm_driver/gcm_client_impl.cc:815: delegate_->OnStoreReset(); Do we want to call OnStoreReset if |success| ...
4 years, 1 month ago (2016-11-08 23:54:57 UTC) #10
pavely
components/invalidation/ lgtm This implementation doesn't have a way to invalidate registration_id with server.
4 years, 1 month ago (2016-11-09 00:19:00 UTC) #11
Andrew T Wilson (Slow)
https://codereview.chromium.org/2473813002/diff/40001/chrome/browser/chromeos/policy/heartbeat_scheduler.cc File chrome/browser/chromeos/policy/heartbeat_scheduler.cc (right): https://codereview.chromium.org/2473813002/diff/40001/chrome/browser/chromeos/policy/heartbeat_scheduler.cc#newcode430 chrome/browser/chromeos/policy/heartbeat_scheduler.cc:430: ShutdownGCM(); Problem is that this will shutdown our GCM ...
4 years, 1 month ago (2016-11-09 08:19:39 UTC) #12
johnme
https://codereview.chromium.org/2473813002/diff/40001/chrome/browser/chromeos/policy/heartbeat_scheduler.cc File chrome/browser/chromeos/policy/heartbeat_scheduler.cc (right): https://codereview.chromium.org/2473813002/diff/40001/chrome/browser/chromeos/policy/heartbeat_scheduler.cc#newcode430 chrome/browser/chromeos/policy/heartbeat_scheduler.cc:430: ShutdownGCM(); On 2016/11/09 08:19:39, Andrew T Wilson (Slow) wrote: ...
4 years, 1 month ago (2016-11-09 19:33:48 UTC) #13
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/2473813002/60001
4 years, 1 month ago (2016-11-09 19:34:33 UTC) #17
Nicolas Zea
gcm changes LGTM. You mention a race condition around app handler registration though. Could you ...
4 years, 1 month ago (2016-11-09 20:57:53 UTC) #22
jianli
https://codereview.chromium.org/2473813002/diff/60001/components/gcm_driver/gcm_driver_desktop.cc File components/gcm_driver/gcm_driver_desktop.cc (right): https://codereview.chromium.org/2473813002/diff/60001/components/gcm_driver/gcm_driver_desktop.cc#newcode1311 components/gcm_driver/gcm_driver_desktop.cc:1311: key_value.second->OnStoreReset(); There is a risk here when the called ...
4 years, 1 month ago (2016-11-09 21:53:52 UTC) #23
jianli
https://codereview.chromium.org/2473813002/diff/40001/components/gcm_driver/gcm_client_impl.cc File components/gcm_driver/gcm_client_impl.cc (right): https://codereview.chromium.org/2473813002/diff/40001/components/gcm_driver/gcm_client_impl.cc#newcode815 components/gcm_driver/gcm_client_impl.cc:815: delegate_->OnStoreReset(); On 2016/11/09 19:33:48, johnme wrote: > On 2016/11/08 ...
4 years, 1 month ago (2016-11-09 21:54:23 UTC) #24
Andrew T Wilson (Slow)
FYI, you can build cros unittests by setting target_os = "chromeos" in a regular chrome ...
4 years, 1 month ago (2016-11-10 08:44:13 UTC) #25
johnme
On 2016/11/09 20:57:53, Nicolas Zea wrote: > You mention a race condition around app handler ...
4 years, 1 month ago (2016-11-10 19:56:54 UTC) #26
jianli
lgtm
4 years, 1 month ago (2016-11-16 22:12:01 UTC) #27
Tim Song
LGTM with nit. https://codereview.chromium.org/2473813002/diff/80001/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc File components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc (right): https://codereview.chromium.org/2473813002/diff/80001/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc#newcode87 components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc:87: // TODO(crbug.com/661660): Tell server the registration ...
4 years, 1 month ago (2016-11-16 22:28:09 UTC) #28
Andrew T Wilson (Slow)
*policy/* LGTM
4 years, 1 month ago (2016-11-17 12:19:30 UTC) #29
johnme
https://codereview.chromium.org/2473813002/diff/80001/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc File components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc (right): https://codereview.chromium.org/2473813002/diff/80001/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc#newcode87 components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc:87: // TODO(crbug.com/661660): Tell server the registration ID is no ...
4 years, 1 month ago (2016-11-17 12:57:25 UTC) #30
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/2473813002/100001
4 years, 1 month ago (2016-11-17 12:57:47 UTC) #33
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/306857)
4 years, 1 month ago (2016-11-17 13:04:34 UTC) #35
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/2473813002/100001
4 years, 1 month ago (2016-11-17 13:12:36 UTC) #39
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 1 month ago (2016-11-17 14:27:28 UTC) #41
commit-bot: I haz the power
4 years, 1 month ago (2016-11-17 14:31:15 UTC) #43
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/93ec793ac69a542b2213297737178a55d069fd0d
Cr-Commit-Position: refs/heads/master@{#432865}

Powered by Google App Engine
This is Rietveld 408576698