fix: WebContentsView removal should compare directly (#44670)

* fix: WebContentsView removal should compare directly

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* fixup view comparision

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* chore: use erase_if

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* Apply review suggestions

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
trop[bot] 2024-11-15 13:09:34 +01:00 committed by GitHub
parent 500d453a63
commit 900400e442
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 43 additions and 26 deletions

View file

@ -21,6 +21,8 @@ class Handle;
namespace electron::api {
using ChildPair = std::pair<raw_ptr<views::View>, v8::Global<v8::Object>>;
class View : public gin_helper::EventEmitter<View>,
private views::ViewObserver {
public:
@ -69,7 +71,7 @@ class View : public gin_helper::EventEmitter<View>,
void ApplyBorderRadius();
void ReorderChildView(gin::Handle<View> child, size_t index);
std::vector<v8::Global<v8::Object>> child_views_;
std::vector<ChildPair> child_views_;
std::optional<int> border_radius_;
bool delete_view_ = true;