Bug 1908729 - Part 7: Remove DOM_WINDOW_FOO_TOPIC and their Notify functions r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D217593
This commit is contained in:
Kagami Sascha Rosylight 2024-07-30 13:54:01 +00:00
Родитель b8e696680c
Коммит 02839059d5
3 изменённых файлов: 0 добавлений и 46 удалений

Просмотреть файл

@ -1131,7 +1131,6 @@ void nsGlobalWindowInner::FreeInnerObjects() {
// Make sure that this is called before we null out the document and
// other members that the window destroyed observers could
// re-create.
NotifyDOMWindowDestroyed(this);
if (auto* reporter = nsWindowMemoryReporter::Get()) {
reporter->ObserveDOMWindowDetached(this);
}
@ -4051,46 +4050,12 @@ bool nsGlobalWindowInner::IsInModalState() {
FORWARD_TO_OUTER(IsInModalState, (), false);
}
// static
void nsGlobalWindowInner::NotifyDOMWindowDestroyed(
nsGlobalWindowInner* aWindow) {
nsCOMPtr<nsIObserverService> observerService = services::GetObserverService();
if (observerService) {
observerService->NotifyObservers(ToSupports(aWindow),
DOM_WINDOW_DESTROYED_TOPIC, nullptr);
}
}
void nsGlobalWindowInner::NotifyWindowIDDestroyed(const char* aTopic) {
nsCOMPtr<nsIRunnable> runnable =
new WindowDestroyedEvent(this, mWindowID, aTopic);
Dispatch(runnable.forget());
}
// static
void nsGlobalWindowInner::NotifyDOMWindowFrozen(nsGlobalWindowInner* aWindow) {
if (aWindow) {
nsCOMPtr<nsIObserverService> observerService =
services::GetObserverService();
if (observerService) {
observerService->NotifyObservers(ToSupports(aWindow),
DOM_WINDOW_FROZEN_TOPIC, nullptr);
}
}
}
// static
void nsGlobalWindowInner::NotifyDOMWindowThawed(nsGlobalWindowInner* aWindow) {
if (aWindow) {
nsCOMPtr<nsIObserverService> observerService =
services::GetObserverService();
if (observerService) {
observerService->NotifyObservers(ToSupports(aWindow),
DOM_WINDOW_THAWED_TOPIC, nullptr);
}
}
}
Element* nsGlobalWindowInner::GetFrameElement(nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError) {
FORWARD_TO_OUTER_OR_THROW(GetFrameElement, (aSubjectPrincipal), aError,
@ -5672,7 +5637,6 @@ void nsGlobalWindowInner::FreezeInternal(bool aIncludeSubWindows) {
mClientSource->Freeze();
}
NotifyDOMWindowFrozen(this);
NotifyGlobalFrozen();
}
@ -5711,7 +5675,6 @@ void nsGlobalWindowInner::ThawInternal(bool aIncludeSubWindows) {
pinnedWorker->Thaw();
}
NotifyDOMWindowThawed(this);
NotifyGlobalThawed();
}

Просмотреть файл

@ -1130,12 +1130,8 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
RefPtr<mozilla::GenericPromise> StorageAccessPermissionChanged(bool aGranted);
protected:
static void NotifyDOMWindowDestroyed(nsGlobalWindowInner* aWindow);
void NotifyWindowIDDestroyed(const char* aTopic);
static void NotifyDOMWindowFrozen(nsGlobalWindowInner* aWindow);
static void NotifyDOMWindowThawed(nsGlobalWindowInner* aWindow);
virtual void UpdateParentTarget() override;
// Clear the document-dependent slots on our JS wrapper. Inner windows only.

Просмотреть файл

@ -21,11 +21,6 @@
#include "nsILoadInfo.h"
#include "mozilla/MozPromise.h"
// Only fired for inner windows.
#define DOM_WINDOW_DESTROYED_TOPIC "dom-window-destroyed"
#define DOM_WINDOW_FROZEN_TOPIC "dom-window-frozen"
#define DOM_WINDOW_THAWED_TOPIC "dom-window-thawed"
class nsGlobalWindowInner;
class nsGlobalWindowOuter;
class nsIArray;