mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-04-20 13:47:24 +02:00
Rewrite raw pointers reported by clang plugin (see #3239)
Found using a CEF build with clang_use_chrome_plugins=true and treat_warnings_as_errors=false. This change rewrites remaining raw pointers reported by chromium-rawptr checker and fixes a build error reported by StackAllocatedChecker.
This commit is contained in:
parent
810c51026c
commit
2a19d3dc57
@ -1138,8 +1138,8 @@ void AlloyBrowserHostImpl::GetCustomWebContentsView(
|
|||||||
const GURL& target_url,
|
const GURL& target_url,
|
||||||
int opener_render_process_id,
|
int opener_render_process_id,
|
||||||
int opener_render_frame_id,
|
int opener_render_frame_id,
|
||||||
content::WebContentsView** view,
|
raw_ptr<content::WebContentsView>* view,
|
||||||
content::RenderViewHostDelegateView** delegate_view) {
|
raw_ptr<content::RenderViewHostDelegateView>* delegate_view) {
|
||||||
CefBrowserInfoManager::GetInstance()->GetCustomWebContentsView(
|
CefBrowserInfoManager::GetInstance()->GetCustomWebContentsView(
|
||||||
target_url,
|
target_url,
|
||||||
frame_util::MakeGlobalId(opener_render_process_id,
|
frame_util::MakeGlobalId(opener_render_process_id,
|
||||||
|
@ -237,8 +237,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
|
|||||||
const GURL& target_url,
|
const GURL& target_url,
|
||||||
int opener_render_process_id,
|
int opener_render_process_id,
|
||||||
int opener_render_frame_id,
|
int opener_render_frame_id,
|
||||||
content::WebContentsView** view,
|
raw_ptr<content::WebContentsView>* view,
|
||||||
content::RenderViewHostDelegateView** delegate_view) override;
|
raw_ptr<content::RenderViewHostDelegateView>* delegate_view) override;
|
||||||
void WebContentsCreated(content::WebContents* source_contents,
|
void WebContentsCreated(content::WebContents* source_contents,
|
||||||
int opener_render_process_id,
|
int opener_render_process_id,
|
||||||
int opener_render_frame_id,
|
int opener_render_frame_id,
|
||||||
|
@ -228,8 +228,8 @@ bool CefBrowserInfoManager::CanCreateWindow(
|
|||||||
void CefBrowserInfoManager::GetCustomWebContentsView(
|
void CefBrowserInfoManager::GetCustomWebContentsView(
|
||||||
const GURL& target_url,
|
const GURL& target_url,
|
||||||
const content::GlobalRenderFrameHostId& opener_global_id,
|
const content::GlobalRenderFrameHostId& opener_global_id,
|
||||||
content::WebContentsView** view,
|
raw_ptr<content::WebContentsView>* view,
|
||||||
content::RenderViewHostDelegateView** delegate_view) {
|
raw_ptr<content::RenderViewHostDelegateView>* delegate_view) {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
|
|
||||||
auto pending_popup = PopPendingPopup(PendingPopup::CAN_CREATE_WINDOW,
|
auto pending_popup = PopPendingPopup(PendingPopup::CAN_CREATE_WINDOW,
|
||||||
|
@ -87,8 +87,8 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
|||||||
void GetCustomWebContentsView(
|
void GetCustomWebContentsView(
|
||||||
const GURL& target_url,
|
const GURL& target_url,
|
||||||
const content::GlobalRenderFrameHostId& opener_global_id,
|
const content::GlobalRenderFrameHostId& opener_global_id,
|
||||||
content::WebContentsView** view,
|
raw_ptr<content::WebContentsView>* view,
|
||||||
content::RenderViewHostDelegateView** delegate_view);
|
raw_ptr<content::RenderViewHostDelegateView>* delegate_view);
|
||||||
|
|
||||||
// Called from WebContentsDelegate::WebContentsCreated. See comments on
|
// Called from WebContentsDelegate::WebContentsCreated. See comments on
|
||||||
// PendingPopup for more information.
|
// PendingPopup for more information.
|
||||||
|
@ -85,8 +85,8 @@ content::WebContents* CefBrowserPlatformDelegate::CreateWebContents(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CefBrowserPlatformDelegate::CreateViewForWebContents(
|
void CefBrowserPlatformDelegate::CreateViewForWebContents(
|
||||||
content::WebContentsView** view,
|
raw_ptr<content::WebContentsView>* view,
|
||||||
content::RenderViewHostDelegateView** delegate_view) {
|
raw_ptr<content::RenderViewHostDelegateView>* delegate_view) {
|
||||||
DCHECK(false);
|
DCHECK(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,8 +111,8 @@ class CefBrowserPlatformDelegate {
|
|||||||
// called a single time per instance. May be called on multiple threads. Only
|
// called a single time per instance. May be called on multiple threads. Only
|
||||||
// used with windowless rendering.
|
// used with windowless rendering.
|
||||||
virtual void CreateViewForWebContents(
|
virtual void CreateViewForWebContents(
|
||||||
content::WebContentsView** view,
|
raw_ptr<content::WebContentsView>* view,
|
||||||
content::RenderViewHostDelegateView** delegate_view);
|
raw_ptr<content::RenderViewHostDelegateView>* delegate_view);
|
||||||
|
|
||||||
// Called after the WebContents for a browser has been created. |owned| will
|
// Called after the WebContents for a browser has been created. |owned| will
|
||||||
// be true if |web_contents| was created via CreateWebContents() and we should
|
// be true if |web_contents| was created via CreateWebContents() and we should
|
||||||
|
@ -31,8 +31,8 @@ CefBrowserPlatformDelegateOsr::CefBrowserPlatformDelegateOsr(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CefBrowserPlatformDelegateOsr::CreateViewForWebContents(
|
void CefBrowserPlatformDelegateOsr::CreateViewForWebContents(
|
||||||
content::WebContentsView** view,
|
raw_ptr<content::WebContentsView>* view,
|
||||||
content::RenderViewHostDelegateView** delegate_view) {
|
raw_ptr<content::RenderViewHostDelegateView>* delegate_view) {
|
||||||
DCHECK(!view_osr_);
|
DCHECK(!view_osr_);
|
||||||
|
|
||||||
// Use the OSR view instead of the default platform view.
|
// Use the OSR view instead of the default platform view.
|
||||||
|
@ -23,8 +23,8 @@ class CefBrowserPlatformDelegateOsr
|
|||||||
public:
|
public:
|
||||||
// CefBrowserPlatformDelegate methods:
|
// CefBrowserPlatformDelegate methods:
|
||||||
void CreateViewForWebContents(
|
void CreateViewForWebContents(
|
||||||
content::WebContentsView** view,
|
raw_ptr<content::WebContentsView>* view,
|
||||||
content::RenderViewHostDelegateView** delegate_view) override;
|
raw_ptr<content::RenderViewHostDelegateView>* delegate_view) override;
|
||||||
void WebContentsCreated(content::WebContents* web_contents,
|
void WebContentsCreated(content::WebContents* web_contents,
|
||||||
bool owned) override;
|
bool owned) override;
|
||||||
void WebContentsDestroyed(content::WebContents* web_contents) override;
|
void WebContentsDestroyed(content::WebContents* web_contents) override;
|
||||||
|
@ -258,7 +258,7 @@ class CefPostDataElementImpl : public CefPostDataElement {
|
|||||||
Type type_ = PDE_TYPE_EMPTY;
|
Type type_ = PDE_TYPE_EMPTY;
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
void* bytes;
|
RAW_PTR_EXCLUSION void* bytes;
|
||||||
size_t size;
|
size_t size;
|
||||||
} bytes;
|
} bytes;
|
||||||
cef_string_t filename;
|
cef_string_t filename;
|
||||||
|
@ -282,6 +282,7 @@ void RegisterURLSchemeAsSupportingFetchAPI(const blink::WebString& scheme) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct CefScriptForbiddenScope::Impl {
|
struct CefScriptForbiddenScope::Impl {
|
||||||
|
STACK_ALLOCATED_IGNORE()
|
||||||
blink::ScriptForbiddenScope scope_;
|
blink::ScriptForbiddenScope scope_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ index 205a1bb692091..d5cf0a22b11b2 100644
|
|||||||
|
|
||||||
FrameTree* WebContentsImpl::GetOwnedPictureInPictureFrameTree() {
|
FrameTree* WebContentsImpl::GetOwnedPictureInPictureFrameTree() {
|
||||||
diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h
|
diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h
|
||||||
index 1ee36913ac37c..19b13abaf0679 100644
|
index 1ee36913ac37c..6dcca3c80ede2 100644
|
||||||
--- content/public/browser/web_contents.h
|
--- content/public/browser/web_contents.h
|
||||||
+++ content/public/browser/web_contents.h
|
+++ content/public/browser/web_contents.h
|
||||||
@@ -105,10 +105,12 @@ class BrowserContext;
|
@@ -105,10 +105,12 @@ class BrowserContext;
|
||||||
@ -81,14 +81,14 @@ index 1ee36913ac37c..19b13abaf0679 100644
|
|||||||
network::mojom::WebSandboxFlags::kNone;
|
network::mojom::WebSandboxFlags::kNone;
|
||||||
|
|
||||||
+ // Optionally specify the view and delegate view.
|
+ // Optionally specify the view and delegate view.
|
||||||
+ content::WebContentsView* view = nullptr;
|
+ raw_ptr<content::WebContentsView> view = nullptr;
|
||||||
+ content::RenderViewHostDelegateView* delegate_view = nullptr;
|
+ raw_ptr<content::RenderViewHostDelegateView> delegate_view = nullptr;
|
||||||
+
|
+
|
||||||
// Value used to set the last time the WebContents was made active, this is
|
// Value used to set the last time the WebContents was made active, this is
|
||||||
// the value that'll be returned by GetLastActiveTime(). If this is left
|
// the value that'll be returned by GetLastActiveTime(). If this is left
|
||||||
// default initialized then the value is not passed on to the WebContents
|
// default initialized then the value is not passed on to the WebContents
|
||||||
diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h
|
diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h
|
||||||
index fd851a9347dd6..82abe6dd2fd07 100644
|
index fd851a9347dd6..dc77e13235743 100644
|
||||||
--- content/public/browser/web_contents_delegate.h
|
--- content/public/browser/web_contents_delegate.h
|
||||||
+++ content/public/browser/web_contents_delegate.h
|
+++ content/public/browser/web_contents_delegate.h
|
||||||
@@ -63,9 +63,11 @@ class EyeDropperListener;
|
@@ -63,9 +63,11 @@ class EyeDropperListener;
|
||||||
@ -112,8 +112,8 @@ index fd851a9347dd6..82abe6dd2fd07 100644
|
|||||||
+ const GURL& target_url,
|
+ const GURL& target_url,
|
||||||
+ int opener_render_process_id,
|
+ int opener_render_process_id,
|
||||||
+ int opener_render_frame_id,
|
+ int opener_render_frame_id,
|
||||||
+ content::WebContentsView** view,
|
+ raw_ptr<content::WebContentsView>* view,
|
||||||
+ content::RenderViewHostDelegateView** delegate_view) {}
|
+ raw_ptr<content::RenderViewHostDelegateView>* delegate_view) {}
|
||||||
+
|
+
|
||||||
// Notifies the delegate about the creation of a new WebContents. This
|
// Notifies the delegate about the creation of a new WebContents. This
|
||||||
// typically happens when popups are created.
|
// typically happens when popups are created.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user