mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Apply raw_ptr rewrite to libcef (see #3239)
This commit is contained in:
@ -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<CefSSLHostStateDelegate> ssl_host_state_delegate_;
|
||||
std::unique_ptr<visitedlink::VisitedLinkWriter> visitedlink_master_;
|
||||
// |visitedlink_listener_| is owned by visitedlink_master_.
|
||||
CefVisitedLinkListener* visitedlink_listener_ = nullptr;
|
||||
raw_ptr<CefVisitedLinkListener> visitedlink_listener_ = nullptr;
|
||||
|
||||
// Owned by the KeyedService system.
|
||||
extensions::CefExtensionSystem* extension_system_ = nullptr;
|
||||
raw_ptr<extensions::CefExtensionSystem> extension_system_ = nullptr;
|
||||
|
||||
// The key to index KeyedService instances created by
|
||||
// SimpleKeyedServiceFactory.
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <string_view>
|
||||
|
||||
#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<CefRequestContextImpl> global_request_context_;
|
||||
CefDevToolsDelegate* devtools_delegate_ = nullptr; // Deletes itself.
|
||||
raw_ptr<CefDevToolsDelegate> devtools_delegate_ = nullptr; // Deletes itself.
|
||||
|
||||
// Blocking task runners exposed via CefTaskRunner. For consistency with
|
||||
// previous named thread behavior always execute all pending tasks before
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#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<AlloyBrowserMainParts> browser_main_parts_ = nullptr;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_CONTENT_BROWSER_CLIENT_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<content::WebContents> web_contents_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_WEB_CONTENTS_VIEW_DELEGATE_H_
|
||||
|
@ -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.
|
||||
|
@ -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<extensions::ExtensionHost> extension_host_ = nullptr;
|
||||
bool is_background_host_ = false;
|
||||
#endif
|
||||
|
||||
|
@ -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<content::BrowserContext> browser_context_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
@ -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<CefDevToolsFrontend> devtools_frontend_ = nullptr;
|
||||
|
||||
base::WeakPtrFactory<AlloyDevToolsWindowRunner> weak_ptr_factory_{this};
|
||||
};
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <string>
|
||||
|
||||
#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<AlloyBrowserHostImpl> browser_impl_;
|
||||
raw_ptr<PrefService> prefs_;
|
||||
|
||||
using PathsMap = std::map<std::string, base::FilePath>;
|
||||
PathsMap saved_files_;
|
||||
|
@ -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<CefDevToolsFrontend> bindings_;
|
||||
std::unique_ptr<network::SimpleURLLoader> loader_;
|
||||
int request_id_;
|
||||
scoped_refptr<net::HttpResponseHeaders> response_headers_;
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <memory>
|
||||
|
||||
#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<AlloyBrowserHostImpl> frontend_browser_;
|
||||
content::WebContents* inspected_contents_;
|
||||
raw_ptr<content::WebContents> inspected_contents_;
|
||||
scoped_refptr<content::DevToolsAgentHost> agent_host_;
|
||||
CefPoint inspect_element_at_;
|
||||
base::OnceClosure frontend_destroyed_callback_;
|
||||
|
@ -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<CefBrowserPlatformDelegate> browser_delegate_;
|
||||
|
||||
// Used to notify WebContentsModalDialog.
|
||||
base::ObserverList<web_modal::ModalDialogHostObserver>::Unchecked
|
||||
|
@ -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<CefBrowser> const browser_;
|
||||
content::RenderWidgetHost* const render_widget_host_;
|
||||
blink::mojom::WidgetHost* const impl_;
|
||||
const raw_ptr<content::RenderWidgetHost> render_widget_host_;
|
||||
const raw_ptr<blink::mojom::WidgetHost> impl_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
@ -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<const extensions::Extension> 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<CefBrowserContentsDelegate> contents_delegate_;
|
||||
CefRefPtr<CefUnresponsiveProcessCallback> unresponsive_process_callback_;
|
||||
RenderViewContextMenuObserver* context_menu_observer_ = nullptr;
|
||||
raw_ptr<RenderViewContextMenuObserver> context_menu_observer_ = nullptr;
|
||||
|
||||
// Observers that want to be notified of changes to this object.
|
||||
// Only accessed on the UI thread.
|
||||
|
@ -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<CefBrowserInfo> {
|
||||
return frame_ && is_main_frame_ && !is_speculative_ && !is_in_bfcache_;
|
||||
}
|
||||
|
||||
content::RenderFrameHost* host_;
|
||||
raw_ptr<content::RenderFrameHost> host_;
|
||||
content::GlobalRenderFrameHostId global_id_;
|
||||
bool is_main_frame_;
|
||||
bool is_speculative_;
|
||||
@ -210,7 +211,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
|
||||
|
||||
protected:
|
||||
friend class CefBrowserInfo;
|
||||
CefBrowserInfo* const browser_info_;
|
||||
const raw_ptr<CefBrowserInfo> browser_info_;
|
||||
CefRefPtr<CefFrameHandler> frame_handler_;
|
||||
std::unique_ptr<base::AutoLock> browser_info_lock_scope_;
|
||||
std::queue<FrameNotifyOnceAction> queue_;
|
||||
@ -219,7 +220,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
|
||||
mutable base::Lock notification_lock_;
|
||||
|
||||
// These members must be protected by |notification_lock_|.
|
||||
NotificationStateLock* notification_state_lock_ = nullptr;
|
||||
raw_ptr<NotificationStateLock> notification_state_lock_ = nullptr;
|
||||
CefRefPtr<CefFrameHandler> frame_handler_;
|
||||
|
||||
mutable base::Lock lock_;
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#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<content::WebContents> new_contents = nullptr;
|
||||
};
|
||||
|
||||
// Manage pending popups. Only called on the UI thread.
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <vector>
|
||||
|
||||
#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<content::WebContents> web_contents_ = nullptr;
|
||||
raw_ptr<CefBrowserHostBase> browser_ = nullptr;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_BROWSER_PLATFORM_DELEGATE_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<CefBrowserPlatformDelegateNative> native_delegate_;
|
||||
|
||||
Browser* chrome_browser_ = nullptr;
|
||||
raw_ptr<Browser> chrome_browser_ = nullptr;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_CHROME_BROWSER_PLATFORM_DELEGATE_CHROME_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> profile_ = nullptr;
|
||||
bool should_destroy_ = false;
|
||||
|
||||
bool destroyed_ = false;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
#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> browser_;
|
||||
base::WeakPtr<ChromeBrowserHostImpl> opener_host_;
|
||||
|
||||
// Used when creating a new browser host.
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#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> browser_ = nullptr;
|
||||
CefWindowHandle host_window_handle_ = kNullWindowHandle;
|
||||
|
||||
base::WeakPtrFactory<ChromeBrowserHostImpl> weak_ptr_factory_{this};
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#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<content::WebContentsViewDelegate>
|
||||
CreateWebContentsViewDelegate(content::WebContents* web_contents);
|
||||
|
||||
ChromeBrowserMainExtraPartsCef* browser_main_parts_ = nullptr;
|
||||
raw_ptr<ChromeBrowserMainExtraPartsCef> browser_main_parts_ = nullptr;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_CONTENT_BROWSER_CLIENT_CEF_
|
||||
|
@ -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<RenderViewContextMenu> context_menu_;
|
||||
CefRefPtr<CefBrowserHostBase> browser_;
|
||||
CefRefPtr<CefContextMenuHandler> handler_;
|
||||
CefRefPtr<CefContextMenuParams> params_;
|
||||
|
@ -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<content::WebContents> web_contents_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_WEB_CONTENTS_VIEW_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<content::WebContents> owner_web_contents_;
|
||||
};
|
||||
|
||||
} // namespace extensions
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#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<CefWindowView> window_view_;
|
||||
raw_ptr<BrowserView> browser_view_ = nullptr;
|
||||
|
||||
bool initialized_ = false;
|
||||
bool native_theme_change_ = false;
|
||||
|
@ -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<ToolbarView::DisplayMode> display_mode;
|
||||
switch (toolbar_type) {
|
||||
case CEF_CTT_NORMAL:
|
||||
|
@ -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<CefBrowserViewImpl> cef_browser_view_;
|
||||
|
||||
views::WebView* web_view_ = nullptr;
|
||||
raw_ptr<views::WebView> web_view_ = nullptr;
|
||||
|
||||
bool destroyed_ = false;
|
||||
|
||||
|
@ -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> browser_;
|
||||
const raw_ptr<BrowserView> browser_view_;
|
||||
std::optional<ToolbarView::DisplayMode> const display_mode_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefToolbarViewImpl);
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <memory>
|
||||
|
||||
#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<content::WebContents> inspected_contents_;
|
||||
scoped_refptr<content::DevToolsAgentHost> agent_host_;
|
||||
int next_message_id_ = 1;
|
||||
|
||||
|
@ -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<CefDevToolsMessageObserver> observer_;
|
||||
|
||||
CefBrowserHostBase* browser_ = nullptr;
|
||||
raw_ptr<CefBrowserHostBase> browser_ = nullptr;
|
||||
base::WeakPtr<CefDevToolsController> controller_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDevToolsRegistrationImpl);
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#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<CefBrowserHostBase> inspected_browser_;
|
||||
|
||||
std::unique_ptr<CefDevToolsController> devtools_controller_;
|
||||
};
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <set>
|
||||
|
||||
#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<content::DownloadManager> manager_;
|
||||
base::WeakPtrFactory<content::DownloadManager> manager_ptr_factory_;
|
||||
const bool alloy_bootstrap_;
|
||||
|
||||
|
@ -57,7 +57,7 @@ CefRefPtr<CefRequestContext> CefExtensionImpl::GetLoaderContext() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return loader_context_;
|
||||
return loader_context_.get();
|
||||
}
|
||||
|
||||
bool CefExtensionImpl::IsLoaded() {
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#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<CefDictionaryValue> manifest_;
|
||||
|
||||
CefRequestContext* loader_context_;
|
||||
raw_ptr<CefRequestContext> loader_context_;
|
||||
CefRefPtr<CefExtensionHandler> handler_;
|
||||
|
||||
// Only accessed on the UI thread.
|
||||
|
@ -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<content::WebContents> web_contents_ = nullptr;
|
||||
};
|
||||
|
||||
// Implement API calls tabs.executeScript, tabs.insertCSS, and tabs.removeCSS.
|
||||
|
@ -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()
|
||||
|
@ -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<ExtensionFunction> function_;
|
||||
|
||||
mutable CefRefPtr<CefExtension> cef_extension_;
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
#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<content::BrowserContext> 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<ExtensionRegistry> registry_;
|
||||
|
||||
// The associated RendererStartupHelper. Guaranteed to outlive the
|
||||
// ExtensionSystem, and thus us.
|
||||
extensions::RendererStartupHelper* renderer_helper_;
|
||||
raw_ptr<extensions::RendererStartupHelper> renderer_helper_;
|
||||
|
||||
// Map of extension ID to CEF extension object.
|
||||
ExtensionMap extension_map_;
|
||||
|
@ -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<content::WebContents> owner_web_contents_;
|
||||
};
|
||||
|
||||
} // namespace extensions
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <memory>
|
||||
|
||||
#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<ValueStore> CreateStore();
|
||||
|
||||
base::FilePath db_path_;
|
||||
ValueStore* last_created_store_ = nullptr;
|
||||
raw_ptr<ValueStore> 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
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#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<ui::SelectFileDialog::Listener> listener_;
|
||||
const raw_ptr<void> params_;
|
||||
base::OnceClosure callback_;
|
||||
|
||||
// Used to avoid re-entrancy from Cancel().
|
||||
@ -488,8 +489,9 @@ CefFileDialogManager::MaybeRunDelegate(
|
||||
CefRefPtr<CefFileDialogCallbackImpl> callbackImpl(
|
||||
new CefFileDialogCallbackImpl(std::move(callback)));
|
||||
const bool handled = handler->OnFileDialog(
|
||||
browser_, static_cast<cef_file_dialog_mode_t>(mode), params.title,
|
||||
params.default_file_name.value(), accept_filters, callbackImpl.get());
|
||||
browser_.get(), static_cast<cef_file_dialog_mode_t>(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();
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
#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<CefBrowserHostBase> browser_;
|
||||
|
||||
// Used when running a platform dialog via RunSelectFile.
|
||||
scoped_refptr<ui::SelectFileDialog> dialog_;
|
||||
CefSelectFileDialogListener* dialog_listener_ = nullptr;
|
||||
raw_ptr<CefSelectFileDialogListener> dialog_listener_ = nullptr;
|
||||
|
||||
// List of all currently active listeners.
|
||||
std::set<ui::SelectFileDialog::Listener*> active_listeners_;
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <queue>
|
||||
#include <string>
|
||||
|
||||
#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<content::GlobalRenderFrameHostToken> parent_frame_token_;
|
||||
|
||||
// The following members are only accessed on the UI thread.
|
||||
content::RenderFrameHost* render_frame_host_ = nullptr;
|
||||
raw_ptr<content::RenderFrameHost> render_frame_host_ = nullptr;
|
||||
|
||||
std::queue<std::pair<std::string, RenderFrameAction>>
|
||||
queued_renderer_actions_;
|
||||
|
@ -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<RenderFrameHost> render_frame_host_ = nullptr;
|
||||
const url::Origin origin_;
|
||||
mojo::Receiver<Interface> receiver_;
|
||||
};
|
||||
|
@ -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<content::RenderWidgetHost> render_widget_host_;
|
||||
base::RepeatingClosure hang_monitor_restarter_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefUnresponsiveProcessCallbackImpl);
|
||||
|
@ -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<cef_jsdialog_type_t>(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);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#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<CefBrowserHostBase> browser_;
|
||||
|
||||
CefRefPtr<CefJSDialogHandler> handler_;
|
||||
|
||||
|
@ -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<CefMainRunner> runner_;
|
||||
base::OnceClosure setup_callback_;
|
||||
base::OnceClosure shutdown_callback_;
|
||||
|
||||
|
@ -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<CefMediaRouterManager> manager_;
|
||||
};
|
||||
|
||||
// Used to receive messages if PresentationConnection is not supported.
|
||||
@ -61,7 +62,7 @@ class CefPresentationConnectionMessageObserver
|
||||
}
|
||||
|
||||
private:
|
||||
CefMediaRouterManager* const manager_;
|
||||
const raw_ptr<CefMediaRouterManager> manager_;
|
||||
const media_router::MediaRoute route_;
|
||||
};
|
||||
|
||||
@ -118,7 +119,7 @@ class CefPresentationConnection : public blink::mojom::PresentationConnection {
|
||||
}
|
||||
|
||||
private:
|
||||
CefMediaRouterManager* const manager_;
|
||||
const raw_ptr<CefMediaRouterManager> manager_;
|
||||
const media_router::MediaRoute route_;
|
||||
|
||||
// Used to receive messages from the MRP.
|
||||
|
@ -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<content::BrowserContext> browser_context_;
|
||||
|
||||
base::ObserverList<Observer> observers_;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#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<CefBrowserHostBase> browser_;
|
||||
|
||||
struct MediaStreamInfo {
|
||||
bool video;
|
||||
|
@ -151,7 +151,7 @@ bool CefMenuManager::CreateContextMenu(
|
||||
new CefContextMenuParamsImpl(¶ms_));
|
||||
CefRefPtr<CefFrame> 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<CefMenuModelImpl> 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<CefMenuModelImpl> source) {
|
||||
if (client.get()) {
|
||||
CefRefPtr<CefContextMenuHandler> handler = client->GetContextMenuHandler();
|
||||
if (handler.get()) {
|
||||
handler->OnContextMenuDismissed(browser_, browser_->GetFocusedFrame());
|
||||
handler->OnContextMenuDismissed(browser_.get(),
|
||||
browser_->GetFocusedFrame());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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<AlloyBrowserHostImpl> browser_;
|
||||
|
||||
std::unique_ptr<CefMenuRunner> 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<CefRunContextMenuCallback> custom_menu_callback_ = nullptr;
|
||||
|
||||
// Must be the last member.
|
||||
base::WeakPtrFactory<CefMenuManager> weak_ptr_factory_;
|
||||
|
@ -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<CefMenuModelImpl> impl_;
|
||||
};
|
||||
|
||||
cef_menu_color_type_t GetMenuColorType(bool is_text,
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#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> delegate_;
|
||||
|
||||
// Used when created via CefMenuModel::CreateMenuModel().
|
||||
CefRefPtr<CefMenuModelDelegate> menu_model_delegate_;
|
||||
|
@ -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<WindowlessHandler> windowless_handler_ = nullptr;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_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<views::Widget> window_widget_ = nullptr;
|
||||
|
||||
private:
|
||||
// Will only be called if the Widget is deleted before
|
||||
|
@ -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 =
|
||||
|
@ -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<CefWindowX11> window_x11_ = nullptr;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -74,7 +74,7 @@ void CefWindowDelegateView::Init(gfx::AcceleratedWidget parent_widget,
|
||||
void CefWindowDelegateView::InitContent() {
|
||||
SetBackground(views::CreateSolidBackground(background_color_));
|
||||
SetLayoutManager(std::make_unique<views::FillLayout>());
|
||||
AddChildView(web_view_);
|
||||
AddChildView(web_view_.get());
|
||||
}
|
||||
|
||||
void CefWindowDelegateView::DeleteDelegate() {
|
||||
|
@ -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<views::WebView> web_view_ = nullptr;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_NATIVE_WINDOW_DELEGATE_VIEW_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<CefBrowserHostBase> browser_;
|
||||
|
||||
// The display and the native X window hosting the root window.
|
||||
x11::Connection* const connection_;
|
||||
const raw_ptr<x11::Connection> connection_;
|
||||
x11::Window parent_xwindow_;
|
||||
x11::Window xwindow_;
|
||||
|
||||
|
@ -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> profile_;
|
||||
|
||||
std::string mime_type_;
|
||||
scoped_refptr<base::RefCountedString> output_;
|
||||
|
@ -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<ProxyURLLoaderFactory> 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<network::mojom::TrustedHeaderClient> header_client_receiver_{
|
||||
this};
|
||||
|
||||
StreamReaderURLLoader* stream_loader_ = nullptr;
|
||||
raw_ptr<StreamReaderURLLoader> stream_loader_ = nullptr;
|
||||
|
||||
base::WeakPtrFactory<InterceptedRequest> weak_factory_;
|
||||
};
|
||||
|
@ -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<HandlerProvider> handler_provider_;
|
||||
net::IOBuffer* const dest_;
|
||||
const raw_ptr<net::IOBuffer> dest_;
|
||||
int length_;
|
||||
CefRefPtr<ReadCallbackWrapper> callback_;
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#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<network::ResourceRequest> 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<InterceptedRequestHandlerWrapper> wrapper_;
|
||||
};
|
||||
|
||||
InterceptedRequestHandlerWrapper()
|
||||
|
@ -176,7 +176,7 @@ gfx::Point CefBrowserPlatformDelegateOsr::GetScreenPoint(
|
||||
CefRefPtr<CefRenderHandler> 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<CefRenderHandler::DragOperationsMask>(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<CefRenderHandler::DragOperation>(operation));
|
||||
browser_.get(),
|
||||
static_cast<CefRenderHandler::DragOperation>(operation));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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<CefWebContentsViewOSR> view_osr_ = nullptr;
|
||||
|
||||
// Pending drag/drop data.
|
||||
CefRefPtr<CefDragData> 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<void> 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.
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#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<CefRenderWidgetHostViewOSR> view_;
|
||||
mojo::Receiver<viz::mojom::LayeredWindowUpdater> receiver_;
|
||||
bool active_ = false;
|
||||
base::WritableSharedMemoryMapping shared_memory_;
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <memory>
|
||||
|
||||
#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<CefRenderWidgetHostViewOSR> view_;
|
||||
std::unique_ptr<CefLayeredWindowUpdaterOSR> layered_window_updater_;
|
||||
bool active_ = false;
|
||||
};
|
||||
|
@ -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<CefRenderWidgetHostViewOSR> 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() {
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#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<CefHostDisplayClientOSR> host_display_client_ = nullptr;
|
||||
std::unique_ptr<CefVideoConsumerOSR> 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<content::RenderWidgetHostImpl> render_widget_host_;
|
||||
|
||||
bool has_parent_;
|
||||
CefRenderWidgetHostViewOSR* parent_host_view_;
|
||||
CefRenderWidgetHostViewOSR* popup_host_view_ = nullptr;
|
||||
CefRenderWidgetHostViewOSR* child_host_view_ = nullptr;
|
||||
raw_ptr<CefRenderWidgetHostViewOSR> parent_host_view_;
|
||||
raw_ptr<CefRenderWidgetHostViewOSR> popup_host_view_ = nullptr;
|
||||
raw_ptr<CefRenderWidgetHostViewOSR> child_host_view_ = nullptr;
|
||||
std::set<CefRenderWidgetHostViewOSR*> guest_host_views_;
|
||||
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser_impl_;
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <optional>
|
||||
|
||||
#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<CefRenderWidgetHostViewOSR> view_;
|
||||
std::unique_ptr<viz::ClientFrameSinkVideoCapturer> video_capturer_;
|
||||
|
||||
gfx::Size size_in_pixels_;
|
||||
|
@ -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<content::WebContents> web_contents_ = nullptr;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_OSR_WEB_CONTENTS_VIEW_OSR_H_
|
||||
|
@ -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<PrefRegistrySimple> registry_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
@ -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<ui::PrintingContextLinuxDelegate> 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<PrintingContextLinux> context_;
|
||||
CefRefPtr<CefBrowserHostBase> browser_;
|
||||
CefRefPtr<CefPrintHandler> handler_;
|
||||
|
||||
|
@ -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<CefBrowserContext> 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<CefBrowserContext> browser_context_ = nullptr;
|
||||
|
||||
Config config_;
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#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<ui::SimpleMenuModel> model_;
|
||||
const raw_ptr<ui::SimpleMenuModel::Delegate> delegate_;
|
||||
const raw_ptr<StateDelegate> state_delegate_;
|
||||
const bool is_owned_;
|
||||
const bool is_submenu_;
|
||||
|
||||
|
@ -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<char*>(data_)) + offset_, ret * size);
|
||||
memcpy(ptr, (reinterpret_cast<char*>(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<char*>(data_) + offset_, ptr, size * n);
|
||||
memcpy(reinterpret_cast<char*>(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<char*>(data_), offset_);
|
||||
std::string str(reinterpret_cast<char*>(data_.get()), offset_);
|
||||
return str;
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#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> file_;
|
||||
|
||||
base::Lock lock_;
|
||||
|
||||
@ -47,7 +48,7 @@ class CefFileWriter : public CefStreamWriter {
|
||||
bool MayBlock() override { return true; }
|
||||
|
||||
protected:
|
||||
FILE* file_;
|
||||
raw_ptr<FILE> 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<void> 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<void> data_;
|
||||
int64_t datasize_;
|
||||
int64_t offset_ = 0;
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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<CefWidget> cef_widget_ = nullptr;
|
||||
raw_ptr<Profile> profile_ = nullptr;
|
||||
|
||||
base::WeakPtrFactory<CefBrowserViewImpl> weak_ptr_factory_;
|
||||
|
||||
|
@ -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<Delegate> browser_view_delegate_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_VIEWS_BROWSER_VIEW_VIEW_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> observer_;
|
||||
|
||||
bool got_theme_updated_ = false;
|
||||
base::ScopedObservation<ui::ColorProviderManager,
|
||||
|
@ -7,6 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "cef/include/views/cef_box_layout.h"
|
||||
#include "cef/include/views/cef_fill_layout.h"
|
||||
#include "cef/include/views/cef_layout.h"
|
||||
@ -55,7 +56,7 @@ class CefLayoutImpl : public CefLayoutAdapter, public CefLayoutClass {
|
||||
owner_view_ = owner_view;
|
||||
layout_ref_ = CreateLayout();
|
||||
DCHECK(layout_ref_);
|
||||
owner_view->SetLayoutManager(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<ViewsLayoutClass> 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<views::View> owner_view_ = nullptr;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_VIEWS_LAYOUT_IMPL_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<CefBrowserViewImpl> browser_view_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_VIEWS_MENU_RUNNER_VIEWS_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<CefWindow> window_;
|
||||
CefWindowDelegate* const window_delegate_;
|
||||
const raw_ptr<CefWindowDelegate> window_delegate_;
|
||||
|
||||
// Returns true if the CefWindow is fully initialized.
|
||||
bool IsCefWindowInitialized() const;
|
||||
|
||||
BrowserView* browser_view_ = nullptr;
|
||||
raw_ptr<BrowserView> browser_view_ = nullptr;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_VIEWS_NATIVE_WIDGET_MAC_H_
|
||||
|
@ -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<CefOverlayViewHost> host_;
|
||||
CefRefPtr<CefView> view_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefOverlayControllerImpl);
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#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<CefWindowView> 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<views::View> host_view_ = nullptr;
|
||||
|
||||
// Our view, which is responsible for drawing the UI.
|
||||
views::View* view_ = nullptr;
|
||||
raw_ptr<views::View> view_ = nullptr;
|
||||
|
||||
// The Widget implementation that is created and maintained by the overlay.
|
||||
// It contains |view_|.
|
||||
|
@ -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<ViewsViewClass> root_view_ref_;
|
||||
};
|
||||
|
||||
CEF_VIEW_IMPL_T CefString CEF_VIEW_IMPL_D::GetTypeString() {
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#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<UserData*>(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<CefView> view_;
|
||||
CefView* view_ref_;
|
||||
raw_ptr<CefView> view_ref_;
|
||||
};
|
||||
|
||||
// Based on Widget::GetNativeTheme.
|
||||
|
@ -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<CefViewDelegateClass> cef_delegate_;
|
||||
};
|
||||
|
||||
CEF_VIEW_VIEW_T gfx::Size CEF_VIEW_VIEW_D::CalculatePreferredSize() const {
|
||||
|
@ -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<views::Widget> widget_;
|
||||
|
||||
base::ScopedObservation<views::Widget, views::WidgetObserver> observation_{
|
||||
this};
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#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<CefWindowView> window_view_;
|
||||
|
||||
bool initialized_ = false;
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <memory>
|
||||
|
||||
#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<CefWindowImpl> window_impl_;
|
||||
raw_ptr<views::Widget> widget_;
|
||||
|
||||
// |window_| is the event target that is associated with this class.
|
||||
aura::Window* window_;
|
||||
raw_ptr<aura::Window> window_;
|
||||
};
|
||||
|
||||
#endif // defined(USE_AURA)
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#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<views::Widget> widget_ = nullptr;
|
||||
|
||||
// True if the window has been initialized.
|
||||
bool initialized_ = false;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user