diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /widget/nsClipboardProxy.cpp | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.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.cpp | 27 |
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 { |