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

Issue 2818803003: [Sync] Always check the device info provider for being null before using it. (Closed)

Created:
3 years, 8 months ago by skym
Modified:
3 years, 8 months ago
Reviewers:
CC:
chromium-reviews
Target Ref:
refs/branch-heads/3029
Project:
chromium
Visibility:
Public.

Description

[Sync] Always check the device info provider for being null before using it. During sign out, the DeviceInfoProviderImpl is reset before DeviceInfoSyncService is told we're shutting down, as well as in a separate task. This means if we get extremely unlucky, and a pulse is happening at just the right time, we'll try to use the provider after it's been destroyed. To fix this, we can just check that it's not nullptr before using it. The other usages of the provider in DeviceInfoSyncService have stronger guarantees from sync that we're not in shutdown yet, and as such they DCHECK instead. No unit tests were added as part of this change. It is non-trivial to force an asyc pulse, and we currently do not have good seams to allow this. Since this change needs to be merged back, I want this modification to be as small as possible. BUG=709927 Review-Url: https://codereview.chromium.org/2810873005 Cr-Commit-Position: refs/heads/master@{#463814} (cherry picked from commit babffd17e43935e30657dcfda02d962791adf460) Review-Url: https://codereview.chromium.org/2818803003 . Cr-Commit-Position: refs/branch-heads/3029@{#698} Cr-Branched-From: 939b32ee5ba05c396eef3fd992822fcca9a2e262-refs/heads/master@{#454471} Committed: https://chromium.googlesource.com/chromium/src/+/c9c3186627372f19063b9855a2176150567a5889

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -5 lines) Patch
M components/sync/device_info/device_info_sync_service.cc View 1 chunk +11 lines, -5 lines 0 comments Download

Messages

Total messages: 2 (1 generated)
skym
3 years, 8 months ago (2017-04-13 21:40:59 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
c9c3186627372f19063b9855a2176150567a5889.

Powered by Google App Engine
This is Rietveld 408576698