refactor: simplify WebContents::Destroy (#35510)

This commit is contained in:
Jeremy Rose 2022-08-31 08:16:27 -07:00 committed by GitHub
parent 1830c0f6c3
commit 5fe1ac5c3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1000,12 +1000,8 @@ void WebContents::Destroy() {
DeleteThisIfAlive();
} else {
content::GetUIThreadTaskRunner({})->PostTask(
FROM_HERE, base::BindOnce(
[](base::WeakPtr<WebContents> contents) {
if (contents)
contents->DeleteThisIfAlive();
},
GetWeakPtr()));
FROM_HERE,
base::BindOnce(&WebContents::DeleteThisIfAlive, GetWeakPtr()));
}
}