refactor: simplify WebContents::Destroy (#35510)
This commit is contained in:
parent
1830c0f6c3
commit
5fe1ac5c3d
1 changed files with 2 additions and 6 deletions
|
@ -1000,12 +1000,8 @@ void WebContents::Destroy() {
|
||||||
DeleteThisIfAlive();
|
DeleteThisIfAlive();
|
||||||
} else {
|
} else {
|
||||||
content::GetUIThreadTaskRunner({})->PostTask(
|
content::GetUIThreadTaskRunner({})->PostTask(
|
||||||
FROM_HERE, base::BindOnce(
|
FROM_HERE,
|
||||||
[](base::WeakPtr<WebContents> contents) {
|
base::BindOnce(&WebContents::DeleteThisIfAlive, GetWeakPtr()));
|
||||||
if (contents)
|
|
||||||
contents->DeleteThisIfAlive();
|
|
||||||
},
|
|
||||||
GetWeakPtr()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue