Backed out changeset 4c53c4da7ece (bug 1677555) for causing multiple failures in imgRequestProxy.cpp CLOSED TREE

This commit is contained in:
Noemi Erli 2021-05-26 04:34:26 +03:00
Родитель 85cc2d756b
Коммит 9469a9b825
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -188,10 +188,13 @@ class StyleImageRequestCleanupTask final : public mozilla::Runnable {
// This is defined here for parallelism with LoadURI.
void Gecko_LoadData_Drop(StyleLoadData* aData) {
if (aData->resolved_image) {
// We want to dispatch this async to prevent reentrancy issues, as
// imgRequestProxy going away can destroy documents, etc, see bug 1677555.
auto task = MakeRefPtr<StyleImageRequestCleanupTask>(*aData);
SchedulerGroup::Dispatch(TaskCategory::Other, task.forget());
if (NS_IsMainThread()) {
task->Run();
} else {
// if Resolve was not called at some point, mDocGroup is not set.
SchedulerGroup::Dispatch(TaskCategory::Other, task.forget());
}
}
// URIs are safe to refcount from any thread.