зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1317599. Get rid of LegacyIsCallerChromeOrNativeCode use in datatransfer code. r=mystor
This commit is contained in:
Родитель
e04996b20a
Коммит
dda84c3ef8
|
@ -498,7 +498,8 @@ DataTransfer::GetMozSourceNode(nsIDOMNode** aSourceNode)
|
|||
}
|
||||
|
||||
already_AddRefed<DOMStringList>
|
||||
DataTransfer::MozTypesAt(uint32_t aIndex, ErrorResult& aRv) const
|
||||
DataTransfer::MozTypesAt(uint32_t aIndex, CallerType aCallerType,
|
||||
ErrorResult& aRv) const
|
||||
{
|
||||
// Only the first item is valid for clipboard events
|
||||
if (aIndex > 0 &&
|
||||
|
@ -515,7 +516,7 @@ DataTransfer::MozTypesAt(uint32_t aIndex, ErrorResult& aRv) const
|
|||
|
||||
bool addFile = false;
|
||||
for (uint32_t i = 0; i < items.Length(); i++) {
|
||||
if (items[i]->ChromeOnly() && !nsContentUtils::LegacyIsCallerChromeOrNativeCode()) {
|
||||
if (items[i]->ChromeOnly() && aCallerType != CallerType::System) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -539,15 +540,6 @@ DataTransfer::MozTypesAt(uint32_t aIndex, ErrorResult& aRv) const
|
|||
return types.forget();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DataTransfer::MozTypesAt(uint32_t aIndex, nsISupports** aTypes)
|
||||
{
|
||||
ErrorResult rv;
|
||||
RefPtr<DOMStringList> types = MozTypesAt(aIndex, rv);
|
||||
types.forget(aTypes);
|
||||
return rv.StealNSResult();
|
||||
}
|
||||
|
||||
nsresult
|
||||
DataTransfer::GetDataAtNoSecurityCheck(const nsAString& aFormat,
|
||||
uint32_t aIndex,
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/EventForwards.h"
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
#include "mozilla/dom/File.h"
|
||||
|
||||
class nsINode;
|
||||
|
@ -178,6 +179,7 @@ public:
|
|||
}
|
||||
|
||||
already_AddRefed<DOMStringList> MozTypesAt(uint32_t aIndex,
|
||||
CallerType aCallerType,
|
||||
mozilla::ErrorResult& aRv) const;
|
||||
|
||||
void MozClearDataAt(const nsAString& aFormat, uint32_t aIndex,
|
||||
|
|
|
@ -116,13 +116,6 @@ interface nsIDOMDataTransfer : nsISupports
|
|||
*/
|
||||
attribute DOMString mozCursor;
|
||||
|
||||
/**
|
||||
* Holds a list of the format types of the data that is stored for an item
|
||||
* at the specified index. If the index is not in the range from 0 to
|
||||
* itemCount - 1, an empty string list is returned.
|
||||
*/
|
||||
nsISupports mozTypesAt(in unsigned long index);
|
||||
|
||||
/**
|
||||
* Will be true when the user has cancelled the drag (typically by pressing
|
||||
* Escape) and when the drag has been cancelled unexpectedly. This will be
|
||||
|
|
|
@ -76,7 +76,7 @@ partial interface DataTransfer {
|
|||
* at the specified index. If the index is not in the range from 0 to
|
||||
* itemCount - 1, an empty string list is returned.
|
||||
*/
|
||||
[Throws]
|
||||
[Throws, NeedsCallerType]
|
||||
DOMStringList mozTypesAt(unsigned long index);
|
||||
|
||||
/**
|
||||
|
|
|
@ -1274,7 +1274,8 @@ HTMLEditor::InsertFromDataTransfer(DataTransfer* aDataTransfer,
|
|||
bool aDoDeleteSelection)
|
||||
{
|
||||
ErrorResult rv;
|
||||
RefPtr<DOMStringList> types = aDataTransfer->MozTypesAt(aIndex, rv);
|
||||
RefPtr<DOMStringList> types =
|
||||
aDataTransfer->MozTypesAt(aIndex, CallerType::System, rv);
|
||||
if (rv.Failed()) {
|
||||
return rv.StealNSResult();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче