зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1493292 - Remove len from nsIFlavorDataProvider r=smaug
Depends on D11203 Differential Revision: https://phabricator.services.mozilla.com/D11204 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
2cab03a44d
Коммит
29211098ca
|
@ -230,12 +230,10 @@ CheckAndGetExtensionForMime(const nsCString& aExtension,
|
|||
NS_IMETHODIMP
|
||||
nsContentAreaDragDropDataProvider::GetFlavorData(nsITransferable *aTransferable,
|
||||
const char *aFlavor,
|
||||
nsISupports **aData,
|
||||
uint32_t *aDataLen)
|
||||
nsISupports **aData)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aData && aDataLen);
|
||||
NS_ENSURE_ARG_POINTER(aData);
|
||||
*aData = nullptr;
|
||||
*aDataLen = 0;
|
||||
|
||||
nsresult rv = NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
|
@ -345,7 +343,6 @@ nsContentAreaDragDropDataProvider::GetFlavorData(nsITransferable *aTransferable,
|
|||
// send back an nsIFile
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
CallQueryInterface(file, aData);
|
||||
*aDataLen = sizeof(nsIFile*);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -86,9 +86,8 @@ interface nsIFlavorDataProvider : nsISupports
|
|||
* @param aTransferable (in parameter) the transferable we're being called for.
|
||||
* @param aFlavor (in parameter) the flavor of data to retrieve
|
||||
* @param aData the data. Some variant of class in nsISupportsPrimitives.idl
|
||||
* @param aDataLen the length of the data
|
||||
*/
|
||||
void getFlavorData(in nsITransferable aTransferable, in string aFlavor, out nsISupports aData, out unsigned long aDataLen);
|
||||
void getFlavorData(in nsITransferable aTransferable, in string aFlavor, out nsISupports aData);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -270,9 +270,8 @@ nsTransferable::GetTransferData(const char* aFlavor,
|
|||
// Do we have a (lazy) data provider?
|
||||
if (nsCOMPtr<nsIFlavorDataProvider> dataProvider =
|
||||
do_QueryInterface(dataBytes)) {
|
||||
uint32_t len;
|
||||
rv = dataProvider->GetFlavorData(this, aFlavor,
|
||||
getter_AddRefs(dataBytes), &len);
|
||||
getter_AddRefs(dataBytes));
|
||||
if (NS_FAILED(rv)) {
|
||||
dataBytes = nullptr;
|
||||
// The provider failed, fall into the converter code below.
|
||||
|
@ -298,11 +297,10 @@ nsTransferable::GetTransferData(const char* aFlavor,
|
|||
data.GetData(getter_AddRefs(dataBytes));
|
||||
|
||||
// Do we have a (lazy) data provider?
|
||||
uint32_t len;
|
||||
if (nsCOMPtr<nsIFlavorDataProvider> dataProvider =
|
||||
do_QueryInterface(dataBytes)) {
|
||||
rv = dataProvider->GetFlavorData(this, aFlavor,
|
||||
getter_AddRefs(dataBytes), &len);
|
||||
getter_AddRefs(dataBytes));
|
||||
if (NS_FAILED(rv)) {
|
||||
// Give up.
|
||||
return rv;
|
||||
|
@ -310,7 +308,7 @@ nsTransferable::GetTransferData(const char* aFlavor,
|
|||
}
|
||||
|
||||
uint32_t dataLen;
|
||||
return mFormatConv->Convert(data.GetFlavor().get(), dataBytes, len,
|
||||
return mFormatConv->Convert(data.GetFlavor().get(), dataBytes, 0,
|
||||
aFlavor, aData, &dataLen);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче