diff --git a/libcef/browser/alloy/alloy_browser_context.h b/libcef/browser/alloy/alloy_browser_context.h index 9ad86a1e7..51903d61d 100644 --- a/libcef/browser/alloy/alloy_browser_context.h +++ b/libcef/browser/alloy/alloy_browser_context.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_CONTEXT_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "cef/include/cef_request_context_handler.h" #include "cef/libcef/browser/alloy/chrome_profile_alloy.h" #include "cef/libcef/browser/browser_context.h" @@ -131,10 +132,10 @@ class AlloyBrowserContext : public ChromeProfileAlloy, std::unique_ptr ssl_host_state_delegate_; std::unique_ptr visitedlink_master_; // |visitedlink_listener_| is owned by visitedlink_master_. - CefVisitedLinkListener* visitedlink_listener_ = nullptr; + raw_ptr visitedlink_listener_ = nullptr; // Owned by the KeyedService system. - extensions::CefExtensionSystem* extension_system_ = nullptr; + raw_ptr extension_system_ = nullptr; // The key to index KeyedService instances created by // SimpleKeyedServiceFactory. diff --git a/libcef/browser/alloy/alloy_browser_main.h b/libcef/browser/alloy/alloy_browser_main.h index 936816fc9..95d83a21a 100644 --- a/libcef/browser/alloy/alloy_browser_main.h +++ b/libcef/browser/alloy/alloy_browser_main.h @@ -9,6 +9,7 @@ #include #include "base/command_line.h" +#include "base/memory/raw_ptr.h" #include "build/build_config.h" #include "cef/libcef/browser/request_context_impl.h" #include "components/prefs/pref_service.h" @@ -79,7 +80,7 @@ class AlloyBrowserMainParts : public content::BrowserMainParts { #endif // BUILDFLAG(IS_WIN) CefRefPtr global_request_context_; - CefDevToolsDelegate* devtools_delegate_ = nullptr; // Deletes itself. + raw_ptr devtools_delegate_ = nullptr; // Deletes itself. // Blocking task runners exposed via CefTaskRunner. For consistency with // previous named thread behavior always execute all pending tasks before diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index 3a334c033..7fcf80978 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -9,6 +9,7 @@ #include #include +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "build/build_config.h" #include "cef/include/cef_request_context_handler.h" @@ -278,7 +279,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { const extensions::Extension* GetExtension( content::SiteInstance* site_instance); - AlloyBrowserMainParts* browser_main_parts_ = nullptr; + raw_ptr browser_main_parts_ = nullptr; }; #endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_CONTENT_BROWSER_CLIENT_H_ diff --git a/libcef/browser/alloy/alloy_web_contents_view_delegate.h b/libcef/browser/alloy/alloy_web_contents_view_delegate.h index 59fa22ff8..a6c55b496 100644 --- a/libcef/browser/alloy/alloy_web_contents_view_delegate.h +++ b/libcef/browser/alloy/alloy_web_contents_view_delegate.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_WEB_CONTENTS_VIEW_DELEGATE_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "cef/include/internal/cef_ptr.h" #include "content/public/browser/web_contents_view_delegate.h" @@ -26,7 +27,7 @@ class AlloyWebContentsViewDelegate : public content::WebContentsViewDelegate { const content::ContextMenuParams& params) override; private: - content::WebContents* const web_contents_; + const raw_ptr web_contents_; }; #endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_WEB_CONTENTS_VIEW_DELEGATE_H_ diff --git a/libcef/browser/alloy/browser_platform_delegate_alloy.cc b/libcef/browser/alloy/browser_platform_delegate_alloy.cc index 66cfff482..079521460 100644 --- a/libcef/browser/alloy/browser_platform_delegate_alloy.cc +++ b/libcef/browser/alloy/browser_platform_delegate_alloy.cc @@ -213,7 +213,7 @@ void CefBrowserPlatformDelegateAlloy::CreateExtensionHost( DCHECK(browser_); DCHECK(!extension_host_); - auto alloy_browser = AlloyBrowserHostImpl::FromBaseChecked(browser_); + auto alloy_browser = AlloyBrowserHostImpl::FromBaseChecked(browser_.get()); if (host_type == extensions::mojom::ViewType::kExtensionPopup) { // Create an extension host that we own. diff --git a/libcef/browser/alloy/browser_platform_delegate_alloy.h b/libcef/browser/alloy/browser_platform_delegate_alloy.h index 547ef5f20..9792f12f1 100644 --- a/libcef/browser/alloy/browser_platform_delegate_alloy.h +++ b/libcef/browser/alloy/browser_platform_delegate_alloy.h @@ -6,6 +6,7 @@ #ifndef CEF_LIBCEF_BROWSER_ALLOY_BROWSER_PLATFORM_DELEGATE_ALLOY_H_ #define CEF_LIBCEF_BROWSER_ALLOY_BROWSER_PLATFORM_DELEGATE_ALLOY_H_ +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "cef/libcef/browser/alloy/dialogs/alloy_web_contents_dialog_helper.h" #include "cef/libcef/browser/browser_platform_delegate.h" @@ -114,7 +115,7 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate { #if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP) // Used when the browser is hosting an extension. - extensions::ExtensionHost* extension_host_ = nullptr; + raw_ptr extension_host_ = nullptr; bool is_background_host_ = false; #endif diff --git a/libcef/browser/alloy/chrome_profile_alloy.cc b/libcef/browser/alloy/chrome_profile_alloy.cc index 00d3b385f..8ec466d08 100644 --- a/libcef/browser/alloy/chrome_profile_alloy.cc +++ b/libcef/browser/alloy/chrome_profile_alloy.cc @@ -5,6 +5,7 @@ #include "cef/libcef/browser/alloy/chrome_profile_alloy.h" +#include "base/memory/raw_ptr.h" #include "base/no_destructor.h" #include "components/profile_metrics/browser_profile_type.h" #include "components/variations/variations_client.h" @@ -31,7 +32,7 @@ class CefVariationsClient : public variations::VariationsClient { } private: - content::BrowserContext* browser_context_; + raw_ptr browser_context_; }; } // namespace diff --git a/libcef/browser/alloy/devtools/alloy_devtools_window_runner.h b/libcef/browser/alloy/devtools/alloy_devtools_window_runner.h index cc46010db..9835b5c5c 100644 --- a/libcef/browser/alloy/devtools/alloy_devtools_window_runner.h +++ b/libcef/browser/alloy/devtools/alloy_devtools_window_runner.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_ALLOY_DEVTOOLS_ALLOY_DEVTOOLS_WINDOW_RUNNER_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "cef/libcef/browser/devtools/devtools_window_runner.h" @@ -31,7 +32,7 @@ class AlloyDevToolsWindowRunner : public CefDevToolsWindowRunner { // CefDevToolsFrontend will delete itself when the frontend WebContents is // destroyed. - CefDevToolsFrontend* devtools_frontend_ = nullptr; + raw_ptr devtools_frontend_ = nullptr; base::WeakPtrFactory weak_ptr_factory_{this}; }; diff --git a/libcef/browser/alloy/devtools/devtools_file_manager.h b/libcef/browser/alloy/devtools/devtools_file_manager.h index c1c893e88..7fb17d544 100644 --- a/libcef/browser/alloy/devtools/devtools_file_manager.h +++ b/libcef/browser/alloy/devtools/devtools_file_manager.h @@ -9,6 +9,7 @@ #include #include "base/functional/callback_forward.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" namespace base { @@ -70,8 +71,8 @@ class CefDevToolsFileManager { const base::Value* arg3); // Guaranteed to outlive this object. - AlloyBrowserHostImpl* browser_impl_; - PrefService* prefs_; + raw_ptr browser_impl_; + raw_ptr prefs_; using PathsMap = std::map; PathsMap saved_files_; diff --git a/libcef/browser/alloy/devtools/devtools_frontend.cc b/libcef/browser/alloy/devtools/devtools_frontend.cc index 7c9a9549c..61fac734f 100644 --- a/libcef/browser/alloy/devtools/devtools_frontend.cc +++ b/libcef/browser/alloy/devtools/devtools_frontend.cc @@ -17,6 +17,7 @@ #include "base/json/json_writer.h" #include "base/json/string_escape.h" #include "base/memory/ptr_util.h" +#include "base/memory/raw_ptr.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" @@ -229,7 +230,7 @@ class CefDevToolsFrontend::NetworkResourceLoader void OnRetry(base::OnceClosure start_retry) override { DCHECK(false); } const int stream_id_; - CefDevToolsFrontend* const bindings_; + const raw_ptr bindings_; std::unique_ptr loader_; int request_id_; scoped_refptr response_headers_; diff --git a/libcef/browser/alloy/devtools/devtools_frontend.h b/libcef/browser/alloy/devtools/devtools_frontend.h index ee708c502..d7b124419 100644 --- a/libcef/browser/alloy/devtools/devtools_frontend.h +++ b/libcef/browser/alloy/devtools/devtools_frontend.h @@ -8,6 +8,7 @@ #include #include "base/files/file_path.h" +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/values.h" @@ -91,7 +92,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver, PrefService* GetPrefs() const; CefRefPtr frontend_browser_; - content::WebContents* inspected_contents_; + raw_ptr inspected_contents_; scoped_refptr agent_host_; CefPoint inspect_element_at_; base::OnceClosure frontend_destroyed_callback_; diff --git a/libcef/browser/alloy/dialogs/alloy_web_contents_dialog_helper.h b/libcef/browser/alloy/dialogs/alloy_web_contents_dialog_helper.h index 0f3ec921c..d61581a11 100644 --- a/libcef/browser/alloy/dialogs/alloy_web_contents_dialog_helper.h +++ b/libcef/browser/alloy/dialogs/alloy_web_contents_dialog_helper.h @@ -7,6 +7,7 @@ #pragma once #include "base/functional/callback_forward.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "components/web_modal/modal_dialog_host.h" @@ -40,7 +41,7 @@ class AlloyWebContentsDialogHelper private: void OnBoundsChanged(); - CefBrowserPlatformDelegate* const browser_delegate_; + const raw_ptr browser_delegate_; // Used to notify WebContentsModalDialog. base::ObserverList::Unchecked diff --git a/libcef/browser/browser_contents_delegate.cc b/libcef/browser/browser_contents_delegate.cc index f92e4ed43..39ab84865 100644 --- a/libcef/browser/browser_contents_delegate.cc +++ b/libcef/browser/browser_contents_delegate.cc @@ -4,6 +4,7 @@ #include "cef/libcef/browser/browser_contents_delegate.h" +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/browser_host_base.h" #include "cef/libcef/browser/browser_platform_delegate.h" #include "cef/libcef/browser/browser_util.h" @@ -73,8 +74,8 @@ class CefWidgetHostInterceptor private: CefRefPtr const browser_; - content::RenderWidgetHost* const render_widget_host_; - blink::mojom::WidgetHost* const impl_; + const raw_ptr render_widget_host_; + const raw_ptr impl_; }; } // namespace diff --git a/libcef/browser/browser_host_base.h b/libcef/browser/browser_host_base.h index 14bd46991..b908fc3d0 100644 --- a/libcef/browser/browser_host_base.h +++ b/libcef/browser/browser_host_base.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_BROWSER_HOST_BASE_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "base/observer_list.h" #include "base/synchronization/lock.h" #include "cef/include/cef_browser.h" @@ -120,7 +121,7 @@ struct CefBrowserCreateParams { // Used when explicitly creating the browser as an extension host via // ProcessManager::CreateBackgroundHost. Currently used with the alloy // runtime only. - const extensions::Extension* extension = nullptr; + raw_ptr extension = nullptr; extensions::mojom::ViewType extension_host_type = extensions::mojom::ViewType::kInvalid; #endif @@ -438,7 +439,7 @@ class CefBrowserHostBase : public CefBrowserHost, // Only accessed on the UI thread. std::unique_ptr contents_delegate_; CefRefPtr unresponsive_process_callback_; - RenderViewContextMenuObserver* context_menu_observer_ = nullptr; + raw_ptr context_menu_observer_ = nullptr; // Observers that want to be notified of changes to this object. // Only accessed on the UI thread. diff --git a/libcef/browser/browser_info.h b/libcef/browser/browser_info.h index ed8e40747..559aaf3ab 100644 --- a/libcef/browser/browser_info.h +++ b/libcef/browser/browser_info.h @@ -12,6 +12,7 @@ #include "base/containers/unique_ptr_adapters.h" #include "base/functional/callback.h" +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/synchronization/lock.h" @@ -169,7 +170,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe { return frame_ && is_main_frame_ && !is_speculative_ && !is_in_bfcache_; } - content::RenderFrameHost* host_; + raw_ptr host_; content::GlobalRenderFrameHostId global_id_; bool is_main_frame_; bool is_speculative_; @@ -210,7 +211,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe { protected: friend class CefBrowserInfo; - CefBrowserInfo* const browser_info_; + const raw_ptr browser_info_; CefRefPtr frame_handler_; std::unique_ptr browser_info_lock_scope_; std::queue queue_; @@ -219,7 +220,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe { mutable base::Lock notification_lock_; // These members must be protected by |notification_lock_|. - NotificationStateLock* notification_state_lock_ = nullptr; + raw_ptr notification_state_lock_ = nullptr; CefRefPtr frame_handler_; mutable base::Lock lock_; diff --git a/libcef/browser/browser_info_manager.h b/libcef/browser/browser_info_manager.h index f85ec1760..a46458996 100644 --- a/libcef/browser/browser_info_manager.h +++ b/libcef/browser/browser_info_manager.h @@ -11,6 +11,7 @@ #include #include +#include "base/memory/raw_ptr.h" #include "base/synchronization/lock.h" #include "base/task/sequenced_task_runner.h" #include "cef/include/cef_client.h" @@ -209,7 +210,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver { bool use_default_browser_creation = false; // The newly created WebContents (set in WebContentsCreated). - content::WebContents* new_contents = nullptr; + raw_ptr new_contents = nullptr; }; // Manage pending popups. Only called on the UI thread. diff --git a/libcef/browser/browser_platform_delegate.h b/libcef/browser/browser_platform_delegate.h index c1ac04d32..3994c364c 100644 --- a/libcef/browser/browser_platform_delegate.h +++ b/libcef/browser/browser_platform_delegate.h @@ -10,6 +10,7 @@ #include #include "base/functional/callback_forward.h" +#include "base/memory/raw_ptr.h" #include "cef/include/cef_client.h" #include "cef/include/cef_drag_data.h" #include "cef/include/internal/cef_types.h" @@ -409,8 +410,8 @@ class CefBrowserPlatformDelegate { static int TranslateWebEventModifiers(uint32_t cef_modifiers); // Not owned by this object. - content::WebContents* web_contents_ = nullptr; - CefBrowserHostBase* browser_ = nullptr; + raw_ptr web_contents_ = nullptr; + raw_ptr browser_ = nullptr; }; #endif // CEF_LIBCEF_BROWSER_BROWSER_PLATFORM_DELEGATE_H_ diff --git a/libcef/browser/chrome/browser_platform_delegate_chrome.h b/libcef/browser/chrome/browser_platform_delegate_chrome.h index 8fc77a38b..94c33bb22 100644 --- a/libcef/browser/chrome/browser_platform_delegate_chrome.h +++ b/libcef/browser/chrome/browser_platform_delegate_chrome.h @@ -5,6 +5,7 @@ #ifndef CEF_LIBCEF_BROWSER_CHROME_BROWSER_PLATFORM_DELEGATE_CHROME_H_ #define CEF_LIBCEF_BROWSER_CHROME_BROWSER_PLATFORM_DELEGATE_CHROME_H_ +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/browser_platform_delegate.h" #include "cef/libcef/browser/native/browser_platform_delegate_native.h" @@ -60,7 +61,7 @@ class CefBrowserPlatformDelegateChrome std::unique_ptr native_delegate_; - Browser* chrome_browser_ = nullptr; + raw_ptr chrome_browser_ = nullptr; }; #endif // CEF_LIBCEF_BROWSER_CHROME_BROWSER_PLATFORM_DELEGATE_CHROME_H_ diff --git a/libcef/browser/chrome/chrome_browser_context.h b/libcef/browser/chrome/chrome_browser_context.h index d7ca38ed2..b1471f495 100644 --- a/libcef/browser/chrome/chrome_browser_context.h +++ b/libcef/browser/chrome/chrome_browser_context.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_CONTEXT_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "cef/libcef/browser/browser_context.h" #include "chrome/browser/profiles/profile_manager.h" @@ -55,7 +56,7 @@ class ChromeBrowserContext : public CefBrowserContext, public ProfileObserver { void ProfileCreated(CreateStatus status, Profile* profile); base::OnceClosure initialized_cb_; - Profile* profile_ = nullptr; + raw_ptr profile_ = nullptr; bool should_destroy_ = false; bool destroyed_ = false; diff --git a/libcef/browser/chrome/chrome_browser_delegate.cc b/libcef/browser/chrome/chrome_browser_delegate.cc index d315766c9..9da42536a 100644 --- a/libcef/browser/chrome/chrome_browser_delegate.cc +++ b/libcef/browser/chrome/chrome_browser_delegate.cc @@ -244,7 +244,7 @@ void ChromeBrowserDelegate::SetAsDelegate(content::WebContents* web_contents, if (browser_host) { // We already have a browser host, so just change the associated Browser. - browser_host->SetBrowser(set_delegate ? browser_ : nullptr); + browser_host->SetBrowser(set_delegate ? browser_.get() : nullptr); return; } diff --git a/libcef/browser/chrome/chrome_browser_delegate.h b/libcef/browser/chrome/chrome_browser_delegate.h index 20a740e4f..e5789e863 100644 --- a/libcef/browser/chrome/chrome_browser_delegate.h +++ b/libcef/browser/chrome/chrome_browser_delegate.h @@ -9,6 +9,7 @@ #include #include +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/browser_host_base.h" #include "cef/libcef/browser/browser_info.h" #include "cef/libcef/browser/chrome/browser_delegate.h" @@ -161,7 +162,7 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate { CefWindowImpl* GetCefWindowImpl() const; CefWindowView* GetCefWindowView() const; - Browser* const browser_; + const raw_ptr browser_; base::WeakPtr opener_host_; // Used when creating a new browser host. diff --git a/libcef/browser/chrome/chrome_browser_host_impl.h b/libcef/browser/chrome/chrome_browser_host_impl.h index add17dffe..f8566142b 100644 --- a/libcef/browser/chrome/chrome_browser_host_impl.h +++ b/libcef/browser/chrome/chrome_browser_host_impl.h @@ -8,6 +8,7 @@ #include +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "cef/libcef/browser/browser_host_base.h" #include "cef/libcef/browser/chrome/browser_delegate.h" @@ -174,7 +175,7 @@ class ChromeBrowserHostImpl : public CefBrowserHostBase { // TabStripModel::kNoTab if not found. int GetCurrentTabIndex() const; - Browser* browser_ = nullptr; + raw_ptr browser_ = nullptr; CefWindowHandle host_window_handle_ = kNullWindowHandle; base::WeakPtrFactory weak_ptr_factory_{this}; diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.h b/libcef/browser/chrome/chrome_content_browser_client_cef.h index 9f8696ff3..1622ede5f 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.h +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.h @@ -8,6 +8,7 @@ #include +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/request_context_impl.h" #include "chrome/browser/chrome_content_browser_client.h" #include "content/public/browser/web_contents_view_delegate.h" @@ -140,7 +141,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { static std::unique_ptr CreateWebContentsViewDelegate(content::WebContents* web_contents); - ChromeBrowserMainExtraPartsCef* browser_main_parts_ = nullptr; + raw_ptr browser_main_parts_ = nullptr; }; #endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_CONTENT_BROWSER_CLIENT_CEF_ diff --git a/libcef/browser/chrome/chrome_context_menu_handler.cc b/libcef/browser/chrome/chrome_context_menu_handler.cc index a52ecd5e5..6ab04e8c9 100644 --- a/libcef/browser/chrome/chrome_context_menu_handler.cc +++ b/libcef/browser/chrome/chrome_context_menu_handler.cc @@ -4,6 +4,7 @@ #include "cef/libcef/browser/chrome/chrome_context_menu_handler.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "cef/libcef/browser/alloy/alloy_browser_host_impl.h" #include "cef/libcef/browser/browser_host_base.h" @@ -271,7 +272,7 @@ class CefContextMenuObserver : public RenderViewContextMenuObserver, OnMenuClosed(); } - RenderViewContextMenu* const context_menu_; + const raw_ptr context_menu_; CefRefPtr browser_; CefRefPtr handler_; CefRefPtr params_; diff --git a/libcef/browser/chrome/chrome_web_contents_view_delegate_cef.h b/libcef/browser/chrome/chrome_web_contents_view_delegate_cef.h index 50151360d..7fad0509a 100644 --- a/libcef/browser/chrome/chrome_web_contents_view_delegate_cef.h +++ b/libcef/browser/chrome/chrome_web_contents_view_delegate_cef.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_CHROME_CHROME_WEB_CONTENTS_VIEW_DELEGATE_CEF_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "build/build_config.h" #if BUILDFLAG(IS_MAC) @@ -31,7 +32,7 @@ class ChromeWebContentsViewDelegateCef const content::ContextMenuParams& params) override; private: - content::WebContents* const web_contents_; + const raw_ptr web_contents_; }; #endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_WEB_CONTENTS_VIEW_DELEGATE_CEF_H_ diff --git a/libcef/browser/chrome/extensions/chrome_mime_handler_view_guest_delegate_cef.h b/libcef/browser/chrome/extensions/chrome_mime_handler_view_guest_delegate_cef.h index 3ca0d5bb2..d55e7e65c 100644 --- a/libcef/browser/chrome/extensions/chrome_mime_handler_view_guest_delegate_cef.h +++ b/libcef/browser/chrome/extensions/chrome_mime_handler_view_guest_delegate_cef.h @@ -6,6 +6,7 @@ #ifndef CEF_LIBCEF_BROWSER_CHROME_EXTENSIONS_CHROME_MIME_HANDLER_VIEW_GUEST_DELEGATE_CEF_H_ #define CEF_LIBCEF_BROWSER_CHROME_EXTENSIONS_CHROME_MIME_HANDLER_VIEW_GUEST_DELEGATE_CEF_H_ +#include "base/memory/raw_ptr.h" #include "chrome/browser/guest_view/mime_handler_view/chrome_mime_handler_view_guest_delegate.h" namespace extensions { @@ -31,7 +32,7 @@ class ChromeMimeHandlerViewGuestDelegateCef const content::ContextMenuParams& params) override; private: - content::WebContents* owner_web_contents_; + raw_ptr owner_web_contents_; }; } // namespace extensions diff --git a/libcef/browser/chrome/views/browser_platform_delegate_chrome_views.cc b/libcef/browser/chrome/views/browser_platform_delegate_chrome_views.cc index 4719cc14f..444492787 100644 --- a/libcef/browser/chrome/views/browser_platform_delegate_chrome_views.cc +++ b/libcef/browser/chrome/views/browser_platform_delegate_chrome_views.cc @@ -48,7 +48,7 @@ void CefBrowserPlatformDelegateChromeViews::BrowserCreated( void CefBrowserPlatformDelegateChromeViews::NotifyBrowserCreated() { if (auto delegate = browser_view_->delegate()) { - delegate->OnBrowserCreated(browser_view_, browser_); + delegate->OnBrowserCreated(browser_view_, browser_.get()); // DevTools windows hide the notification bubble by default. However, we // don't currently have the ability to intercept WebContents creation via @@ -76,7 +76,8 @@ void CefBrowserPlatformDelegateChromeViews::NotifyBrowserCreated() { void CefBrowserPlatformDelegateChromeViews::NotifyBrowserDestroyed() { if (browser_view_->delegate()) { - browser_view_->delegate()->OnBrowserDestroyed(browser_view_, browser_); + browser_view_->delegate()->OnBrowserDestroyed(browser_view_, + browser_.get()); } } diff --git a/libcef/browser/chrome/views/chrome_browser_frame.h b/libcef/browser/chrome/views/chrome_browser_frame.h index e08d85c23..4d6ebfa80 100644 --- a/libcef/browser/chrome/views/chrome_browser_frame.h +++ b/libcef/browser/chrome/views/chrome_browser_frame.h @@ -8,6 +8,7 @@ #include +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "cef/libcef/browser/views/color_provider_tracker.h" #include "cef/libcef/browser/views/widget.h" @@ -148,8 +149,8 @@ class ChromeBrowserFrame : public BrowserFrame, void NotifyThemeColorsChanged(bool chrome_theme); - CefWindowView* window_view_; - BrowserView* browser_view_ = nullptr; + raw_ptr window_view_; + raw_ptr browser_view_ = nullptr; bool initialized_ = false; bool native_theme_change_ = false; diff --git a/libcef/browser/chrome/views/chrome_browser_view.cc b/libcef/browser/chrome/views/chrome_browser_view.cc index 0a6e638a6..e4b61ea6c 100644 --- a/libcef/browser/chrome/views/chrome_browser_view.cc +++ b/libcef/browser/chrome/views/chrome_browser_view.cc @@ -76,7 +76,8 @@ void ChromeBrowserView::OnGestureEvent(ui::GestureEvent* event) { ToolbarView* ChromeBrowserView::OverrideCreateToolbar() { if (cef_delegate()) { - auto toolbar_type = cef_delegate()->GetChromeToolbarType(cef_browser_view_); + auto toolbar_type = + cef_delegate()->GetChromeToolbarType(cef_browser_view_.get()); std::optional display_mode; switch (toolbar_type) { case CEF_CTT_NORMAL: diff --git a/libcef/browser/chrome/views/chrome_browser_view.h b/libcef/browser/chrome/views/chrome_browser_view.h index 426eb091e..56d36f4bd 100644 --- a/libcef/browser/chrome/views/chrome_browser_view.h +++ b/libcef/browser/chrome/views/chrome_browser_view.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_CHROME_VIEWS_CHROME_BROWSER_VIEW_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "cef/include/views/cef_browser_view.h" #include "cef/include/views/cef_browser_view_delegate.h" #include "cef/libcef/browser/chrome/views/toolbar_view_impl.h" @@ -52,9 +53,9 @@ class ChromeBrowserView CefBrowserViewImpl* cef_browser_view() const { return cef_browser_view_; } private: - CefBrowserViewImpl* const cef_browser_view_; + const raw_ptr cef_browser_view_; - views::WebView* web_view_ = nullptr; + raw_ptr web_view_ = nullptr; bool destroyed_ = false; diff --git a/libcef/browser/chrome/views/toolbar_view_impl.h b/libcef/browser/chrome/views/toolbar_view_impl.h index 7ce1b04e3..9b3f19acb 100644 --- a/libcef/browser/chrome/views/toolbar_view_impl.h +++ b/libcef/browser/chrome/views/toolbar_view_impl.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_CHROME_VIEWS_TOOLBAR_VIEW_IMPL_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "cef/include/views/cef_view_delegate.h" #include "cef/libcef/browser/chrome/views/toolbar_view_view.h" #include "cef/libcef/browser/views/view_impl.h" @@ -46,8 +47,8 @@ class CefToolbarViewImpl CefToolbarViewView* CreateRootView() override; void InitializeRootView() override; - Browser* const browser_; - BrowserView* const browser_view_; + const raw_ptr browser_; + const raw_ptr browser_view_; std::optional const display_mode_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefToolbarViewImpl); diff --git a/libcef/browser/devtools/devtools_controller.h b/libcef/browser/devtools/devtools_controller.h index 4d443a7af..fbd584553 100644 --- a/libcef/browser/devtools/devtools_controller.h +++ b/libcef/browser/devtools/devtools_controller.h @@ -8,6 +8,7 @@ #include #include "base/containers/span.h" +#include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" @@ -68,7 +69,7 @@ class CefDevToolsController : public content::DevToolsAgentHostClient { bool EnsureAgentHost(); - content::WebContents* const inspected_contents_; + const raw_ptr inspected_contents_; scoped_refptr agent_host_; int next_message_id_ = 1; diff --git a/libcef/browser/devtools/devtools_protocol_manager.cc b/libcef/browser/devtools/devtools_protocol_manager.cc index eda87f761..79ba58048 100644 --- a/libcef/browser/devtools/devtools_protocol_manager.cc +++ b/libcef/browser/devtools/devtools_protocol_manager.cc @@ -4,6 +4,7 @@ #include "cef/libcef/browser/devtools/devtools_protocol_manager.h" +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/browser_host_base.h" #include "cef/libcef/browser/devtools/devtools_controller.h" #include "cef/libcef/browser/thread_util.h" @@ -51,7 +52,7 @@ class CefDevToolsRegistrationImpl : public CefRegistration, // CefDevToolsController::Observer methods: bool OnDevToolsMessage(const std::string_view& message) override { CEF_REQUIRE_UIT(); - return observer_->OnDevToolsMessage(browser_, message.data(), + return observer_->OnDevToolsMessage(browser_.get(), message.data(), message.size()); } @@ -59,25 +60,25 @@ class CefDevToolsRegistrationImpl : public CefRegistration, bool success, const std::string_view& result) override { CEF_REQUIRE_UIT(); - observer_->OnDevToolsMethodResult(browser_, message_id, success, + observer_->OnDevToolsMethodResult(browser_.get(), message_id, success, result.data(), result.size()); } void OnDevToolsEvent(const std::string_view& method, const std::string_view& params) override { CEF_REQUIRE_UIT(); - observer_->OnDevToolsEvent(browser_, std::string(method), params.data(), - params.size()); + observer_->OnDevToolsEvent(browser_.get(), std::string(method), + params.data(), params.size()); } void OnDevToolsAgentAttached() override { CEF_REQUIRE_UIT(); - observer_->OnDevToolsAgentAttached(browser_); + observer_->OnDevToolsAgentAttached(browser_.get()); } void OnDevToolsAgentDetached() override { CEF_REQUIRE_UIT(); - observer_->OnDevToolsAgentDetached(browser_); + observer_->OnDevToolsAgentDetached(browser_.get()); } void OnDevToolsControllerDestroyed() override { @@ -88,7 +89,7 @@ class CefDevToolsRegistrationImpl : public CefRegistration, CefRefPtr observer_; - CefBrowserHostBase* browser_ = nullptr; + raw_ptr browser_ = nullptr; base::WeakPtr controller_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDevToolsRegistrationImpl); diff --git a/libcef/browser/devtools/devtools_protocol_manager.h b/libcef/browser/devtools/devtools_protocol_manager.h index a02738492..8fd896343 100644 --- a/libcef/browser/devtools/devtools_protocol_manager.h +++ b/libcef/browser/devtools/devtools_protocol_manager.h @@ -8,6 +8,7 @@ #include +#include "base/memory/raw_ptr.h" #include "cef/include/cef_browser.h" class CefBrowserHostBase; @@ -48,7 +49,7 @@ class CefDevToolsProtocolManager { private: bool EnsureController(); - CefBrowserHostBase* const inspected_browser_; + const raw_ptr inspected_browser_; std::unique_ptr devtools_controller_; }; diff --git a/libcef/browser/download_manager_delegate_impl.h b/libcef/browser/download_manager_delegate_impl.h index af93c1ffe..8cafd725e 100644 --- a/libcef/browser/download_manager_delegate_impl.h +++ b/libcef/browser/download_manager_delegate_impl.h @@ -8,6 +8,7 @@ #include +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "cef/libcef/browser/browser_host_base.h" #include "cef/libcef/browser/download_manager_delegate.h" @@ -57,7 +58,7 @@ class CefDownloadManagerDelegateImpl void ResetManager(); - content::DownloadManager* manager_; + raw_ptr manager_; base::WeakPtrFactory manager_ptr_factory_; const bool alloy_bootstrap_; diff --git a/libcef/browser/extension_impl.cc b/libcef/browser/extension_impl.cc index ec69bbda4..6ca04b76c 100644 --- a/libcef/browser/extension_impl.cc +++ b/libcef/browser/extension_impl.cc @@ -57,7 +57,7 @@ CefRefPtr CefExtensionImpl::GetLoaderContext() { return nullptr; } - return loader_context_; + return loader_context_.get(); } bool CefExtensionImpl::IsLoaded() { diff --git a/libcef/browser/extension_impl.h b/libcef/browser/extension_impl.h index 8e8697058..f7991c0d2 100644 --- a/libcef/browser/extension_impl.h +++ b/libcef/browser/extension_impl.h @@ -8,6 +8,7 @@ #include +#include "base/memory/raw_ptr.h" #include "cef/include/cef_extension.h" #include "cef/include/cef_extension_handler.h" #include "cef/include/cef_request_context.h" @@ -48,7 +49,7 @@ class CefExtensionImpl : public CefExtension { CefString path_; CefRefPtr manifest_; - CefRequestContext* loader_context_; + raw_ptr loader_context_; CefRefPtr handler_; // Only accessed on the UI thread. diff --git a/libcef/browser/extensions/api/tabs/tabs_api.h b/libcef/browser/extensions/api/tabs/tabs_api.h index 0d8071e9b..8eda0674b 100644 --- a/libcef/browser/extensions/api/tabs/tabs_api.h +++ b/libcef/browser/extensions/api/tabs/tabs_api.h @@ -5,6 +5,7 @@ #ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ #define CEF_LIBCEF_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/extensions/extension_function_details.h" #include "chrome/common/extensions/api/tabs.h" #include "extensions/browser/api/execute_code_function.h" @@ -68,7 +69,7 @@ class TabsUpdateFunction : public BaseAPIFunction { DECLARE_EXTENSION_FUNCTION("tabs.update", TABS_UPDATE) int tab_id_ = -1; - content::WebContents* web_contents_ = nullptr; + raw_ptr web_contents_ = nullptr; }; // Implement API calls tabs.executeScript, tabs.insertCSS, and tabs.removeCSS. diff --git a/libcef/browser/extensions/browser_platform_delegate_background.cc b/libcef/browser/extensions/browser_platform_delegate_background.cc index c066123b8..4420a5715 100644 --- a/libcef/browser/extensions/browser_platform_delegate_background.cc +++ b/libcef/browser/extensions/browser_platform_delegate_background.cc @@ -28,8 +28,9 @@ void CefBrowserPlatformDelegateBackground::CloseHostWindow() { // No host window, so continue browser destruction now. Do it asynchronously // so the call stack has a chance to unwind. CEF_POST_TASK( - CEF_UIT, base::BindOnce(&AlloyBrowserHostImpl::WindowDestroyed, - AlloyBrowserHostImpl::FromBaseChecked(browser_))); + CEF_UIT, + base::BindOnce(&AlloyBrowserHostImpl::WindowDestroyed, + AlloyBrowserHostImpl::FromBaseChecked(browser_.get()))); } CefWindowHandle CefBrowserPlatformDelegateBackground::GetHostWindowHandle() diff --git a/libcef/browser/extensions/extension_function_details.h b/libcef/browser/extensions/extension_function_details.h index ec8bb7b24..31aeeffce 100644 --- a/libcef/browser/extensions/extension_function_details.h +++ b/libcef/browser/extensions/extension_function_details.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DETAILS_H_ #include "base/functional/callback_forward.h" +#include "base/memory/raw_ptr.h" #include "cef/include/cef_extension.h" #include "cef/libcef/browser/alloy/alloy_browser_host_impl.h" #include "chrome/common/extensions/api/tabs.h" @@ -136,7 +137,7 @@ class CefExtensionFunctionDetails { private: // The function for which these details have been created. Must outlive the // CefExtensionFunctionDetails instance. - ExtensionFunction* function_; + raw_ptr function_; mutable CefRefPtr cef_extension_; diff --git a/libcef/browser/extensions/extension_system.h b/libcef/browser/extensions/extension_system.h index 7c378a64f..97370b012 100644 --- a/libcef/browser/extensions/extension_system.h +++ b/libcef/browser/extensions/extension_system.h @@ -9,6 +9,7 @@ #include #include +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/one_shot_event.h" #include "cef/include/cef_extension_handler.h" @@ -152,7 +153,7 @@ class CefExtensionSystem : public ExtensionSystem { void NotifyExtensionUnloaded(const Extension* extension, UnloadedExtensionReason reason); - content::BrowserContext* browser_context_; // Not owned. + raw_ptr browser_context_; // Not owned. bool initialized_ = false; @@ -169,11 +170,11 @@ class CefExtensionSystem : public ExtensionSystem { base::OneShotEvent ready_; // Sets of enabled/disabled/terminated/blacklisted extensions. Not owned. - ExtensionRegistry* registry_; + raw_ptr registry_; // The associated RendererStartupHelper. Guaranteed to outlive the // ExtensionSystem, and thus us. - extensions::RendererStartupHelper* renderer_helper_; + raw_ptr renderer_helper_; // Map of extension ID to CEF extension object. ExtensionMap extension_map_; diff --git a/libcef/browser/extensions/mime_handler_view_guest_delegate.h b/libcef/browser/extensions/mime_handler_view_guest_delegate.h index e7db6c327..9c0f9d3e5 100644 --- a/libcef/browser/extensions/mime_handler_view_guest_delegate.h +++ b/libcef/browser/extensions/mime_handler_view_guest_delegate.h @@ -6,6 +6,7 @@ #ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_MIME_HANDLER_VIEW_GUEST_DELEGATE_H_ #define CEF_LIBCEF_BROWSER_EXTENSIONS_MIME_HANDLER_VIEW_GUEST_DELEGATE_H_ +#include "base/memory/raw_ptr.h" #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h" namespace content { @@ -34,7 +35,7 @@ class CefMimeHandlerViewGuestDelegate : public MimeHandlerViewGuestDelegate { const content::ContextMenuParams& params) override; private: - content::WebContents* owner_web_contents_; + raw_ptr owner_web_contents_; }; } // namespace extensions diff --git a/libcef/browser/extensions/value_store/cef_value_store_factory.h b/libcef/browser/extensions/value_store/cef_value_store_factory.h index 3a60e657d..d713af26f 100644 --- a/libcef/browser/extensions/value_store/cef_value_store_factory.h +++ b/libcef/browser/extensions/value_store/cef_value_store_factory.h @@ -10,6 +10,7 @@ #include #include "base/files/file_path.h" +#include "base/memory/raw_ptr.h" #include "components/value_store/value_store_factory.h" namespace value_store { @@ -48,7 +49,7 @@ class CefValueStoreFactory : public ValueStoreFactory { std::unique_ptr CreateStore(); base::FilePath db_path_; - ValueStore* last_created_store_ = nullptr; + raw_ptr last_created_store_ = nullptr; // A mapping from directories to their ValueStore. None of these value // stores are owned by this factory, so care must be taken when calling diff --git a/libcef/browser/file_dialog_manager.cc b/libcef/browser/file_dialog_manager.cc index 783457343..fe2717d89 100644 --- a/libcef/browser/file_dialog_manager.cc +++ b/libcef/browser/file_dialog_manager.cc @@ -7,6 +7,7 @@ #include +#include "base/memory/raw_ptr.h" #include "base/strings/utf_string_conversions.h" #include "cef/include/cef_dialog_handler.h" #include "cef/libcef/browser/browser_host_base.h" @@ -253,8 +254,8 @@ class CefSelectFileDialogListener : public ui::SelectFileDialog::Listener { delete this; } - ui::SelectFileDialog::Listener* const listener_; - void* const params_; + const raw_ptr listener_; + const raw_ptr params_; base::OnceClosure callback_; // Used to avoid re-entrancy from Cancel(). @@ -488,8 +489,9 @@ CefFileDialogManager::MaybeRunDelegate( CefRefPtr callbackImpl( new CefFileDialogCallbackImpl(std::move(callback))); const bool handled = handler->OnFileDialog( - browser_, static_cast(mode), params.title, - params.default_file_name.value(), accept_filters, callbackImpl.get()); + browser_.get(), static_cast(mode), + params.title, params.default_file_name.value(), accept_filters, + callbackImpl.get()); if (!handled) { // May return nullptr if the client has already executed the callback. callback = callbackImpl->Disconnect(); diff --git a/libcef/browser/file_dialog_manager.h b/libcef/browser/file_dialog_manager.h index 4abbb3f74..2254b679d 100644 --- a/libcef/browser/file_dialog_manager.h +++ b/libcef/browser/file_dialog_manager.h @@ -10,6 +10,7 @@ #include #include +#include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "cef/include/cef_browser.h" #include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h" @@ -83,11 +84,11 @@ class CefFileDialogManager { void SelectFileDoneByListenerCallback(bool listener_destroyed); // CefBrowserHostBase pointer is guaranteed to outlive this object. - CefBrowserHostBase* const browser_; + const raw_ptr browser_; // Used when running a platform dialog via RunSelectFile. scoped_refptr dialog_; - CefSelectFileDialogListener* dialog_listener_ = nullptr; + raw_ptr dialog_listener_ = nullptr; // List of all currently active listeners. std::set active_listeners_; diff --git a/libcef/browser/frame_host_impl.h b/libcef/browser/frame_host_impl.h index c12e110e8..0fb3306a4 100644 --- a/libcef/browser/frame_host_impl.h +++ b/libcef/browser/frame_host_impl.h @@ -11,6 +11,7 @@ #include #include +#include "base/memory/raw_ptr.h" #include "base/synchronization/lock.h" #include "cef/include/cef_frame.h" #include "cef/libcef/common/mojom/cef.mojom.h" @@ -195,7 +196,7 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame { std::optional parent_frame_token_; // The following members are only accessed on the UI thread. - content::RenderFrameHost* render_frame_host_ = nullptr; + raw_ptr render_frame_host_ = nullptr; std::queue> queued_renderer_actions_; diff --git a/libcef/browser/frame_service_base.h b/libcef/browser/frame_service_base.h index da9bc8a4c..ee4d4c097 100644 --- a/libcef/browser/frame_service_base.h +++ b/libcef/browser/frame_service_base.h @@ -9,6 +9,7 @@ #include "base/functional/bind.h" #include "base/logging.h" +#include "base/memory/raw_ptr.h" #include "base/threading/thread_checker.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/render_frame_host.h" @@ -116,7 +117,7 @@ class FrameServiceBase : public Interface, public WebContentsObserver { delete this; } - RenderFrameHost* const render_frame_host_ = nullptr; + const raw_ptr render_frame_host_ = nullptr; const url::Origin origin_; mojo::Receiver receiver_; }; diff --git a/libcef/browser/hang_monitor.cc b/libcef/browser/hang_monitor.cc index 7d1a0282c..825708629 100644 --- a/libcef/browser/hang_monitor.cc +++ b/libcef/browser/hang_monitor.cc @@ -4,6 +4,7 @@ #include "cef/libcef/browser/hang_monitor.h" +#include "base/memory/raw_ptr.h" #include "build/build_config.h" #include "cef/include/cef_client.h" #include "cef/libcef/browser/browser_host_base.h" @@ -87,7 +88,7 @@ class CefUnresponsiveProcessCallbackImpl } } - content::RenderWidgetHost* render_widget_host_; + raw_ptr render_widget_host_; base::RepeatingClosure hang_monitor_restarter_; IMPLEMENT_REFCOUNTING(CefUnresponsiveProcessCallbackImpl); diff --git a/libcef/browser/javascript_dialog_manager.cc b/libcef/browser/javascript_dialog_manager.cc index 94b4d496e..0deec1938 100644 --- a/libcef/browser/javascript_dialog_manager.cc +++ b/libcef/browser/javascript_dialog_manager.cc @@ -124,7 +124,7 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog( // Execute the user callback. bool handled = handler->OnJSDialog( - browser_, origin_url.spec(), + browser_.get(), origin_url.spec(), static_cast(message_type), message_text, default_prompt_text, callbackPtr.get(), *did_suppress_message); if (handled) { @@ -206,7 +206,7 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog( // Execute the user callback. bool handled = handler->OnBeforeUnloadDialog( - browser_, message_text, is_reload, callbackPtr.get()); + browser_.get(), message_text, is_reload, callbackPtr.get()); if (handled) { return; } @@ -281,7 +281,7 @@ void CefJavaScriptDialogManager::CancelDialogs( bool reset_state) { if (handler_) { if (reset_state) { - handler_->OnResetDialogState(browser_); + handler_->OnResetDialogState(browser_.get()); } handler_ = nullptr; return; @@ -314,7 +314,7 @@ void CefJavaScriptDialogManager::DialogClosed( bool success, const std::u16string& user_input) { if (handler_) { - handler_->OnDialogClosed(browser_); + handler_->OnDialogClosed(browser_.get()); // Call OnResetDialogState. CancelDialogs(/*web_contents=*/nullptr, /*reset_state=*/true); } diff --git a/libcef/browser/javascript_dialog_manager.h b/libcef/browser/javascript_dialog_manager.h index 38d045edd..5779c9f49 100644 --- a/libcef/browser/javascript_dialog_manager.h +++ b/libcef/browser/javascript_dialog_manager.h @@ -10,6 +10,7 @@ #include #include +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "cef/include/cef_jsdialog_handler.h" #include "cef/libcef/browser/javascript_dialog_runner.h" @@ -60,7 +61,7 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager { bool CanUseChromeDialogs() const; // CefBrowserHostBase pointer is guaranteed to outlive this object. - CefBrowserHostBase* const browser_; + const raw_ptr browser_; CefRefPtr handler_; diff --git a/libcef/browser/main_runner.cc b/libcef/browser/main_runner.cc index 985b11569..1aed49979 100644 --- a/libcef/browser/main_runner.cc +++ b/libcef/browser/main_runner.cc @@ -9,6 +9,7 @@ #include "base/base_switches.h" #include "base/command_line.h" #include "base/debug/debugger.h" +#include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "base/sequence_checker.h" #include "base/synchronization/lock.h" @@ -236,7 +237,7 @@ class CefUIThread : public base::PlatformThread::Delegate { #endif } - CefMainRunner* const runner_; + const raw_ptr runner_; base::OnceClosure setup_callback_; base::OnceClosure shutdown_callback_; diff --git a/libcef/browser/media_router/media_router_manager.cc b/libcef/browser/media_router/media_router_manager.cc index 70ed1306e..9014ffc87 100644 --- a/libcef/browser/media_router/media_router_manager.cc +++ b/libcef/browser/media_router/media_router_manager.cc @@ -4,6 +4,7 @@ #include "cef/libcef/browser/media_router/media_router_manager.h" +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/browser_context.h" #include "cef/libcef/browser/thread_util.h" #include "components/media_router/browser/media_router_factory.h" @@ -34,7 +35,7 @@ class CefMediaRoutesObserver : public media_router::MediaRoutesObserver { } private: - CefMediaRouterManager* const manager_; + const raw_ptr manager_; }; // Used to receive messages if PresentationConnection is not supported. @@ -61,7 +62,7 @@ class CefPresentationConnectionMessageObserver } private: - CefMediaRouterManager* const manager_; + const raw_ptr manager_; const media_router::MediaRoute route_; }; @@ -118,7 +119,7 @@ class CefPresentationConnection : public blink::mojom::PresentationConnection { } private: - CefMediaRouterManager* const manager_; + const raw_ptr manager_; const media_router::MediaRoute route_; // Used to receive messages from the MRP. diff --git a/libcef/browser/media_router/media_router_manager.h b/libcef/browser/media_router/media_router_manager.h index 5fbead4fa..cd5c4a316 100644 --- a/libcef/browser/media_router/media_router_manager.h +++ b/libcef/browser/media_router/media_router_manager.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MANAGER_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "cef/include/cef_media_router.h" @@ -107,7 +108,7 @@ class CefMediaRouterManager RouteState* GetRouteState(const media_router::MediaRoute::Id& route_id); void RemoveRouteState(const media_router::MediaRoute::Id& route_id); - content::BrowserContext* const browser_context_; + const raw_ptr browser_context_; base::ObserverList observers_; diff --git a/libcef/browser/media_stream_registrar.cc b/libcef/browser/media_stream_registrar.cc index 1722078b0..ffe07daaf 100644 --- a/libcef/browser/media_stream_registrar.cc +++ b/libcef/browser/media_stream_registrar.cc @@ -105,7 +105,7 @@ void CefMediaStreamRegistrar::NotifyMediaStreamChange() { if (auto client = browser_->GetClient()) { if (auto handler = client->GetDisplayHandler()) { - handler->OnMediaAccessChange(browser_, video, audio); + handler->OnMediaAccessChange(browser_.get(), video, audio); } } } diff --git a/libcef/browser/media_stream_registrar.h b/libcef/browser/media_stream_registrar.h index c6fc3754e..9d1e09f89 100644 --- a/libcef/browser/media_stream_registrar.h +++ b/libcef/browser/media_stream_registrar.h @@ -10,6 +10,7 @@ #include #include +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "content/public/browser/media_stream_request.h" @@ -37,7 +38,7 @@ class CefMediaStreamRegistrar { void NotifyMediaStreamChange(); // Guaranteed to outlive this object. - CefBrowserHostBase* const browser_; + const raw_ptr browser_; struct MediaStreamInfo { bool video; diff --git a/libcef/browser/menu_manager.cc b/libcef/browser/menu_manager.cc index dd2b5ef16..049e9c206 100644 --- a/libcef/browser/menu_manager.cc +++ b/libcef/browser/menu_manager.cc @@ -151,7 +151,7 @@ bool CefMenuManager::CreateContextMenu( new CefContextMenuParamsImpl(¶ms_)); CefRefPtr frame = browser_->GetFocusedFrame(); - handler->OnBeforeContextMenu(browser_, frame, paramsPtr.get(), + handler->OnBeforeContextMenu(browser_.get(), frame, paramsPtr.get(), model_.get()); MenuWillShow(model_); @@ -166,7 +166,7 @@ bool CefMenuManager::CreateContextMenu( // the callback object is deleted. custom_menu_callback_ = callbackImpl.get(); - if (handler->RunContextMenu(browser_, frame, paramsPtr.get(), + if (handler->RunContextMenu(browser_.get(), frame, paramsPtr.get(), model_.get(), callbackImpl.get())) { custom_menu = true; } else { @@ -224,8 +224,8 @@ void CefMenuManager::ExecuteCommand(CefRefPtr source, new CefContextMenuParamsImpl(¶ms_)); bool handled = handler->OnContextMenuCommand( - browser_, browser_->GetFocusedFrame(), paramsPtr.get(), command_id, - event_flags); + browser_.get(), browser_->GetFocusedFrame(), paramsPtr.get(), + command_id, event_flags); // Do not keep references to the parameters in the callback. std::ignore = paramsPtr->Detach(nullptr); @@ -277,7 +277,8 @@ void CefMenuManager::MenuClosed(CefRefPtr source) { if (client.get()) { CefRefPtr handler = client->GetContextMenuHandler(); if (handler.get()) { - handler->OnContextMenuDismissed(browser_, browser_->GetFocusedFrame()); + handler->OnContextMenuDismissed(browser_.get(), + browser_->GetFocusedFrame()); } } diff --git a/libcef/browser/menu_manager.h b/libcef/browser/menu_manager.h index 1a9a889ca..e49234147 100644 --- a/libcef/browser/menu_manager.h +++ b/libcef/browser/menu_manager.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_MENU_MANAGER_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "cef/libcef/browser/menu_model_impl.h" #include "cef/libcef/browser/menu_runner.h" @@ -62,7 +63,7 @@ class CefMenuManager : public CefMenuModelImpl::Delegate, bool IsCustomContextMenuCommand(int command_id); // AlloyBrowserHostImpl pointer is guaranteed to outlive this object. - AlloyBrowserHostImpl* browser_; + raw_ptr browser_; std::unique_ptr runner_; @@ -70,7 +71,7 @@ class CefMenuManager : public CefMenuModelImpl::Delegate, content::ContextMenuParams params_; // Not owned by this class. - CefRunContextMenuCallback* custom_menu_callback_ = nullptr; + raw_ptr custom_menu_callback_ = nullptr; // Must be the last member. base::WeakPtrFactory weak_ptr_factory_; diff --git a/libcef/browser/menu_model_impl.cc b/libcef/browser/menu_model_impl.cc index 52c817cd4..3ebc00e7d 100644 --- a/libcef/browser/menu_model_impl.cc +++ b/libcef/browser/menu_model_impl.cc @@ -10,6 +10,7 @@ #include "base/functional/bind.h" #include "base/logging.h" +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/thread_util.h" #include "cef/libcef/common/task_runner_impl.h" #include "third_party/blink/public/mojom/context_menu/context_menu.mojom.h" @@ -169,7 +170,7 @@ class CefSimpleMenuModel : public ui::MenuModel { void MenuWillClose() override { impl_->MenuWillClose(); } private: - CefMenuModelImpl* impl_; + raw_ptr impl_; }; cef_menu_color_type_t GetMenuColorType(bool is_text, diff --git a/libcef/browser/menu_model_impl.h b/libcef/browser/menu_model_impl.h index b83d27090..30585fd75 100644 --- a/libcef/browser/menu_model_impl.h +++ b/libcef/browser/menu_model_impl.h @@ -9,6 +9,7 @@ #include +#include "base/memory/raw_ptr.h" #include "base/threading/platform_thread.h" #include "cef/include/cef_menu_model.h" #include "cef/include/cef_menu_model_delegate.h" @@ -213,7 +214,7 @@ class CefMenuModelImpl : public CefMenuModel { base::PlatformThreadId supported_thread_id_; // Used when created via CefMenuManager. - Delegate* delegate_; + raw_ptr delegate_; // Used when created via CefMenuModel::CreateMenuModel(). CefRefPtr menu_model_delegate_; diff --git a/libcef/browser/native/browser_platform_delegate_native.h b/libcef/browser/native/browser_platform_delegate_native.h index 0d6a6ab97..527fb21b1 100644 --- a/libcef/browser/native/browser_platform_delegate_native.h +++ b/libcef/browser/native/browser_platform_delegate_native.h @@ -5,6 +5,7 @@ #ifndef CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_H_ #define CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_H_ +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/alloy/browser_platform_delegate_alloy.h" // Base implementation of native browser functionality. @@ -70,7 +71,7 @@ class CefBrowserPlatformDelegateNative const SkColor background_color_; // Not owned by this object. - WindowlessHandler* windowless_handler_ = nullptr; + raw_ptr windowless_handler_ = nullptr; }; #endif // CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_H_ diff --git a/libcef/browser/native/browser_platform_delegate_native_aura.h b/libcef/browser/native/browser_platform_delegate_native_aura.h index 610825545..1298a4059 100644 --- a/libcef/browser/native/browser_platform_delegate_native_aura.h +++ b/libcef/browser/native/browser_platform_delegate_native_aura.h @@ -5,6 +5,7 @@ #ifndef CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_AURA_H_ #define CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_AURA_H_ +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "cef/libcef/browser/native/browser_platform_delegate_native.h" #include "ui/events/event.h" @@ -79,7 +80,7 @@ class CefBrowserPlatformDelegateNativeAura // Widget hosting the web contents. It will be deleted automatically when the // associated root window is destroyed. - views::Widget* window_widget_ = nullptr; + raw_ptr window_widget_ = nullptr; private: // Will only be called if the Widget is deleted before diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.cc b/libcef/browser/native/browser_platform_delegate_native_linux.cc index f66a7c517..710af3785 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.cc +++ b/libcef/browser/native/browser_platform_delegate_native_linux.cc @@ -65,7 +65,7 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() { // Create a new window object. It will delete itself when the associated X11 // window is destroyed. window_x11_ = - new CefWindowX11(browser_, parent_window, rect, + new CefWindowX11(browser_.get(), parent_window, rect, CefString(&window_info_.window_name).ToString()); DCHECK_NE(window_x11_->xwindow(), x11::Window::None); window_info_.window = diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.h b/libcef/browser/native/browser_platform_delegate_native_linux.h index f8f8117a9..796288728 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.h +++ b/libcef/browser/native/browser_platform_delegate_native_linux.h @@ -5,6 +5,7 @@ #ifndef CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_LINUX_H_ #define CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_LINUX_H_ +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/native/browser_platform_delegate_native_aura.h" #include "ui/base/ozone_buildflags.h" @@ -44,7 +45,7 @@ class CefBrowserPlatformDelegateNativeLinux bool host_window_created_ = false; #if BUILDFLAG(IS_OZONE_X11) - CefWindowX11* window_x11_ = nullptr; + raw_ptr window_x11_ = nullptr; #endif }; diff --git a/libcef/browser/native/window_delegate_view.cc b/libcef/browser/native/window_delegate_view.cc index 2dec779f5..5b75c2091 100644 --- a/libcef/browser/native/window_delegate_view.cc +++ b/libcef/browser/native/window_delegate_view.cc @@ -74,7 +74,7 @@ void CefWindowDelegateView::Init(gfx::AcceleratedWidget parent_widget, void CefWindowDelegateView::InitContent() { SetBackground(views::CreateSolidBackground(background_color_)); SetLayoutManager(std::make_unique()); - AddChildView(web_view_); + AddChildView(web_view_.get()); } void CefWindowDelegateView::DeleteDelegate() { diff --git a/libcef/browser/native/window_delegate_view.h b/libcef/browser/native/window_delegate_view.h index 1205aea9f..c9aaf8131 100644 --- a/libcef/browser/native/window_delegate_view.h +++ b/libcef/browser/native/window_delegate_view.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_NATIVE_WINDOW_DELEGATE_VIEW_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "ui/views/widget/widget_delegate.h" namespace content { @@ -54,7 +55,7 @@ class CefWindowDelegateView : public views::WidgetDelegateView { base::RepeatingClosure on_bounds_changed_; base::OnceClosure on_delete_; - views::WebView* web_view_ = nullptr; + raw_ptr web_view_ = nullptr; }; #endif // CEF_LIBCEF_BROWSER_NATIVE_WINDOW_DELEGATE_VIEW_H_ diff --git a/libcef/browser/native/window_x11.h b/libcef/browser/native/window_x11.h index 2d2011ed5..055924741 100644 --- a/libcef/browser/native/window_x11.h +++ b/libcef/browser/native/window_x11.h @@ -7,6 +7,7 @@ #define CEF_LIBCEF_BROWSER_NATIVE_WINDOW_X11_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "cef/include/internal/cef_ptr.h" #include "ui/events/platform/platform_event_dispatcher.h" @@ -70,7 +71,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher, CefRefPtr browser_; // The display and the native X window hosting the root window. - x11::Connection* const connection_; + const raw_ptr connection_; x11::Window parent_xwindow_; x11::Window xwindow_; diff --git a/libcef/browser/net/chrome_scheme_handler.cc b/libcef/browser/net/chrome_scheme_handler.cc index 92f59a8d0..b902c6444 100644 --- a/libcef/browser/net/chrome_scheme_handler.cc +++ b/libcef/browser/net/chrome_scheme_handler.cc @@ -15,6 +15,7 @@ #include "base/lazy_instance.h" #include "base/logging.h" #include "base/memory/ptr_util.h" +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted_memory.h" #include "base/path_service.h" #include "base/strings/string_util.h" @@ -504,7 +505,7 @@ class CefURLDataSource : public content::URLDataSource { private: const std::string host_; const ChromeHostId host_id_; - Profile* const profile_; + const raw_ptr profile_; std::string mime_type_; scoped_refptr output_; diff --git a/libcef/browser/net_service/proxy_url_loader_factory.cc b/libcef/browser/net_service/proxy_url_loader_factory.cc index d6d8137d7..24881c47a 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.cc +++ b/libcef/browser/net_service/proxy_url_loader_factory.cc @@ -9,6 +9,7 @@ #include "base/barrier_closure.h" #include "base/command_line.h" +#include "base/memory/raw_ptr.h" #include "base/strings/string_number_conversions.h" #include "cef/libcef/browser/context.h" #include "cef/libcef/browser/origin_whitelist_impl.h" @@ -324,7 +325,7 @@ class InterceptedRequest : public network::mojom::URLLoader, void OnUploadProgressACK(); - ProxyURLLoaderFactory* const factory_; + const raw_ptr factory_; const int32_t id_; const uint32_t options_; bool input_stream_previously_failed_ = false; @@ -373,7 +374,7 @@ class InterceptedRequest : public network::mojom::URLLoader, mojo::Receiver header_client_receiver_{ this}; - StreamReaderURLLoader* stream_loader_ = nullptr; + raw_ptr stream_loader_ = nullptr; base::WeakPtrFactory weak_factory_; }; diff --git a/libcef/browser/net_service/resource_handler_wrapper.cc b/libcef/browser/net_service/resource_handler_wrapper.cc index 40b2dd819..5bf5ce747 100644 --- a/libcef/browser/net_service/resource_handler_wrapper.cc +++ b/libcef/browser/net_service/resource_handler_wrapper.cc @@ -4,6 +4,7 @@ #include "cef/libcef/browser/net_service/resource_handler_wrapper.h" +#include "base/memory/raw_ptr.h" #include "base/strings/string_number_conversions.h" #include "cef/libcef/browser/net_service/proxy_url_loader_factory.h" #include "cef/libcef/browser/thread_util.h" @@ -224,7 +225,7 @@ class ReadResponseCallbackWrapper : public CefCallback { } scoped_refptr handler_provider_; - net::IOBuffer* const dest_; + const raw_ptr dest_; int length_; CefRefPtr callback_; diff --git a/libcef/browser/net_service/resource_request_handler_wrapper.cc b/libcef/browser/net_service/resource_request_handler_wrapper.cc index 4c292d87e..0fa4dd94e 100644 --- a/libcef/browser/net_service/resource_request_handler_wrapper.cc +++ b/libcef/browser/net_service/resource_request_handler_wrapper.cc @@ -6,6 +6,7 @@ #include +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/browser_host_base.h" #include "cef/libcef/browser/context.h" #include "cef/libcef/browser/iothread_state.h" @@ -142,7 +143,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { } const int32_t id_; - network::ResourceRequest* const request_; + const raw_ptr request_; const bool request_was_redirected_; OnBeforeRequestResultCallback callback_; CancelRequestCallback cancel_callback_; @@ -357,7 +358,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { } base::Lock lock_; - InterceptedRequestHandlerWrapper* wrapper_; + raw_ptr wrapper_; }; InterceptedRequestHandlerWrapper() diff --git a/libcef/browser/osr/browser_platform_delegate_osr.cc b/libcef/browser/osr/browser_platform_delegate_osr.cc index 11368aa44..287ebdd67 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr.cc +++ b/libcef/browser/osr/browser_platform_delegate_osr.cc @@ -176,7 +176,7 @@ gfx::Point CefBrowserPlatformDelegateOsr::GetScreenPoint( CefRefPtr handler = browser_->client()->GetRenderHandler(); if (handler.get()) { int screenX = 0, screenY = 0; - if (handler->GetScreenPoint(browser_, view.x(), view.y(), screenX, + if (handler->GetScreenPoint(browser_.get(), view.x(), view.y(), screenX, screenY)) { gfx::Point screen_point(screenX, screenY); #if !BUILDFLAG(IS_MAC) @@ -537,7 +537,7 @@ void CefBrowserPlatformDelegateOsr::StartDragging( drag_data->SetReadOnly(true); base::CurrentThread::ScopedAllowApplicationTasksInNativeNestedLoop allow; handled = handler->StartDragging( - browser_, drag_data.get(), + browser_.get(), drag_data.get(), static_cast(allowed_ops), event_info.location.x(), event_info.location.y()); } @@ -556,7 +556,8 @@ void CefBrowserPlatformDelegateOsr::UpdateDragOperation( browser_->GetClient()->GetRenderHandler(); if (handler.get()) { handler->UpdateDragCursor( - browser_, static_cast(operation)); + browser_.get(), + static_cast(operation)); } } diff --git a/libcef/browser/osr/browser_platform_delegate_osr.h b/libcef/browser/osr/browser_platform_delegate_osr.h index 6ceffde6f..1d0ff49b2 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr.h +++ b/libcef/browser/osr/browser_platform_delegate_osr.h @@ -5,6 +5,7 @@ #ifndef CEF_LIBCEF_BROWSER_OSR_BROWSER_PLATFORM_DELEGATE_OSR_H_ #define CEF_LIBCEF_BROWSER_OSR_BROWSER_PLATFORM_DELEGATE_OSR_H_ +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/alloy/browser_platform_delegate_alloy.h" #include "cef/libcef/browser/native/browser_platform_delegate_native.h" @@ -113,7 +114,8 @@ class CefBrowserPlatformDelegateOsr const bool use_shared_texture_; const bool use_external_begin_frame_; - CefWebContentsViewOSR* view_osr_ = nullptr; // Not owned by this class. + // Not owned by this class. + raw_ptr view_osr_ = nullptr; // Pending drag/drop data. CefRefPtr drag_data_; @@ -126,7 +128,7 @@ class CefBrowserPlatformDelegateOsr // We also keep track of the RenderViewHost we're dragging over to avoid // sending the drag exited message after leaving the current // view. |current_rvh_for_drag_| should not be dereferenced. - void* current_rvh_for_drag_ = nullptr; + raw_ptr current_rvh_for_drag_ = nullptr; // We keep track of the RenderWidgetHost from which the current drag started, // in order to properly route the drag end message to it. diff --git a/libcef/browser/osr/host_display_client_osr.cc b/libcef/browser/osr/host_display_client_osr.cc index e9212a19b..b2f7efa4c 100644 --- a/libcef/browser/osr/host_display_client_osr.cc +++ b/libcef/browser/osr/host_display_client_osr.cc @@ -6,6 +6,7 @@ #include +#include "base/memory/raw_ptr.h" #include "base/memory/shared_memory_mapping.h" #include "cef/libcef/browser/osr/render_widget_host_view_osr.h" #include "components/viz/common/resources/resource_sizes.h" @@ -43,7 +44,7 @@ class CefLayeredWindowUpdaterOSR : public viz::mojom::LayeredWindowUpdater { void Draw(const gfx::Rect& damage_rect, DrawCallback draw_callback) override; private: - CefRenderWidgetHostViewOSR* const view_; + const raw_ptr view_; mojo::Receiver receiver_; bool active_ = false; base::WritableSharedMemoryMapping shared_memory_; diff --git a/libcef/browser/osr/host_display_client_osr.h b/libcef/browser/osr/host_display_client_osr.h index 5ec600b93..8b3dedd51 100644 --- a/libcef/browser/osr/host_display_client_osr.h +++ b/libcef/browser/osr/host_display_client_osr.h @@ -8,6 +8,7 @@ #include #include "base/functional/callback.h" +#include "base/memory/raw_ptr.h" #include "base/memory/shared_memory_mapping.h" #include "components/viz/host/host_display_client.h" #include "ui/gfx/native_widget_types.h" @@ -41,7 +42,7 @@ class CefHostDisplayClientOSR : public viz::HostDisplayClient { void DidCompleteSwapWithNewSize(const gfx::Size& size) override; #endif - CefRenderWidgetHostViewOSR* const view_; + const raw_ptr view_; std::unique_ptr layered_window_updater_; bool active_ = false; }; diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 4f1997363..582e198bb 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -13,6 +13,7 @@ #include "base/command_line.h" #include "base/functional/callback_helpers.h" #include "base/memory/ptr_util.h" +#include "base/memory/raw_ptr.h" #include "base/strings/utf_string_conversions.h" #include "cc/base/switches.h" #include "cef/libcef/browser/alloy/alloy_browser_host_impl.h" @@ -126,7 +127,7 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient { bool ShouldShowStaleContentOnEviction() override { return false; } private: - CefRenderWidgetHostViewOSR* const view_; + const raw_ptr view_; }; ui::GestureProvider::Config CreateGestureProviderConfig() { @@ -1034,7 +1035,7 @@ CefRenderWidgetHostViewOSR::CreateHostDisplayClient() { host_display_client_ = new CefHostDisplayClientOSR(this, gfx::kNullAcceleratedWidget); host_display_client_->SetActive(true); - return base::WrapUnique(host_display_client_); + return base::WrapUnique(host_display_client_.get()); } bool CefRenderWidgetHostViewOSR::InstallTransparency() { diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index a8660d637..5dd54eb7b 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -11,6 +11,7 @@ #include #include +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "build/build_config.h" #include "cc/layers/deadline_policy.h" @@ -407,7 +408,7 @@ class CefRenderWidgetHostViewOSR bool external_begin_frame_enabled_ = false; bool needs_external_begin_frames_ = false; - CefHostDisplayClientOSR* host_display_client_ = nullptr; + raw_ptr host_display_client_ = nullptr; std::unique_ptr video_consumer_; bool hold_resize_ = false; @@ -418,12 +419,12 @@ class CefRenderWidgetHostViewOSR // The associated Model. While |this| is being Destroyed, // |render_widget_host_| is NULL and the message loop is run one last time // Message handlers must check for a NULL |render_widget_host_|. - content::RenderWidgetHostImpl* render_widget_host_; + raw_ptr render_widget_host_; bool has_parent_; - CefRenderWidgetHostViewOSR* parent_host_view_; - CefRenderWidgetHostViewOSR* popup_host_view_ = nullptr; - CefRenderWidgetHostViewOSR* child_host_view_ = nullptr; + raw_ptr parent_host_view_; + raw_ptr popup_host_view_ = nullptr; + raw_ptr child_host_view_ = nullptr; std::set guest_host_views_; CefRefPtr browser_impl_; diff --git a/libcef/browser/osr/video_consumer_osr.h b/libcef/browser/osr/video_consumer_osr.h index 921b50582..51fe4b6cb 100644 --- a/libcef/browser/osr/video_consumer_osr.h +++ b/libcef/browser/osr/video_consumer_osr.h @@ -4,6 +4,7 @@ #include #include "base/functional/callback.h" +#include "base/memory/raw_ptr.h" #include "components/viz/host/client_frame_sink_video_capturer.h" #include "media/capture/mojom/video_capture_types.mojom.h" @@ -40,7 +41,7 @@ class CefVideoConsumerOSR : public viz::mojom::FrameSinkVideoConsumer { const bool use_shared_texture_; - CefRenderWidgetHostViewOSR* const view_; + const raw_ptr view_; std::unique_ptr video_capturer_; gfx::Size size_in_pixels_; diff --git a/libcef/browser/osr/web_contents_view_osr.h b/libcef/browser/osr/web_contents_view_osr.h index 7d97d1e45..9ae974e0d 100644 --- a/libcef/browser/osr/web_contents_view_osr.h +++ b/libcef/browser/osr/web_contents_view_osr.h @@ -6,6 +6,7 @@ #ifndef CEF_LIBCEF_BROWSER_OSR_WEB_CONTENTS_VIEW_OSR_H_ #define CEF_LIBCEF_BROWSER_OSR_WEB_CONTENTS_VIEW_OSR_H_ +#include "base/memory/raw_ptr.h" #include "content/browser/renderer_host/render_view_host_delegate_view.h" #include "content/browser/web_contents/web_contents_view.h" #include "third_party/skia/include/core/SkColor.h" @@ -97,7 +98,7 @@ class CefWebContentsViewOSR : public content::WebContentsView, const bool use_shared_texture_; const bool use_external_begin_frame_; - content::WebContents* web_contents_ = nullptr; + raw_ptr web_contents_ = nullptr; }; #endif // CEF_LIBCEF_BROWSER_OSR_WEB_CONTENTS_VIEW_OSR_H_ diff --git a/libcef/browser/prefs/pref_registrar.cc b/libcef/browser/prefs/pref_registrar.cc index 680bdf8b1..304c736f3 100644 --- a/libcef/browser/prefs/pref_registrar.cc +++ b/libcef/browser/prefs/pref_registrar.cc @@ -4,6 +4,7 @@ #include "cef/libcef/browser/prefs/pref_registrar.h" +#include "base/memory/raw_ptr.h" #include "cef/include/cef_app.h" #include "cef/include/cef_browser_process_handler.h" #include "cef/include/cef_preference.h" @@ -77,7 +78,7 @@ class CefPreferenceRegistrarImpl : public CefPreferenceRegistrar { } } - PrefRegistrySimple* const registry_; + const raw_ptr registry_; }; } // namespace diff --git a/libcef/browser/printing/print_dialog_linux.h b/libcef/browser/printing/print_dialog_linux.h index 62206a353..fc0683176 100644 --- a/libcef/browser/printing/print_dialog_linux.h +++ b/libcef/browser/printing/print_dialog_linux.h @@ -7,6 +7,7 @@ #define LIBCEF_BROWSER_PRINTING_PRINT_DIALOG_LINUX_H_ #include "base/files/file_path.h" +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/task/sequenced_task_runner_helpers.h" #include "cef/include/cef_print_handler.h" @@ -40,7 +41,7 @@ class CefPrintingContextLinuxDelegate void SetDefaultDelegate(ui::PrintingContextLinuxDelegate* delegate); private: - ui::PrintingContextLinuxDelegate* default_delegate_ = nullptr; + raw_ptr default_delegate_ = nullptr; }; // Needs to be freed on the UI thread to clean up its member variables. @@ -99,7 +100,7 @@ class CefPrintDialogLinux : public printing::PrintDialogLinuxInterface, // Printing dialog callback. PrintingContextLinux::PrintSettingsCallback callback_; - PrintingContextLinux* context_; + raw_ptr context_; CefRefPtr browser_; CefRefPtr handler_; diff --git a/libcef/browser/request_context_impl.h b/libcef/browser/request_context_impl.h index d72aec22b..e65e9be8b 100644 --- a/libcef/browser/request_context_impl.h +++ b/libcef/browser/request_context_impl.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_REQUEST_CONTEXT_IMPL_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "cef/include/cef_request_context.h" #include "cef/libcef/browser/browser_context.h" #include "cef/libcef/browser/media_router/media_router_impl.h" @@ -158,7 +159,7 @@ class CefRequestContextImpl : public CefRequestContext { // Wrap an existing (non-global) browser context. When specifying this value // GetOrCreateRequestContext() must be called on the UI thread. - CefBrowserContext* browser_context = nullptr; + raw_ptr browser_context = nullptr; // |settings| or |other| will be set when creating a new CefRequestContext // via the API. @@ -220,7 +221,7 @@ class CefRequestContextImpl : public CefRequestContext { CefBrowserContext* browser_context() const; // We must disassociate from this on destruction. - CefBrowserContext* browser_context_ = nullptr; + raw_ptr browser_context_ = nullptr; Config config_; diff --git a/libcef/browser/simple_menu_model_impl.h b/libcef/browser/simple_menu_model_impl.h index 96059f1bc..9a33dbe2f 100644 --- a/libcef/browser/simple_menu_model_impl.h +++ b/libcef/browser/simple_menu_model_impl.h @@ -10,6 +10,7 @@ #include #include +#include "base/memory/raw_ptr.h" #include "base/threading/platform_thread.h" #include "cef/include/cef_menu_model.h" #include "ui/base/models/simple_menu_model.h" @@ -154,9 +155,9 @@ class CefSimpleMenuModelImpl : public CefMenuModel { base::PlatformThreadId supported_thread_id_; - ui::SimpleMenuModel* model_; - ui::SimpleMenuModel::Delegate* const delegate_; - StateDelegate* const state_delegate_; + raw_ptr model_; + const raw_ptr delegate_; + const raw_ptr state_delegate_; const bool is_owned_; const bool is_submenu_; diff --git a/libcef/browser/stream_impl.cc b/libcef/browser/stream_impl.cc index c8d1b0673..3e0bd6a96 100644 --- a/libcef/browser/stream_impl.cc +++ b/libcef/browser/stream_impl.cc @@ -159,7 +159,7 @@ size_t CefBytesReader::Read(void* ptr, size_t size, size_t n) { base::AutoLock lock_scope(lock_); size_t s = (datasize_ - offset_) / size; size_t ret = (n < s ? n : s); - memcpy(ptr, (reinterpret_cast(data_)) + offset_, ret * size); + memcpy(ptr, (reinterpret_cast(data_.get())) + offset_, ret * size); offset_ += ret * size; return ret; } @@ -249,7 +249,7 @@ size_t CefBytesWriter::Write(const void* ptr, size_t size, size_t n) { Grow(size * n) == 0) { rv = 0; } else { - memcpy(reinterpret_cast(data_) + offset_, ptr, size * n); + memcpy(reinterpret_cast(data_.get()) + offset_, ptr, size * n); offset_ += size * n; rv = n; } @@ -300,7 +300,7 @@ int CefBytesWriter::Flush() { std::string CefBytesWriter::GetDataString() { base::AutoLock lock_scope(lock_); - std::string str(reinterpret_cast(data_), offset_); + std::string str(reinterpret_cast(data_.get()), offset_); return str; } diff --git a/libcef/browser/stream_impl.h b/libcef/browser/stream_impl.h index 4f3ce97e5..96b6e09bf 100644 --- a/libcef/browser/stream_impl.h +++ b/libcef/browser/stream_impl.h @@ -10,6 +10,7 @@ #include +#include "base/memory/raw_ptr.h" #include "base/synchronization/lock.h" #include "cef/include/cef_stream.h" @@ -27,7 +28,7 @@ class CefFileReader : public CefStreamReader { protected: bool close_; - FILE* file_; + raw_ptr file_; base::Lock lock_; @@ -47,7 +48,7 @@ class CefFileWriter : public CefStreamWriter { bool MayBlock() override { return true; } protected: - FILE* file_; + raw_ptr file_; bool close_; base::Lock lock_; @@ -73,7 +74,7 @@ class CefBytesReader : public CefStreamReader { size_t GetDataSize() { return offset_; } protected: - void* data_ = nullptr; + raw_ptr data_ = nullptr; int64_t datasize_ = 0; bool copy_ = false; int64_t offset_ = 0; @@ -103,7 +104,7 @@ class CefBytesWriter : public CefStreamWriter { size_t Grow(size_t size); size_t grow_; - void* data_; + raw_ptr data_; int64_t datasize_; int64_t offset_ = 0; diff --git a/libcef/browser/views/browser_platform_delegate_views.cc b/libcef/browser/views/browser_platform_delegate_views.cc index c6b2bc89a..7c7d8c5b9 100644 --- a/libcef/browser/views/browser_platform_delegate_views.cc +++ b/libcef/browser/views/browser_platform_delegate_views.cc @@ -57,7 +57,7 @@ void CefBrowserPlatformDelegateViews::NotifyBrowserCreated() { DCHECK(browser_view_); DCHECK(browser_); if (browser_view_->delegate()) { - browser_view_->delegate()->OnBrowserCreated(browser_view_, browser_); + browser_view_->delegate()->OnBrowserCreated(browser_view_, browser_.get()); } } @@ -65,7 +65,8 @@ void CefBrowserPlatformDelegateViews::NotifyBrowserDestroyed() { DCHECK(browser_view_); DCHECK(browser_); if (browser_view_->delegate()) { - browser_view_->delegate()->OnBrowserDestroyed(browser_view_, browser_); + browser_view_->delegate()->OnBrowserDestroyed(browser_view_, + browser_.get()); } } diff --git a/libcef/browser/views/browser_view_impl.h b/libcef/browser/views/browser_view_impl.h index 7bdcecc05..6fff1c24a 100644 --- a/libcef/browser/views/browser_view_impl.h +++ b/libcef/browser/views/browser_view_impl.h @@ -7,6 +7,7 @@ #pragma once #include "base/functional/callback_forward.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "cef/include/cef_client.h" #include "cef/include/views/cef_browser_view.h" @@ -138,8 +139,8 @@ class CefBrowserViewImpl base::RepeatingClosure on_bounds_changed_; - CefWidget* cef_widget_ = nullptr; - Profile* profile_ = nullptr; + raw_ptr cef_widget_ = nullptr; + raw_ptr profile_ = nullptr; base::WeakPtrFactory weak_ptr_factory_; diff --git a/libcef/browser/views/browser_view_view.h b/libcef/browser/views/browser_view_view.h index abc1d5c0e..9418268f0 100644 --- a/libcef/browser/views/browser_view_view.h +++ b/libcef/browser/views/browser_view_view.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_VIEWS_BROWSER_VIEW_VIEW_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "cef/include/views/cef_browser_view_delegate.h" #include "cef/libcef/browser/views/view_view.h" #include "ui/views/controls/webview/webview.h" @@ -63,7 +64,7 @@ class CefBrowserViewView private: // Not owned by this object. - Delegate* browser_view_delegate_; + raw_ptr browser_view_delegate_; }; #endif // CEF_LIBCEF_BROWSER_VIEWS_BROWSER_VIEW_VIEW_H_ diff --git a/libcef/browser/views/color_provider_tracker.h b/libcef/browser/views/color_provider_tracker.h index 692656987..03f144143 100644 --- a/libcef/browser/views/color_provider_tracker.h +++ b/libcef/browser/views/color_provider_tracker.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_VIEWS_COLOR_PROVIDER_TRACKER_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "base/scoped_observation.h" #include "ui/color/color_provider_manager.h" @@ -52,7 +53,7 @@ class CefColorProviderTracker : public ui::ColorProviderManagerObserver { void OnColorProviderCacheReset() override; void OnAfterNativeThemeUpdated() override; - Observer* const observer_; + const raw_ptr observer_; bool got_theme_updated_ = false; base::ScopedObservationSetLayoutManager(base::WrapUnique(layout_ref_)); + owner_view->SetLayoutManager(base::WrapUnique(layout_ref_.get())); layout_util::Assign(this, owner_view); } @@ -65,11 +66,11 @@ class CefLayoutImpl : public CefLayoutAdapter, public CefLayoutClass { private: // Unowned reference to the views::LayoutManager wrapped by this object. Will // be nullptr after the views::LayoutManager is destroyed. - ViewsLayoutClass* layout_ref_ = nullptr; + raw_ptr layout_ref_ = nullptr; // Unowned reference to the views::View that owns this object. Will be nullptr // after the views::LayoutManager is destroyed. - views::View* owner_view_ = nullptr; + raw_ptr owner_view_ = nullptr; }; #endif // CEF_LIBCEF_BROWSER_VIEWS_LAYOUT_IMPL_H_ diff --git a/libcef/browser/views/menu_runner_views.h b/libcef/browser/views/menu_runner_views.h index 7ff537062..b2b1e7e82 100644 --- a/libcef/browser/views/menu_runner_views.h +++ b/libcef/browser/views/menu_runner_views.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_VIEWS_MENU_RUNNER_VIEWS_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/menu_runner.h" class CefBrowserViewImpl; @@ -23,7 +24,7 @@ class CefMenuRunnerViews : public CefMenuRunner { bool FormatLabel(std::u16string& label) override; private: - CefBrowserViewImpl* browser_view_; + raw_ptr browser_view_; }; #endif // CEF_LIBCEF_BROWSER_VIEWS_MENU_RUNNER_VIEWS_H_ diff --git a/libcef/browser/views/native_widget_mac.h b/libcef/browser/views/native_widget_mac.h index aa3cd0800..b244a038c 100644 --- a/libcef/browser/views/native_widget_mac.h +++ b/libcef/browser/views/native_widget_mac.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_VIEWS_NATIVE_WIDGET_MAC_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "cef/include/internal/cef_ptr.h" #include "ui/views/widget/native_widget_mac.h" @@ -45,12 +46,12 @@ class CefNativeWidgetMac : public views::NativeWidgetMac { private: const CefRefPtr window_; - CefWindowDelegate* const window_delegate_; + const raw_ptr window_delegate_; // Returns true if the CefWindow is fully initialized. bool IsCefWindowInitialized() const; - BrowserView* browser_view_ = nullptr; + raw_ptr browser_view_ = nullptr; }; #endif // CEF_LIBCEF_BROWSER_VIEWS_NATIVE_WIDGET_MAC_H_ diff --git a/libcef/browser/views/overlay_view_host.cc b/libcef/browser/views/overlay_view_host.cc index ca5288b91..6a11ac0f3 100644 --- a/libcef/browser/views/overlay_view_host.cc +++ b/libcef/browser/views/overlay_view_host.cc @@ -5,6 +5,7 @@ #include "cef/libcef/browser/views/overlay_view_host.h" #include "base/i18n/rtl.h" +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/views/view_util.h" #include "cef/libcef/browser/views/window_view.h" #include "chrome/browser/ui/views/frame/browser_view.h" @@ -161,7 +162,7 @@ class CefOverlayControllerImpl : public CefOverlayController { bool IsDrawn() override { return IsVisible(); } private: - CefOverlayViewHost* host_; + raw_ptr host_; CefRefPtr view_; IMPLEMENT_REFCOUNTING(CefOverlayControllerImpl); diff --git a/libcef/browser/views/overlay_view_host.h b/libcef/browser/views/overlay_view_host.h index dd4674b45..f59989006 100644 --- a/libcef/browser/views/overlay_view_host.h +++ b/libcef/browser/views/overlay_view_host.h @@ -8,6 +8,7 @@ #include +#include "base/memory/raw_ptr.h" #include "cef/include/views/cef_overlay_controller.h" #include "cef/include/views/cef_view.h" #include "ui/views/view_observer.h" @@ -58,15 +59,15 @@ class CefOverlayViewHost : public views::WidgetDelegate, void Cleanup(); // The CefWindowView that created us. - CefWindowView* window_view_; + raw_ptr window_view_; const cef_docking_mode_t docking_mode_; // The host view that the overlay is positioned relative to. - views::View* host_view_ = nullptr; + raw_ptr host_view_ = nullptr; // Our view, which is responsible for drawing the UI. - views::View* view_ = nullptr; + raw_ptr view_ = nullptr; // The Widget implementation that is created and maintained by the overlay. // It contains |view_|. diff --git a/libcef/browser/views/view_impl.h b/libcef/browser/views/view_impl.h index e38907e68..5deb1d741 100644 --- a/libcef/browser/views/view_impl.h +++ b/libcef/browser/views/view_impl.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_VIEWS_VIEW_IMPL_H_ #pragma once +#include "base/memory/raw_ptr.h" // CEF exposes views framework functionality via a hierarchy of CefView and // related objects. While the goal is to accurately represent views framework // capabilities there is not always a direct 1:1 mapping between the CEF @@ -443,7 +444,7 @@ CEF_VIEW_IMPL_T class CefViewImpl : public CefViewAdapter, public CefViewClass { // Unowned reference to the views::View wrapped by this object. Will be // nullptr before the View is created and after the View is destroyed. - ViewsViewClass* root_view_ref_; + raw_ptr root_view_ref_; }; CEF_VIEW_IMPL_T CefString CEF_VIEW_IMPL_D::GetTypeString() { diff --git a/libcef/browser/views/view_util.cc b/libcef/browser/views/view_util.cc index 3ca11c44c..bf2e7a4f3 100644 --- a/libcef/browser/views/view_util.cc +++ b/libcef/browser/views/view_util.cc @@ -6,6 +6,7 @@ #include +#include "base/memory/raw_ptr.h" #include "cef/include/cef_color_ids.h" #include "cef/libcef/browser/views/view_adapter.h" #include "cef/libcef/browser/views/widget.h" @@ -54,7 +55,7 @@ class UserData : public base::SupportsUserData::Data { DCHECK(view); UserData* data = static_cast(view->GetUserData(UserDataKey())); if (data) { - return data->view_ref_; + return data->view_ref_.get(); } return nullptr; } @@ -111,7 +112,7 @@ class UserData : public base::SupportsUserData::Data { } } - void TakeReference() { view_ = view_ref_; } + void TakeReference() { view_ = view_ref_.get(); } void ReleaseReference() { view_ = nullptr; } @@ -123,7 +124,7 @@ class UserData : public base::SupportsUserData::Data { } CefRefPtr view_; - CefView* view_ref_; + raw_ptr view_ref_; }; // Based on Widget::GetNativeTheme. diff --git a/libcef/browser/views/view_view.h b/libcef/browser/views/view_view.h index f66fa42dc..0936ab7be 100644 --- a/libcef/browser/views/view_view.h +++ b/libcef/browser/views/view_view.h @@ -7,6 +7,7 @@ #pragma once #include "base/logging.h" +#include "base/memory/raw_ptr.h" #include "cef/include/views/cef_view.h" #include "cef/include/views/cef_view_delegate.h" #include "cef/libcef/browser/thread_util.h" @@ -87,7 +88,7 @@ CEF_VIEW_VIEW_T class CefViewView : public ViewsViewClass { const views::ViewHierarchyChangedDetails& details); // Not owned by this object. - CefViewDelegateClass* const cef_delegate_; + const raw_ptr cef_delegate_; }; CEF_VIEW_VIEW_T gfx::Size CEF_VIEW_VIEW_D::CalculatePreferredSize() const { diff --git a/libcef/browser/views/widget_destruction_observer.h b/libcef/browser/views/widget_destruction_observer.h index c9c41eda8..c1f1ce14e 100644 --- a/libcef/browser/views/widget_destruction_observer.h +++ b/libcef/browser/views/widget_destruction_observer.h @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file. +#include "base/memory/raw_ptr.h" #include "base/scoped_observation.h" #include "ui/views/widget/widget_observer.h" @@ -27,7 +28,7 @@ class WidgetDestructionObserver : public views::WidgetObserver { views::Widget* widget() const { return widget_; } private: - views::Widget* widget_; + raw_ptr widget_; base::ScopedObservation observation_{ this}; diff --git a/libcef/browser/views/widget_impl.h b/libcef/browser/views/widget_impl.h index 180d0258b..3a633d1b3 100644 --- a/libcef/browser/views/widget_impl.h +++ b/libcef/browser/views/widget_impl.h @@ -8,6 +8,7 @@ #include +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "cef/libcef/browser/views/color_provider_tracker.h" #include "cef/libcef/browser/views/widget.h" @@ -83,7 +84,7 @@ class CefWidgetImpl : public views::Widget, // CefColorProviderTracker::Observer methods: void OnColorProviderCacheResetMissed() override; - CefWindowView* window_view_; + raw_ptr window_view_; bool initialized_ = false; diff --git a/libcef/browser/views/window_impl.cc b/libcef/browser/views/window_impl.cc index a6529eb1b..523a9abc1 100644 --- a/libcef/browser/views/window_impl.cc +++ b/libcef/browser/views/window_impl.cc @@ -7,6 +7,7 @@ #include #include "base/i18n/rtl.h" +#include "base/memory/raw_ptr.h" #include "cef/libcef/browser/browser_util.h" #include "cef/libcef/browser/thread_util.h" #include "cef/libcef/browser/views/browser_view_impl.h" @@ -93,11 +94,11 @@ class CefUnhandledKeyEventHandler : public ui::EventHandler { private: // Members are guaranteed to outlive this object. - CefWindowImpl* window_impl_; - views::Widget* widget_; + raw_ptr window_impl_; + raw_ptr widget_; // |window_| is the event target that is associated with this class. - aura::Window* window_; + raw_ptr window_; }; #endif // defined(USE_AURA) diff --git a/libcef/browser/views/window_impl.h b/libcef/browser/views/window_impl.h index 5558770ff..9944cb381 100644 --- a/libcef/browser/views/window_impl.h +++ b/libcef/browser/views/window_impl.h @@ -8,6 +8,7 @@ #include +#include "base/memory/raw_ptr.h" #include "cef/include/views/cef_window.h" #include "cef/include/views/cef_window_delegate.h" #include "cef/libcef/browser/menu_model_impl.h" @@ -152,7 +153,7 @@ class CefWindowImpl // Initialize the Widget. void CreateWidget(gfx::AcceleratedWidget parent_widget); - views::Widget* widget_ = nullptr; + raw_ptr widget_ = nullptr; // True if the window has been initialized. bool initialized_ = false; diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc index 6767c1d00..3c26439d2 100644 --- a/libcef/browser/views/window_view.cc +++ b/libcef/browser/views/window_view.cc @@ -6,6 +6,8 @@ #include +#include "base/memory/raw_ptr.h" + #if BUILDFLAG(IS_LINUX) #include "ui/base/ozone_buildflags.h" #if BUILDFLAG(IS_OZONE_X11) @@ -68,7 +70,8 @@ class ClientViewEx : public views::ClientView { } private: - CefWindowView::Delegate* window_delegate_; // Not owned by this object. + // Not owned by this object. + raw_ptr window_delegate_; }; // Extend NativeFrameView with draggable region handling. @@ -151,8 +154,8 @@ class NativeFrameViewEx : public views::NativeFrameView { private: // Not owned by this object. - views::Widget* widget_; - CefWindowView* view_; + raw_ptr widget_; + raw_ptr view_; }; // The area inside the frame border that can be clicked and dragged for resizing @@ -284,8 +287,8 @@ class CaptionlessFrameView : public views::NonClientFrameView { } // Not owned by this object. - views::Widget* widget_; - CefWindowView* view_; + raw_ptr widget_; + raw_ptr view_; // The bounds of the client view, in this view's coordinates. gfx::Rect client_view_bounds_; diff --git a/libcef/browser/views/window_view.h b/libcef/browser/views/window_view.h index a0337217e..fe1be369d 100644 --- a/libcef/browser/views/window_view.h +++ b/libcef/browser/views/window_view.h @@ -9,6 +9,7 @@ #include #include +#include "base/memory/raw_ptr.h" #include "cef/include/views/cef_window.h" #include "cef/include/views/cef_window_delegate.h" #include "cef/libcef/browser/views/overlay_view_host.h" @@ -150,7 +151,7 @@ class CefWindowView void UpdateBoundingBox(gfx::Rect* bounds, bool add_titlebar_height) const; // Not owned by this object. - Delegate* window_delegate_; + raw_ptr window_delegate_; // True if the window is Alloy style, otherwise Chrome style. const bool is_alloy_style_; diff --git a/libcef/common/alloy/alloy_main_delegate.h b/libcef/common/alloy/alloy_main_delegate.h index c9e9a1d6a..8f527fb46 100644 --- a/libcef/common/alloy/alloy_main_delegate.h +++ b/libcef/common/alloy/alloy_main_delegate.h @@ -8,6 +8,7 @@ #include +#include "base/memory/raw_ptr.h" #include "cef/include/cef_app.h" #include "cef/libcef/common/alloy/alloy_content_client.h" #include "cef/libcef/common/app_manager.h" @@ -84,8 +85,8 @@ class AlloyMainDelegate : public content::ContentMainDelegate, private: void InitializeResourceBundle(); - CefMainRunnerHandler* const runner_; - CefSettings* const settings_; + const raw_ptr runner_; + const raw_ptr settings_; CefRefPtr application_; std::unique_ptr browser_client_; diff --git a/libcef/common/alloy/alloy_main_runner_delegate.h b/libcef/common/alloy/alloy_main_runner_delegate.h index 9b11a8f01..e1a474c7b 100644 --- a/libcef/common/alloy/alloy_main_runner_delegate.h +++ b/libcef/common/alloy/alloy_main_runner_delegate.h @@ -8,6 +8,7 @@ #include +#include "base/memory/raw_ptr.h" #include "cef/include/cef_base.h" #include "cef/libcef/common/main_runner_delegate.h" #include "cef/libcef/common/main_runner_handler.h" @@ -41,8 +42,8 @@ class AlloyMainRunnerDelegate : public CefMainRunnerDelegate { private: std::unique_ptr main_delegate_; - CefMainRunnerHandler* const runner_; - CefSettings* const settings_; + const raw_ptr runner_; + const raw_ptr settings_; CefRefPtr application_; }; diff --git a/libcef/common/chrome/chrome_main_delegate_cef.h b/libcef/common/chrome/chrome_main_delegate_cef.h index 305732909..0a6da86c1 100644 --- a/libcef/common/chrome/chrome_main_delegate_cef.h +++ b/libcef/common/chrome/chrome_main_delegate_cef.h @@ -8,6 +8,7 @@ #include +#include "base/memory/raw_ptr.h" #include "cef/include/cef_app.h" #include "cef/libcef/common/app_manager.h" #include "cef/libcef/common/chrome/chrome_content_client_cef.h" @@ -81,8 +82,8 @@ class ChromeMainDelegateCef : public ChromeMainDelegate, ChromeContentBrowserClientCef* content_browser_client() const; ChromeContentRendererClientCef* content_renderer_client() const; - CefMainRunnerHandler* const runner_; - CefSettings* const settings_; + const raw_ptr runner_; + const raw_ptr settings_; CefRefPtr application_; // We use this instead of ChromeMainDelegate::chrome_content_client_. diff --git a/libcef/common/chrome/chrome_main_runner_delegate.h b/libcef/common/chrome/chrome_main_runner_delegate.h index 442d9d6c8..f7c084d4a 100644 --- a/libcef/common/chrome/chrome_main_runner_delegate.h +++ b/libcef/common/chrome/chrome_main_runner_delegate.h @@ -8,6 +8,7 @@ #include +#include "base/memory/raw_ptr.h" #include "cef/include/cef_app.h" #include "cef/libcef/common/main_runner_delegate.h" #include "cef/libcef/common/main_runner_handler.h" @@ -48,8 +49,8 @@ class ChromeMainRunnerDelegate : public CefMainRunnerDelegate { std::unique_ptr sampling_profiler_; std::unique_ptr keep_alive_; - CefMainRunnerHandler* const runner_; - CefSettings* const settings_; + const raw_ptr runner_; + const raw_ptr settings_; CefRefPtr application_; bool multi_threaded_message_loop_ = false; diff --git a/libcef/common/response_impl.cc b/libcef/common/response_impl.cc index 3a0f69f11..d51ca1b9f 100644 --- a/libcef/common/response_impl.cc +++ b/libcef/common/response_impl.cc @@ -7,6 +7,7 @@ #include #include "base/logging.h" +#include "base/memory/raw_ptr.h" #include "base/strings/string_util.h" #include "cef/libcef/common/net/http_header_utils.h" #include "cef/libcef/common/net_service/net_service_util.h" @@ -226,7 +227,7 @@ void CefResponseImpl::Set(const blink::WebURLResponse& response) { } private: - HeaderMap* map_; + raw_ptr map_; }; HeaderVisitor visitor(&header_map_); diff --git a/libcef/common/tracker.h b/libcef/common/tracker.h index 07ed09c47..d2c6cf030 100644 --- a/libcef/common/tracker.h +++ b/libcef/common/tracker.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_COMMON_TRACKER_H_ #pragma once +#include "base/memory/raw_ptr.h" #include "base/synchronization/lock.h" #include "cef/include/cef_base.h" @@ -35,8 +36,8 @@ class CefTrackNode { void RemoveTracking(); private: - CefTrackNode* track_next_ = nullptr; - CefTrackNode* track_prev_ = nullptr; + raw_ptr track_next_ = nullptr; + raw_ptr track_prev_ = nullptr; friend class CefTrackManager; }; diff --git a/libcef/common/value_base.h b/libcef/common/value_base.h index 9add874e7..ca2eb0e73 100644 --- a/libcef/common/value_base.h +++ b/libcef/common/value_base.h @@ -10,6 +10,7 @@ #include #include "base/logging.h" +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/notreached.h" #include "base/synchronization/lock.h" @@ -128,8 +129,8 @@ class CefValueController private: // Owner object. - void* owner_value_ = nullptr; - Object* owner_object_ = nullptr; + raw_ptr owner_value_ = nullptr; + raw_ptr owner_object_ = nullptr; // Map of reference objects. using ReferenceMap = std::map; @@ -322,7 +323,7 @@ class CefValueBase : public CefType, public CefValueController::Object { controller()->RemoveDependencies(value_); // Delete the value. - DeleteValue(value_); + DeleteValue(value_.get()); } controller_ = nullptr; @@ -438,7 +439,7 @@ class CefValueBase : public CefType, public CefValueController::Object { }; private: - ValueType* value_; + raw_ptr value_; ValueMode value_mode_; bool read_only_; scoped_refptr controller_;