refactor: migrate deprecated LazyInstance code to NoDestructor (#40927)

* refactor: do not use deprecated NoDestructor in javascript_environment.cc

* refactor: do not use deprecated NoDestructor in window_list.cc
This commit is contained in:
Charles Kerr 2024-01-10 14:01:49 -06:00 committed by GitHub
parent c2c64d27fd
commit fac964ac0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 21 deletions

View file

@ -7,7 +7,6 @@
#include <vector>
#include "base/lazy_instance.h"
#include "base/observer_list.h"
namespace electron {
@ -49,13 +48,12 @@ class WindowList {
WindowList();
~WindowList();
// A vector of the windows in this list, in the order they were added.
WindowVector windows_;
// A list of observers which will be notified of every window addition and
// removal across all WindowLists.
static base::LazyInstance<base::ObserverList<WindowListObserver>>::Leaky
observers_;
[[nodiscard]] static base::ObserverList<WindowListObserver>& GetObservers();
// A vector of the windows in this list, in the order they were added.
WindowVector windows_;
static WindowList* instance_;
};