Commit 98ad9d8c authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Add seq DCHECK in ExternalPolicyDataFetcher destr

Add the DCHECK into the ExternalPolicyDataFetcher's destructor that it's
executed on the right sequence.

Before this CL, the destructor contained the comment that stated that
such DCHECK isn't technically possible due to unusual destruction order
in some tests, but we can't repro this problem with the current ToT
anymore.

Bug: 727645
Change-Id: I6490227656a876d546cd5b659f5d88b2d2ec0dfa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1828820Reviewed-by: default avatarNikita Podguzov <nikitapodguzov@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701264}
parent b1c4584d
......@@ -227,13 +227,7 @@ ExternalPolicyDataFetcher::ExternalPolicyDataFetcher(
}
ExternalPolicyDataFetcher::~ExternalPolicyDataFetcher() {
// No RunsTasksInCurrentSequence() check to avoid unit tests failures.
// In unit tests the browser process instance is deleted only after test ends
// and test task scheduler is shutted down. Therefore we need to delete some
// components of BrowserPolicyConnector (ResourceCache and
// CloudExternalDataManagerBase::Backend) manually when task runner doesn't
// accept new tasks (DeleteSoon in this case). This leads to the situation
// when this destructor is called not on |task_runner|.
DCHECK(task_runner_->RunsTasksInCurrentSequence());
for (auto it = jobs_.begin(); it != jobs_.end(); ++it)
CancelJob(*it);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment