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(); 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()));
} }
} }