NS_IMETHODIMP nsClipboardProxy::SetData(nsITransferable *aTransferable, nsIClipboardOwner *anOwner, int32_t aWhichClipboard) { ContentChild* child = ContentChild::GetSingleton(); IPCDataTransfer ipcDataTransfer; nsContentUtils::TransferableToIPCTransferable(aTransferable, &ipcDataTransfer, false, child, nullptr); bool isPrivateData = false; aTransferable->GetIsPrivateData(&isPrivateData); child->SendSetClipboard(ipcDataTransfer, isPrivateData, aWhichClipboard); return NS_OK; }
NS_IMETHODIMP nsClipboardProxy::SetData(nsITransferable *aTransferable, nsIClipboardOwner *anOwner, int32_t aWhichClipboard) { ContentChild* child = ContentChild::GetSingleton(); IPCDataTransfer ipcDataTransfer; nsContentUtils::TransferableToIPCTransferable(aTransferable, &ipcDataTransfer, false, child, nullptr); bool isPrivateData = false; aTransferable->GetIsPrivateData(&isPrivateData); nsCOMPtr<nsIPrincipal> requestingPrincipal; aTransferable->GetRequestingPrincipal(getter_AddRefs(requestingPrincipal)); child->SendSetClipboard(ipcDataTransfer, isPrivateData, IPC::Principal(requestingPrincipal), aWhichClipboard); return NS_OK; }