summaryrefslogtreecommitdiff
path: root/dom/base
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2023-04-07 16:02:34 +0800
committerFranklinDM <mrmineshafter17@gmail.com>2023-04-07 23:41:56 +0800
commit6d2e5850cec46d5d3b4c8865e22262a499379cf7 (patch)
tree8d9598a8a7e5ea86bd23696c1909c93846c699a7 /dom/base
parentb3a6a8f27410fe1a66c0ee90213870b888a6f874 (diff)
downloaduxp-6d2e5850cec46d5d3b4c8865e22262a499379cf7.tar.gz
Issue #2197 - Part 2d: Implement PostMessageOptions for Window
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1502802
Diffstat (limited to 'dom/base')
-rw-r--r--dom/base/nsGlobalWindow.cpp11
-rw-r--r--dom/base/nsGlobalWindow.h6
2 files changed, 17 insertions, 0 deletions
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp
index ec33d0aef0..f4c1119a83 100644
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -8898,6 +8898,17 @@ nsGlobalWindow::PostMessageMoz(JSContext* aCx,
aSubjectPrincipal, aRv);
}
+void
+nsGlobalWindow::PostMessageMoz(JSContext* aCx,
+ JS::Handle<JS::Value> aMessage,
+ const WindowPostMessageOptions& aOptions,
+ nsIPrincipal& aSubjectPrincipal,
+ ErrorResult& aRv)
+{
+ PostMessageMoz(aCx, aMessage, aOptions.mTargetOrigin, aOptions.mTransfer,
+ aSubjectPrincipal, aRv);
+}
+
class nsCloseEvent : public Runnable {
RefPtr<nsGlobalWindow> mWindow;
diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h
index 8c961e2014..9a97a5e92a 100644
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -135,6 +135,7 @@ class TabGroup;
class Timeout;
class U2F;
class WakeLock;
+struct WindowPostMessageOptions;
class Worklet;
namespace cache {
class CacheStorage;
@@ -936,6 +937,11 @@ public:
const mozilla::dom::Sequence<JSObject*>& aTransfer,
nsIPrincipal& aSubjectPrincipal,
mozilla::ErrorResult& aRv);
+ void PostMessageMoz(JSContext* aCx,
+ JS::Handle<JS::Value> aMessage,
+ const mozilla::dom::WindowPostMessageOptions& aOptions,
+ nsIPrincipal& aSubjectPrincipal,
+ mozilla::ErrorResult& aError);
int32_t SetTimeout(JSContext* aCx, mozilla::dom::Function& aFunction,
int32_t aTimeout,
const mozilla::dom::Sequence<JS::Value>& aArguments,