diff --git a/docshell/base/BrowsingContextWebProgress.cpp b/docshell/base/BrowsingContextWebProgress.cpp index 334ecfe629c0..9f364a9ee250 100644 --- a/docshell/base/BrowsingContextWebProgress.cpp +++ b/docshell/base/BrowsingContextWebProgress.cpp @@ -47,16 +47,6 @@ NS_IMETHODIMP BrowsingContextWebProgress::GetDOMWindow( return NS_ERROR_NOT_AVAILABLE; } -NS_IMETHODIMP BrowsingContextWebProgress::GetDOMWindowID( - uint64_t* aDOMWindowID) { - return NS_ERROR_NOT_AVAILABLE; -} - -NS_IMETHODIMP BrowsingContextWebProgress::GetInnerDOMWindowID( - uint64_t* aInnerDOMWindowID) { - return NS_ERROR_NOT_AVAILABLE; -} - NS_IMETHODIMP BrowsingContextWebProgress::GetIsTopLevel(bool* aIsTopLevel) { *aIsTopLevel = true; return NS_OK; diff --git a/dom/ipc/BrowserChild.cpp b/dom/ipc/BrowserChild.cpp index ba049f68d1a0..6a9f498d6edd 100644 --- a/dom/ipc/BrowserChild.cpp +++ b/dom/ipc/BrowserChild.cpp @@ -3748,16 +3748,19 @@ nsresult BrowserChild::PrepareProgressListenerData( NS_ENSURE_SUCCESS(rv, rv); aWebProgressData->loadType() = loadType; - uint64_t outerDOMWindowID = 0; - uint64_t innerDOMWindowID = 0; // The DOM Window ID getters here may throw if the inner or outer windows // aren't created yet or are destroyed at the time we're making this call // but that isn't fatal so ignore the exceptions here. - Unused << aWebProgress->GetDOMWindowID(&outerDOMWindowID); - aWebProgressData->outerDOMWindowID() = outerDOMWindowID; - - Unused << aWebProgress->GetInnerDOMWindowID(&innerDOMWindowID); - aWebProgressData->innerDOMWindowID() = innerDOMWindowID; + nsCOMPtr window; + rv = aWebProgress->GetDOMWindow(getter_AddRefs(window)); + if (NS_SUCCEEDED(rv) && window) { + if (nsCOMPtr outer = + nsPIDOMWindowOuter::From(window)) { + if (nsPIDOMWindowInner* inner = outer->GetCurrentInnerWindow()) { + aWebProgressData->innerDOMWindowID() = inner->WindowID(); + } + } + } } nsCOMPtr channel = do_QueryInterface(aRequest); diff --git a/dom/ipc/BrowserParent.cpp b/dom/ipc/BrowserParent.cpp index 2c922ff0551e..01690d5f8a38 100644 --- a/dom/ipc/BrowserParent.cpp +++ b/dom/ipc/BrowserParent.cpp @@ -2868,12 +2868,11 @@ void BrowserParent::ReconstructWebProgressAndRequest( nsCOMPtr webProgress; if (aWebProgressData) { - webProgress = new RemoteWebProgress( - aManager, aWebProgressData->outerDOMWindowID(), - aWebProgressData->innerDOMWindowID(), aWebProgressData->loadType(), - aWebProgressData->isLoadingDocument(), aWebProgressData->isTopLevel()); + webProgress = new RemoteWebProgress(aManager, aWebProgressData->loadType(), + aWebProgressData->isLoadingDocument(), + aWebProgressData->isTopLevel()); } else { - webProgress = new RemoteWebProgress(aManager, 0, 0, 0, false, false); + webProgress = new RemoteWebProgress(aManager, 0, false, false); } webProgress.forget(aOutWebProgress); diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl index edede4fe533a..2991411ed665 100644 --- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -106,7 +106,6 @@ struct WebProgressData bool isTopLevel; bool isLoadingDocument; uint32_t loadType; - uint64_t outerDOMWindowID; uint64_t innerDOMWindowID; }; diff --git a/dom/ipc/RemoteWebProgress.cpp b/dom/ipc/RemoteWebProgress.cpp index b09c1edb8972..4374e542ce82 100644 --- a/dom/ipc/RemoteWebProgress.cpp +++ b/dom/ipc/RemoteWebProgress.cpp @@ -26,18 +26,6 @@ NS_IMETHODIMP RemoteWebProgress::Init(nsIWebProgress* aManager, return NS_OK; } -NS_IMETHODIMP RemoteWebProgress::Update(uint64_t aOuterDOMWindowID, - uint64_t aInnerDOMWindowID, - uint32_t aLoadType, - bool aIsLoadingDocument) { - mOuterDOMWindowID = aOuterDOMWindowID; - mInnerDOMWindowID = aInnerDOMWindowID; - mLoadType = aLoadType; - mIsLoadingDocument = aIsLoadingDocument; - - return NS_OK; -} - NS_IMETHODIMP RemoteWebProgress::AddProgressListener( nsIWebProgressListener* aListener, uint32_t aNotifyMask) { if (mManager) { @@ -64,17 +52,6 @@ NS_IMETHODIMP RemoteWebProgress::GetDOMWindow(mozIDOMWindowProxy** aDOMWindow) { return NS_ERROR_NOT_AVAILABLE; } -NS_IMETHODIMP RemoteWebProgress::GetDOMWindowID(uint64_t* aDOMWindowID) { - *aDOMWindowID = mOuterDOMWindowID; - return NS_OK; -} - -NS_IMETHODIMP RemoteWebProgress::GetInnerDOMWindowID( - uint64_t* aInnerDOMWindowID) { - *aInnerDOMWindowID = mInnerDOMWindowID; - return NS_OK; -} - NS_IMETHODIMP RemoteWebProgress::GetIsTopLevel(bool* aIsTopLevel) { NS_ENSURE_ARG_POINTER(aIsTopLevel); *aIsTopLevel = mIsTopLevel; diff --git a/dom/ipc/RemoteWebProgress.h b/dom/ipc/RemoteWebProgress.h index ffed2aeaa02d..1212cac2ca44 100644 --- a/dom/ipc/RemoteWebProgress.h +++ b/dom/ipc/RemoteWebProgress.h @@ -22,18 +22,13 @@ class RemoteWebProgress final : public nsIRemoteWebProgress { RemoteWebProgress() : mManager(nullptr), - mOuterDOMWindowID(0), - mInnerDOMWindowID(0), mLoadType(0), mIsLoadingDocument(false), mIsTopLevel(false) {} - RemoteWebProgress(nsIWebProgress* aManager, uint64_t aOuterDOMWindowID, - uint64_t aInnerDOMWindowID, uint32_t aLoadType, + RemoteWebProgress(nsIWebProgress* aManager, uint32_t aLoadType, bool aIsLoadingDocument, bool aIsTopLevel) : mManager(aManager), - mOuterDOMWindowID(aOuterDOMWindowID), - mInnerDOMWindowID(aInnerDOMWindowID), mLoadType(aLoadType), mIsLoadingDocument(aIsLoadingDocument), mIsTopLevel(aIsTopLevel) {} @@ -43,8 +38,6 @@ class RemoteWebProgress final : public nsIRemoteWebProgress { nsCOMPtr mManager; - uint64_t mOuterDOMWindowID; - uint64_t mInnerDOMWindowID; uint32_t mLoadType; bool mIsLoadingDocument; bool mIsTopLevel; diff --git a/dom/ipc/WindowGlobalParent.cpp b/dom/ipc/WindowGlobalParent.cpp index 3fd2ead1045c..18ff4437603f 100644 --- a/dom/ipc/WindowGlobalParent.cpp +++ b/dom/ipc/WindowGlobalParent.cpp @@ -493,9 +493,8 @@ void WindowGlobalParent::NotifyContentBlockingEvent( return; } - nsCOMPtr webProgress = - new RemoteWebProgress(manager, OuterWindowId(), InnerWindowId(), 0, - false, BrowsingContext()->IsTopContent()); + nsCOMPtr webProgress = new RemoteWebProgress( + manager, 0, false, BrowsingContext()->IsTopContent()); Unused << managerAsListener->OnContentBlockingEvent(webProgress, aRequest, event.value()); diff --git a/dom/ipc/nsIRemoteWebProgress.idl b/dom/ipc/nsIRemoteWebProgress.idl index 9fe7c34f5aca..b9c8552556b1 100644 --- a/dom/ipc/nsIRemoteWebProgress.idl +++ b/dom/ipc/nsIRemoteWebProgress.idl @@ -14,17 +14,4 @@ interface nsIRemoteWebProgress : nsIWebProgress { */ void init(in nsIWebProgress aManager, in boolean aIsTopLevel); - - /** - * Update the RemoteWebProgress with values from the content process. - * - * @param aOuterWindowID The outer window ID. - * @param aInnerWindowID The inner window ID. - * @param aLoadType The load type. - * @param aIsLoadingDocument Whether or not a document is being loaded. - */ - void update(in uint64_t aOuterWindowID, - in uint64_t aInnerWindowID, - in uint32_t aLoadType, - in boolean aIsLoadingDocument); }; diff --git a/toolkit/components/sessionstore/SessionStoreListener.cpp b/toolkit/components/sessionstore/SessionStoreListener.cpp index 936025426a2f..0c34339de8e1 100644 --- a/toolkit/components/sessionstore/SessionStoreListener.cpp +++ b/toolkit/components/sessionstore/SessionStoreListener.cpp @@ -284,14 +284,8 @@ NS_IMETHODIMP TabListener::OnStateChange(nsIWebProgress* aWebProgress, return NS_OK; } - // The DOM Window ID getter here may throw if the inner or outer windows - // aren't created yet or are destroyed at the time we're making this call - // but that isn't fatal so ignore the exceptions here. - uint64_t DOMWindowID = 0; - Unused << aWebProgress->GetDOMWindowID(&DOMWindowID); - nsCOMPtr window = do_GetInterface(mDocShell); - NS_ENSURE_TRUE(window, NS_ERROR_FAILURE); - if (DOMWindowID != window->WindowID()) { + nsCOMPtr webProgress = do_QueryInterface(mDocShell); + if (webProgress != aWebProgress) { return NS_OK; } diff --git a/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp b/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp index ba7205c529c4..318037b12e9e 100644 --- a/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp +++ b/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp @@ -71,20 +71,6 @@ nsBrowserStatusFilter::GetDOMWindow(mozIDOMWindowProxy** aResult) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP -nsBrowserStatusFilter::GetDOMWindowID(uint64_t* aResult) { - *aResult = 0; - MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetDOMWindowID"); - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -nsBrowserStatusFilter::GetInnerDOMWindowID(uint64_t* aResult) { - *aResult = 0; - MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetInnerDOMWindowID"); - return NS_ERROR_NOT_IMPLEMENTED; -} - NS_IMETHODIMP nsBrowserStatusFilter::GetIsTopLevel(bool* aIsTopLevel) { *aIsTopLevel = false; diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp index 20e352c170ba..068fdf850be4 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp @@ -980,42 +980,6 @@ nsDocLoader::GetDOMWindow(mozIDOMWindowProxy** aResult) { return CallGetInterface(this, aResult); } -NS_IMETHODIMP -nsDocLoader::GetDOMWindowID(uint64_t* aResult) { - *aResult = 0; - - nsCOMPtr window; - nsresult rv = GetDOMWindow(getter_AddRefs(window)); - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr piwindow = nsPIDOMWindowOuter::From(window); - NS_ENSURE_STATE(piwindow); - - *aResult = piwindow->WindowID(); - return NS_OK; -} - -NS_IMETHODIMP -nsDocLoader::GetInnerDOMWindowID(uint64_t* aResult) { - *aResult = 0; - - nsCOMPtr window; - nsresult rv = GetDOMWindow(getter_AddRefs(window)); - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr outer = nsPIDOMWindowOuter::From(window); - NS_ENSURE_STATE(outer); - - nsPIDOMWindowInner* inner = outer->GetCurrentInnerWindow(); - if (!inner) { - // If we don't have an inner window, return 0. - return NS_OK; - } - - *aResult = inner->WindowID(); - return NS_OK; -} - NS_IMETHODIMP nsDocLoader::GetIsTopLevel(bool* aResult) { nsCOMPtr docShell = do_QueryInterface(this); diff --git a/uriloader/base/nsIWebProgress.idl b/uriloader/base/nsIWebProgress.idl index b0cde5026dc7..70079adfff8a 100644 --- a/uriloader/base/nsIWebProgress.idl +++ b/uriloader/base/nsIWebProgress.idl @@ -137,8 +137,6 @@ interface nsIWebProgress : nsISupports * Indicates that there is no associated DOM window. */ readonly attribute mozIDOMWindowProxy DOMWindow; - readonly attribute uint64_t DOMWindowID; - readonly attribute uint64_t innerDOMWindowID; /** * Indicates whether DOMWindow.top == DOMWindow.