Skip to content
Snippets Groups Projects
Commit 76544eef authored by Kris Maglione's avatar Kris Maglione
Browse files

Bug 1571066: Return WindowProxyHolder from nsDocShell::GetWindowProxy. r=peterv

Returning BrowsingContext* from these sorts of getters tends to lead to
misuse. WindowProxyHolder is the semantically correct type to return here, in
any case.

Differential Revision: https://phabricator.services.mozilla.com/D52096

--HG--
extra : moz-landing-system : lando
parent ea96556c
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@
#include "mozilla/dom/ProfileTimelineMarkerBinding.h"
#include "mozilla/gfx/Matrix.h"
#include "mozilla/dom/ChildSHistory.h"
#include "mozilla/dom/WindowProxyHolder.h"
#include "nsIAuthPromptProvider.h"
#include "nsIBaseWindow.h"
......@@ -448,9 +449,9 @@ class nsDocShell final : public nsDocLoader,
// shift while triggering reload)
bool IsForceReloading();
mozilla::dom::BrowsingContext* GetWindowProxy() {
mozilla::dom::WindowProxyHolder GetWindowProxy() {
EnsureScriptEnvironment();
return mBrowsingContext;
return mozilla::dom::WindowProxyHolder(mBrowsingContext);
}
/**
......
......@@ -52,7 +52,7 @@ already_AddRefed<nsIWebNavigation> XULFrameElement::GetWebNavigation() {
Nullable<WindowProxyHolder> XULFrameElement::GetContentWindow() {
RefPtr<nsDocShell> docShell = GetDocShell();
if (docShell) {
return WindowProxyHolder(docShell->GetWindowProxy());
return docShell->GetWindowProxy();
}
return nullptr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment