summaryrefslogtreecommitdiffstats
path: root/widget/nsClipboardProxy.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /widget/nsClipboardProxy.cpp
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/nsClipboardProxy.cpp')
-rw-r--r--widget/nsClipboardProxy.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/widget/nsClipboardProxy.cpp b/widget/nsClipboardProxy.cpp
index 3b27d5954d..5855374566 100644
--- a/widget/nsClipboardProxy.cpp
+++ b/widget/nsClipboardProxy.cpp
@@ -32,7 +32,8 @@ nsClipboardProxy::nsClipboardProxy() : mClipboardCaps(false, false, false) {}
NS_IMETHODIMP
nsClipboardProxy::SetData(nsITransferable* aTransferable,
- nsIClipboardOwner* anOwner, int32_t aWhichClipboard) {
+ nsIClipboardOwner* anOwner, int32_t aWhichClipboard,
+ mozilla::dom::WindowContext* aWindowContext) {
#if defined(ACCESSIBILITY) && defined(XP_WIN)
a11y::Compatibility::SuppressA11yForClipboardCopy();
#endif
@@ -41,17 +42,19 @@ nsClipboardProxy::SetData(nsITransferable* aTransferable,
IPCTransferable ipcTransferable;
nsContentUtils::TransferableToIPCTransferable(aTransferable, &ipcTransferable,
false, nullptr);
- child->SendSetClipboard(std::move(ipcTransferable), aWhichClipboard);
+ child->SendSetClipboard(std::move(ipcTransferable), aWhichClipboard,
+ aWindowContext);
return NS_OK;
}
NS_IMETHODIMP nsClipboardProxy::AsyncSetData(
- int32_t aWhichClipboard, nsIAsyncClipboardRequestCallback* aCallback,
+ int32_t aWhichClipboard, mozilla::dom::WindowContext* aSettingWindowContext,
+ nsIAsyncClipboardRequestCallback* aCallback,
nsIAsyncSetClipboardData** _retval) {
RefPtr<ClipboardWriteRequestChild> request =
MakeRefPtr<ClipboardWriteRequestChild>(aCallback);
ContentChild::GetSingleton()->SendPClipboardWriteRequestConstructor(
- request, aWhichClipboard);
+ request, aWhichClipboard, aSettingWindowContext);
request.forget(_retval);
return NS_OK;
}
@@ -69,12 +72,18 @@ nsClipboardProxy::GetData(nsITransferable* aTransferable,
nsTArray<nsCString> types;
aTransferable->FlavorsTransferableCanImport(types);
- IPCTransferableData transferable;
- ContentChild::GetSingleton()->SendGetClipboard(types, aWhichClipboard,
- aWindowContext, &transferable);
+ IPCTransferableDataOrError transferableOrError;
+ ContentChild::GetSingleton()->SendGetClipboard(
+ types, aWhichClipboard, aWindowContext, &transferableOrError);
+
+ if (transferableOrError.type() == IPCTransferableDataOrError::Tnsresult) {
+ MOZ_ASSERT(NS_FAILED(transferableOrError.get_nsresult()));
+ return transferableOrError.get_nsresult();
+ }
+
return nsContentUtils::IPCTransferableDataToTransferable(
- transferable, false /* aAddDataFlavor */, aTransferable,
- false /* aFilterUnknownFlavors */);
+ transferableOrError.get_IPCTransferableData(), false /* aAddDataFlavor */,
+ aTransferable, false /* aFilterUnknownFlavors */);
}
namespace {