chore: enable check raw ptr fields (#38167)
This commit is contained in:
parent
141175c723
commit
3dbc0a365f
120 changed files with 298 additions and 185 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "base/functional/callback_helpers.h"
|
||||
#include "base/location.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
#include "base/time/time.h"
|
||||
#include "components/viz/common/features.h"
|
||||
|
@ -167,7 +168,7 @@ class ElectronDelegatedFrameHostClient
|
|||
void InvalidateLocalSurfaceIdOnEviction() override {}
|
||||
|
||||
private:
|
||||
OffScreenRenderWidgetHostView* const view_;
|
||||
const raw_ptr<OffScreenRenderWidgetHostView> view_;
|
||||
};
|
||||
|
||||
OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
|
||||
|
@ -635,7 +636,7 @@ OffScreenRenderWidgetHostView::CreateHostDisplayClient(
|
|||
base::BindRepeating(&OffScreenRenderWidgetHostView::OnPaint,
|
||||
weak_ptr_factory_.GetWeakPtr()));
|
||||
host_display_client_->SetActive(IsPainting());
|
||||
return base::WrapUnique(host_display_client_);
|
||||
return base::WrapUnique(host_display_client_.get());
|
||||
}
|
||||
|
||||
bool OffScreenRenderWidgetHostView::InstallTransparency() {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/process/kill.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "base/time/time.h"
|
||||
|
@ -243,11 +244,11 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
|||
void UpdateBackgroundColorFromRenderer(SkColor color);
|
||||
|
||||
// Weak ptrs.
|
||||
content::RenderWidgetHostImpl* render_widget_host_;
|
||||
raw_ptr<content::RenderWidgetHostImpl> render_widget_host_;
|
||||
|
||||
OffScreenRenderWidgetHostView* parent_host_view_ = nullptr;
|
||||
OffScreenRenderWidgetHostView* popup_host_view_ = nullptr;
|
||||
OffScreenRenderWidgetHostView* child_host_view_ = nullptr;
|
||||
raw_ptr<OffScreenRenderWidgetHostView> parent_host_view_ = nullptr;
|
||||
raw_ptr<OffScreenRenderWidgetHostView> popup_host_view_ = nullptr;
|
||||
raw_ptr<OffScreenRenderWidgetHostView> child_host_view_ = nullptr;
|
||||
std::set<OffScreenRenderWidgetHostView*> guest_host_views_;
|
||||
std::set<OffscreenViewProxy*> proxy_views_;
|
||||
|
||||
|
@ -285,7 +286,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
|||
|
||||
std::unique_ptr<content::CursorManager> cursor_manager_;
|
||||
|
||||
OffScreenHostDisplayClient* host_display_client_;
|
||||
raw_ptr<OffScreenHostDisplayClient> host_display_client_;
|
||||
std::unique_ptr<OffScreenVideoConsumer> video_consumer_;
|
||||
|
||||
std::unique_ptr<ElectronDelegatedFrameHostClient>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <string>
|
||||
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "components/viz/host/client_frame_sink_video_capturer.h"
|
||||
#include "media/capture/mojom/video_capture_buffer.mojom-forward.h"
|
||||
|
@ -52,7 +53,7 @@ class OffScreenVideoConsumer : public viz::mojom::FrameSinkVideoConsumer {
|
|||
|
||||
OnPaintCallback callback_;
|
||||
|
||||
OffScreenRenderWidgetHostView* view_;
|
||||
raw_ptr<OffScreenRenderWidgetHostView> view_;
|
||||
std::unique_ptr<viz::ClientFrameSinkVideoCapturer> video_capturer_;
|
||||
|
||||
base::WeakPtrFactory<OffScreenVideoConsumer> weak_ptr_factory_{this};
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
#include "ui/events/event.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
|
@ -41,12 +42,12 @@ class OffscreenViewProxy {
|
|||
void ResetView() { view_ = nullptr; }
|
||||
|
||||
private:
|
||||
views::View* view_;
|
||||
raw_ptr<views::View> view_;
|
||||
|
||||
gfx::Rect view_bounds_;
|
||||
std::unique_ptr<SkBitmap> view_bitmap_;
|
||||
|
||||
OffscreenViewProxyObserver* observer_ = nullptr;
|
||||
raw_ptr<OffscreenViewProxyObserver> observer_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "shell/browser/native_window.h"
|
||||
#include "shell/browser/native_window_observer.h"
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "content/browser/renderer_host/render_view_host_delegate_view.h" // nogncheck
|
||||
#include "content/browser/web_contents/web_contents_view.h" // nogncheck
|
||||
#include "content/public/browser/web_contents.h"
|
||||
|
@ -92,7 +93,7 @@ class OffScreenWebContentsView : public content::WebContentsView,
|
|||
|
||||
OffScreenRenderWidgetHostView* GetView() const;
|
||||
|
||||
NativeWindow* native_window_ = nullptr;
|
||||
raw_ptr<NativeWindow> native_window_ = nullptr;
|
||||
|
||||
const bool transparent_;
|
||||
bool painting_ = true;
|
||||
|
@ -100,7 +101,7 @@ class OffScreenWebContentsView : public content::WebContentsView,
|
|||
OnPaintCallback callback_;
|
||||
|
||||
// Weak refs.
|
||||
content::WebContents* web_contents_ = nullptr;
|
||||
raw_ptr<content::WebContents> web_contents_ = nullptr;
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
OffScreenView* offScreenView_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue