diff options
Diffstat (limited to 'widget/ClipboardWriteRequestParent.cpp')
-rw-r--r-- | widget/ClipboardWriteRequestParent.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/widget/ClipboardWriteRequestParent.cpp b/widget/ClipboardWriteRequestParent.cpp index 751befbe05..8a05c6a194 100644 --- a/widget/ClipboardWriteRequestParent.cpp +++ b/widget/ClipboardWriteRequestParent.cpp @@ -27,7 +27,9 @@ ClipboardWriteRequestParent::ClipboardWriteRequestParent( ClipboardWriteRequestParent::~ClipboardWriteRequestParent() = default; -nsresult ClipboardWriteRequestParent::Init(const int32_t& aClipboardType) { +nsresult ClipboardWriteRequestParent::Init( + const int32_t& aClipboardType, + mozilla::dom::WindowContext* aSettingWindowContext) { nsCOMPtr<nsIClipboard> clipboard(do_GetService(kCClipboardCID)); if (!clipboard) { Unused << PClipboardWriteRequestParent::Send__delete__(this, @@ -35,8 +37,9 @@ nsresult ClipboardWriteRequestParent::Init(const int32_t& aClipboardType) { return NS_ERROR_FAILURE; } - nsresult rv = clipboard->AsyncSetData(aClipboardType, this, - getter_AddRefs(mAsyncSetClipboardData)); + nsresult rv = + clipboard->AsyncSetData(aClipboardType, aSettingWindowContext, this, + getter_AddRefs(mAsyncSetClipboardData)); if (NS_FAILED(rv)) { Unused << PClipboardWriteRequestParent::Send__delete__(this, rv); return rv; @@ -57,12 +60,12 @@ NS_IMETHODIMP ClipboardWriteRequestParent::OnComplete(nsresult aResult) { IPCResult ClipboardWriteRequestParent::RecvSetData( const IPCTransferable& aTransferable) { if (!mManager->ValidatePrincipal( - aTransferable.requestingPrincipal(), + aTransferable.dataPrincipal(), {ContentParent::ValidatePrincipalOptions::AllowNullPtr, ContentParent::ValidatePrincipalOptions::AllowExpanded, ContentParent::ValidatePrincipalOptions::AllowSystem})) { ContentParent::LogAndAssertFailedPrincipalValidationInfo( - aTransferable.requestingPrincipal(), __func__); + aTransferable.dataPrincipal(), __func__); } if (!mAsyncSetClipboardData) { |