Fix dangling raw_ptr errors and related issues (see #3239)

- Use raw_ptr in class container fields.
- Use defined lifespan for StreamReaderURLLoader.
- Fix lifespan assumptions for WebContents/RFH usage.
This commit is contained in:
Marshall Greenblatt
2024-05-13 17:36:09 -04:00
parent aad216bf56
commit 6354d8daf1
62 changed files with 644 additions and 484 deletions

View File

@@ -65,7 +65,8 @@ class CefDownloadManagerDelegateImpl
// Map of DownloadItem to originating CefBrowserHostBase. Maintaining this
// map is necessary because DownloadItem::GetWebContents() may return NULL if
// the browser navigates while the download is in progress.
using ItemBrowserMap = std::map<download::DownloadItem*, CefBrowserHostBase*>;
using ItemBrowserMap =
std::map<raw_ptr<download::DownloadItem>, raw_ptr<CefBrowserHostBase>>;
ItemBrowserMap item_browser_map_;
};