refactor: make electron::api::BaseWindow fields private (#46710)

refactor: make electron::api::BaseWindow fields private

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2025-04-22 12:33:01 -05:00 committed by GitHub
parent b0d4c12247
commit 07a7ebb714
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View file

@ -42,7 +42,8 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
NativeWindow* window() const { return window_.get(); }
const NativeWindow* window() const { return window_.get(); }
NativeWindow* window() { return window_.get(); }
protected:
// Common constructor.
@ -262,6 +263,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
#endif
int32_t GetID() const;
private:
// Helpers.
// Remove this window from parent window's |child_windows_|.
@ -290,7 +292,6 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
// Reference to JS wrapper to prevent garbage collection.
v8::Global<v8::Value> self_ref_;
private:
base::WeakPtrFactory<BaseWindow> weak_factory_{this};
};