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

Issue 2587883003: Revert of Force HostContentSettingsMap to be destroyed on its owning thread. (Closed)

Created:
4 years ago by yoichio
Modified:
4 years ago
CC:
chromium-reviews, markusheintz_, msramek+watch_chromium.org, raymes+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Revert of Force HostContentSettingsMap to be destroyed on its owning thread. (patchset #5 id:90001 of https://codereview.chromium.org/2581213002/ ) Reason for revert: This might cause flakiness: https://bugs.chromium.org/p/chromium/issues/detail?id=675722 Original issue's description: > Force HostContentSettingsMap to be destroyed on its owning thread. > > It uses WeakPtrFactory and as such must be destroyed on its owning thread (UI). > > The rest of the changes can then be inferred from the stack trace on the bug: > > 1) RefcountedKeyedServiceTraits::Destruct() must check for > ThreadTaskRunnerHandle::IsSet() before invoking TTRH::Get(). > ** UPDATE in PS 5 : Use STR::RunsTasksOnCurrentThread() instead of STRH comparison. > > 2) Nothing about RefcountedKeyedService's use of its |task_runner| is thread-affine > => using SequencedTaskRunner instead is inline with our desire to make all > top-level API use sequence-affinity instead of thread-affinity for thread-safety. > > 3) Calling SequencedTaskRunnerHandle::IsSet() from the Callback's destructor requires > the SequencedWorkerPool's task info to be set in that scope > => brought changes from same requirements in another CL > @ https://codereview.chromium.org/2491613004/#ps160001 > Note: intentionally not adding tests as this change highlights that this deletion is > racy in theory (deleting without owning the sequence means potentially deleting > things from the same SequenceToken in parallel... any good test would fail TSAN and > I also don't want to address this issue given it's long standing and SWP is being > replaced by TaskScheduler shortly). > > 4) Switch to ScopedMockTimeMessageLoopTaskRunner in NotificationPermissionContextTest > => otherwise LSAN catches a leak in patch set 3 as the HostContentSettingsMap is > sent for deletion on the wrong task runner and the task is never flushed. > (ScopedMockTimeMessageLoopTaskRunner ensures the loop is flushed before replacing > it, both ways). > > Precursor requirement to https://codereview.chromium.org/2576243003/ which > for some reason makes this destruction race come to life. > > BUG=674946, 665588, 622400 > TBR=mukai (NotificationPermissionContextTest side-effects) > > Committed: https://crrev.com/28fb80beda6b171647d037057543f77e5b78e170 > Cr-Commit-Position: refs/heads/master@{#439534} TBR=vmpstr@chromium.org,erg@chromium.org,bauerb@chromium.org,dcheng@chromium.org,mukai@chromium.org,gab@chromium.org BUG=674946, 665588, 622400, 675722

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+57 lines, -76 lines) Patch
M base/threading/sequenced_worker_pool.cc View 12 chunks +18 lines, -39 lines 0 comments Download
M chrome/browser/notifications/notification_permission_context_unittest.cc View 6 chunks +20 lines, -15 lines 0 comments Download
M components/content_settings/core/browser/cookie_settings_unittest.cc View 2 chunks +0 lines, -5 lines 0 comments Download
M components/content_settings/core/browser/host_content_settings_map.cc View 3 chunks +1 line, -3 lines 0 comments Download
M components/keyed_service/core/refcounted_keyed_service.h View 4 chunks +9 lines, -9 lines 0 comments Download
M components/keyed_service/core/refcounted_keyed_service.cc View 2 chunks +9 lines, -5 lines 0 comments Download

Messages

Total messages: 7 (5 generated)
yoichio
Created Revert of Force HostContentSettingsMap to be destroyed on its owning thread.
4 years ago (2016-12-20 02:11:28 UTC) #1
gab
4 years ago (2016-12-20 16:55:12 UTC) #7
Message was sent while issue was closed.
On 2016/12/20 02:11:28, yoichio wrote:
> Created Revert of Force HostContentSettingsMap to be destroyed on its owning
> thread.

Closing per http://crbug.com/675722 having been marked as WontFix (also, this
was a requirement for another CL that landed already so revert wouldn't work
as-is).

Powered by Google App Engine
This is Rietveld 408576698