diff --git a/shell/browser/api/electron_api_base_window.h b/shell/browser/api/electron_api_base_window.h index 13632d9f0f74..26af1ce52dd0 100644 --- a/shell/browser/api/electron_api_base_window.h +++ b/shell/browser/api/electron_api_base_window.h @@ -33,8 +33,6 @@ class BaseWindow : public gin_helper::TrackableObject, static void BuildPrototype(v8::Isolate* isolate, v8::Local prototype); - base::WeakPtr GetWeakPtr() { return weak_factory_.GetWeakPtr(); } - NativeWindow* window() const { return window_.get(); } protected: @@ -277,6 +275,7 @@ class BaseWindow : public gin_helper::TrackableObject, // Reference to JS wrapper to prevent garbage collection. v8::Global self_ref_; + private: base::WeakPtrFactory weak_factory_{this}; };