diff --git a/dom/base/PostMessageEvent.cpp b/dom/base/PostMessageEvent.cpp index ea89a43a18..2092e82977 100644 --- a/dom/base/PostMessageEvent.cpp +++ b/dom/base/PostMessageEvent.cpp @@ -32,16 +32,14 @@ PostMessageEvent::PostMessageEvent(nsGlobalWindow* aSource, const nsAString& aCallerOrigin, nsGlobalWindow* aTargetWindow, nsIPrincipal* aProvidedPrincipal, - nsIDocument* aSourceDocument, - bool aTrustedCaller) -: StructuredCloneHolder(CloningSupported, TransferringSupported, - StructuredCloneScope::SameProcessSameThread), - mSource(aSource), - mCallerOrigin(aCallerOrigin), - mTargetWindow(aTargetWindow), - mProvidedPrincipal(aProvidedPrincipal), - mSourceDocument(aSourceDocument), - mTrustedCaller(aTrustedCaller) + nsIDocument* aSourceDocument) + : StructuredCloneHolder(CloningSupported, TransferringSupported, + StructuredCloneScope::SameProcessSameThread) + , mSource(aSource) + , mCallerOrigin(aCallerOrigin) + , mTargetWindow(aTargetWindow) + , mProvidedPrincipal(aProvidedPrincipal) + , mSourceDocument(aSourceDocument) { MOZ_COUNT_CTOR(PostMessageEvent); } @@ -169,7 +167,7 @@ PostMessageEvent::Run() if (shell) presContext = shell->GetPresContext(); - event->SetTrusted(mTrustedCaller); + event->SetTrusted(true); WidgetEvent* internalEvent = event->WidgetEventPtr(); nsEventStatus status = nsEventStatus_eIgnore; diff --git a/dom/base/PostMessageEvent.h b/dom/base/PostMessageEvent.h index d96ac11403..a38e349c17 100644 --- a/dom/base/PostMessageEvent.h +++ b/dom/base/PostMessageEvent.h @@ -33,8 +33,7 @@ public: const nsAString& aCallerOrigin, nsGlobalWindow* aTargetWindow, nsIPrincipal* aProvidedPrincipal, - nsIDocument* aSourceDocument, - bool aTrustedCaller); + nsIDocument* aSourceDocument); private: ~PostMessageEvent(); @@ -44,7 +43,6 @@ private: RefPtr mTargetWindow; nsCOMPtr mProvidedPrincipal; nsCOMPtr mSourceDocument; - bool mTrustedCaller; }; } // namespace dom diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 3ef2f6cd8c..7e58b273f0 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -8885,8 +8885,7 @@ nsGlobalWindow::PostMessageMozOuter(JSContext* aCx, JS::Handle aMessa providedPrincipal, callerInnerWin ? callerInnerWin->GetDoc() - : nullptr, - nsContentUtils::IsCallerChrome()); + : nullptr); JS::Rooted message(aCx, aMessage); JS::Rooted transfer(aCx, aTransfer);