From 36caf98c21e9ec6d5603fd73f6e8268375e4985b Mon Sep 17 00:00:00 2001 From: Mirko Brodesser Date: Thu, 24 Feb 2022 10:29:25 +0000 Subject: [PATCH] Bug 1756164: part 1) Document "hidden" `DataTransferItem`s. r=mccr8 Otherwise, it's unclear what it means. Differential Revision: https://phabricator.services.mozilla.com/D139113 --- dom/base/nsContentAreaDragDrop.cpp | 1 + dom/events/DataTransfer.h | 5 +++++ dom/events/DataTransferItemList.h | 3 +++ 3 files changed, 9 insertions(+) diff --git a/dom/base/nsContentAreaDragDrop.cpp b/dom/base/nsContentAreaDragDrop.cpp index 451ef12ecc29..eb6f44134ea1 100644 --- a/dom/base/nsContentAreaDragDrop.cpp +++ b/dom/base/nsContentAreaDragDrop.cpp @@ -69,6 +69,7 @@ class MOZ_STACK_CLASS DragDataProducer { nsICookieJarSettings** aCookieJarSettings); private: + // @param aHidden true, iff the data should be hidden from non-chrome code. void AddString(DataTransfer* aDataTransfer, const nsAString& aFlavor, const nsAString& aData, nsIPrincipal* aPrincipal, bool aHidden = false); diff --git a/dom/events/DataTransfer.h b/dom/events/DataTransfer.h index 370cbfc6e24d..43605a40498a 100644 --- a/dom/events/DataTransfer.h +++ b/dom/events/DataTransfer.h @@ -339,6 +339,11 @@ class DataTransfer final : public nsISupports, public nsWrapperCache { // Variation of SetDataWithPrincipal with handles extracting // kCustomTypesMime data into separate types. + // + // @param aHidden if true and `aFormat != kCustomTypesMime`, the data will be + // hidden from non-chrome code. + // TODO: unclear, whether `aHidden` should be considered for + // the custom types. void SetDataWithPrincipalFromOtherProcess(const nsAString& aFormat, nsIVariant* aData, uint32_t aIndex, nsIPrincipal* aPrincipal, diff --git a/dom/events/DataTransferItemList.h b/dom/events/DataTransferItemList.h index d30093ec6256..02bca832d2e9 100644 --- a/dom/events/DataTransferItemList.h +++ b/dom/events/DataTransferItemList.h @@ -62,6 +62,7 @@ class DataTransferItemList final : public nsISupports, public nsWrapperCache { void Clear(nsIPrincipal& aSubjectPrincipal, ErrorResult& aRv); + // @param aHidden true, iff the item should be hidden from non-chrome code. already_AddRefed SetDataWithPrincipal( const nsAString& aType, nsIVariant* aData, uint32_t aIndex, nsIPrincipal* aPrincipal, bool aInsertOnly, bool aHidden, @@ -91,6 +92,8 @@ class DataTransferItemList final : public nsISupports, public nsWrapperCache { void ClearDataHelper(DataTransferItem* aItem, uint32_t aIndexHint, uint32_t aMozOffsetHint, nsIPrincipal& aSubjectPrincipal, ErrorResult& aRv); + + // @param aHidden true, iff the item should be hidden from non-chrome code. DataTransferItem* AppendNewItem(uint32_t aIndex, const nsAString& aType, nsIVariant* aData, nsIPrincipal* aPrincipal, bool aHidden); -- 2.11.4.GIT