From 59203c63bb777a3bacec32fb8830fba33540e809 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:29 +0200 Subject: Adding upstream version 127.0. Signed-off-by: Daniel Baumann --- toolkit/components/windowwatcher/nsIOpenWindowInfo.idl | 6 ++++++ toolkit/components/windowwatcher/nsOpenWindowInfo.cpp | 8 ++++++++ 2 files changed, 14 insertions(+) (limited to 'toolkit/components/windowwatcher') diff --git a/toolkit/components/windowwatcher/nsIOpenWindowInfo.idl b/toolkit/components/windowwatcher/nsIOpenWindowInfo.idl index a8347c5a1a..c0edb18536 100644 --- a/toolkit/components/windowwatcher/nsIOpenWindowInfo.idl +++ b/toolkit/components/windowwatcher/nsIOpenWindowInfo.idl @@ -74,4 +74,10 @@ interface nsIOpenWindowInfo : nsISupports { /* Callback to invoke when the browsing context for a new window is ready. */ [notxpcom, nostdcall] nsIBrowsingContextReadyCallback browsingContextReadyCallback(); + + /** + * When creating a window fails, we will be called to notify an error via + * callback. If no callback, do nothing. + */ + void cancel(); }; diff --git a/toolkit/components/windowwatcher/nsOpenWindowInfo.cpp b/toolkit/components/windowwatcher/nsOpenWindowInfo.cpp index 4374090075..042ee45f4e 100644 --- a/toolkit/components/windowwatcher/nsOpenWindowInfo.cpp +++ b/toolkit/components/windowwatcher/nsOpenWindowInfo.cpp @@ -57,6 +57,14 @@ nsOpenWindowInfo::BrowsingContextReadyCallback() { return mBrowsingContextReadyCallback; } +NS_IMETHODIMP nsOpenWindowInfo::Cancel() { + if (mBrowsingContextReadyCallback) { + mBrowsingContextReadyCallback->BrowsingContextReady(nullptr); + mBrowsingContextReadyCallback = nullptr; + } + return NS_OK; +} + NS_IMPL_ISUPPORTS(nsBrowsingContextReadyCallback, nsIBrowsingContextReadyCallback) -- cgit v1.2.3