Chromium Code Reviews
Description[Sync] Actively guard against provider being cleared in DeviceInfoSyncBridge.
When a user signs out and Sync starts to shut down, we immediately
clear the LocalDeviceInfoProvider. Many methods in DeviceInfoSyncBridge
depend on being able to access information in the provider, and can
crash at this point. The bridge should be disabled momentarily, but
this will require threads hops UI->Sync->UI. Meanwhile, various other
posted tasks can call into the bridge and hit this race condition.
We were previously guarding against this scenario when the pulse timer
would fire, but we were not guarding against processor's Merge/Apply
calls or ModelTypeStore async initialization. I've added nullptr checks
to all async entry points that mostly no-op when they detect this
scenario.
One slight hiccup is that the bridge currently leaves the pulse timer
running even when disabled. My intention is that this change will be
merged back into M56 so I wanted to keep this CL as small as possible.
When crbug.com/672600 is addressed I think it will make the most sense
to disable the pulse timer while disabled, since it should always be
re-enabled with an accurate timer when things are working again.
Additionally, some state tracking such as has_provider_initialized_
should probably just be removed at this point. This should be caught in
crbug.com/659263
BUG=672534
Committed: https://crrev.com/24268f797538e6add4338602ff1ebd78affe2648
Cr-Commit-Position: refs/heads/master@{#437902}
Patch Set 1 #Patch Set 2 : Updated comments slightly. #
Dependent Patchsets: Messages
Total messages: 15 (10 generated)
|
||||||||||||||||||||||||||||