[floc] Skip setting floc_allowed in incognito / for null HistoryService
Incognito doesn't save history at all, so avoid calling HistoryService::SetFlocAllowed in incognito. Also don't set it when the history service is null. This aligns with the pattern elsewhere (e.g. calling hs->UpdateWithPageEndTime inside HistoryTabHelper::WebContentsDestroyed). Besides, this is a speculative fix for the crash crbug.com/1166194, as dereferencing a null history_service can trigger undefined behavior. Bug: 1162874, 1166194 Change-Id: Icb3adbd4ce311d4153bfd2b08b2bd43c4b4aa726 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2628927 Commit-Queue: Yao Xiao <yaoxia@chromium.org> Reviewed-by:Charlie Harrison <csharrison@chromium.org> Cr-Commit-Position: refs/heads/master@{#843654}
Showing
Please register or sign in to comment