Use direct member for CefBrowserHostBase::contents_delegate_

There's no reason to use unique_ptr here as the lifespan of
|contents_delegate_| exactly matches CefBrowserHostBase.
This commit is contained in:
Marshall Greenblatt
2024-07-18 13:50:37 -04:00
parent d470cf8204
commit 3acdbac061
5 changed files with 34 additions and 37 deletions

View File

@@ -369,8 +369,8 @@ class CefBrowserHostBase : public CefBrowserHost,
CefBrowserPlatformDelegate* platform_delegate() const {
return platform_delegate_.get();
}
CefBrowserContentsDelegate* contents_delegate() const {
return contents_delegate_.get();
CefBrowserContentsDelegate* contents_delegate() {
return &contents_delegate_;
}
CefMediaStreamRegistrar* GetMediaStreamRegistrar();
CefDevToolsWindowRunner* GetDevToolsWindowRunner();
@@ -439,7 +439,7 @@ class CefBrowserHostBase : public CefBrowserHost,
const bool is_views_hosted_;
// Only accessed on the UI thread.
std::unique_ptr<CefBrowserContentsDelegate> contents_delegate_;
CefBrowserContentsDelegate contents_delegate_;
CefRefPtr<CefUnresponsiveProcessCallback> unresponsive_process_callback_;
raw_ptr<RenderViewContextMenuObserver> context_menu_observer_ = nullptr;