browser: make destruction of webContents async

This commit is contained in:
deepak1556 2017-04-04 01:33:51 +05:30 committed by Cheng Zhao
parent ca7ca3ba1c
commit f974a6bda9
5 changed files with 21 additions and 9 deletions

View file

@ -188,8 +188,13 @@ void CommonWebContentsDelegate::SetOwnerWindow(
}
}
void CommonWebContentsDelegate::ResetManagedWebContents() {
web_contents_.reset();
void CommonWebContentsDelegate::ResetManagedWebContents(bool async) {
if (async) {
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE,
web_contents_.release());
} else {
web_contents_.reset();
}
}
content::WebContents* CommonWebContentsDelegate::GetWebContents() const {