chrome: Fix potential UAF of ChromeBrowserContext and Profile (see issue #2969)

This commit is contained in:
Marshall Greenblatt
2021-07-23 15:55:22 -04:00
parent 3492b1bd76
commit af1a5c6f6b
4 changed files with 45 additions and 7 deletions

View File

@@ -229,7 +229,9 @@ void CefBrowserContext::RemoveCefRequestContext(
// Delete ourselves when the reference count reaches zero.
if (request_context_set_.empty()) {
Shutdown();
delete this;
// Allow the current call stack to unwind before deleting |this|.
content::BrowserThread::DeleteSoon(CEF_UIT, FROM_HERE, this);
}
}