mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: use C++11 class member variable initialization (#27477)
This commit is contained in:
@@ -182,11 +182,9 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
|
||||
frame_rate_(frame_rate),
|
||||
size_(initial_size),
|
||||
painting_(painting),
|
||||
is_showing_(false),
|
||||
cursor_manager_(new content::CursorManager(this)),
|
||||
mouse_wheel_phase_handler_(this),
|
||||
backing_(new SkBitmap),
|
||||
weak_ptr_factory_(this) {
|
||||
backing_(new SkBitmap) {
|
||||
DCHECK(render_widget_host_);
|
||||
DCHECK(!render_widget_host_->GetView());
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
||||
|
||||
std::unique_ptr<SkBitmap> backing_;
|
||||
|
||||
base::WeakPtrFactory<OffScreenRenderWidgetHostView> weak_ptr_factory_;
|
||||
base::WeakPtrFactory<OffScreenRenderWidgetHostView> weak_ptr_factory_{this};
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(OffScreenRenderWidgetHostView);
|
||||
};
|
||||
|
||||
@@ -18,8 +18,7 @@ OffScreenVideoConsumer::OffScreenVideoConsumer(
|
||||
OnPaintCallback callback)
|
||||
: callback_(callback),
|
||||
view_(view),
|
||||
video_capturer_(view->CreateVideoCapturer()),
|
||||
weak_ptr_factory_(this) {
|
||||
video_capturer_(view->CreateVideoCapturer()) {
|
||||
video_capturer_->SetResolutionConstraints(view_->SizeInPixels(),
|
||||
view_->SizeInPixels(), true);
|
||||
video_capturer_->SetAutoThrottlingEnabled(false);
|
||||
|
||||
@@ -48,7 +48,7 @@ class OffScreenVideoConsumer : public viz::mojom::FrameSinkVideoConsumer {
|
||||
OffScreenRenderWidgetHostView* view_;
|
||||
std::unique_ptr<viz::ClientFrameSinkVideoCapturer> video_capturer_;
|
||||
|
||||
base::WeakPtrFactory<OffScreenVideoConsumer> weak_ptr_factory_;
|
||||
base::WeakPtrFactory<OffScreenVideoConsumer> weak_ptr_factory_{this};
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(OffScreenVideoConsumer);
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace electron {
|
||||
OffScreenWebContentsView::OffScreenWebContentsView(
|
||||
bool transparent,
|
||||
const OnPaintCallback& callback)
|
||||
: native_window_(nullptr), transparent_(transparent), callback_(callback) {
|
||||
: transparent_(transparent), callback_(callback) {
|
||||
#if defined(OS_MAC)
|
||||
PlatformCreate();
|
||||
#endif
|
||||
|
||||
@@ -88,7 +88,7 @@ class OffScreenWebContentsView : public content::WebContentsView,
|
||||
|
||||
OffScreenRenderWidgetHostView* GetView() const;
|
||||
|
||||
NativeWindow* native_window_;
|
||||
NativeWindow* native_window_ = nullptr;
|
||||
|
||||
const bool transparent_;
|
||||
bool painting_ = true;
|
||||
|
||||
Reference in New Issue
Block a user