diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index a49283d08e08..197466bf6d64 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -7363,14 +7363,14 @@ nsContentUtils::TransferableToIPCTransferable(nsITransferable* aTransferable, nsAutoString dataAsString; text->GetData(dataAsString); IPCDataTransferItem* item = aIPCDataTransfer->items().AppendElement(); - item->flavor() = nsCString(flavorStr); - item->data() = nsString(dataAsString); + item->flavor() = flavorStr; + item->data() = dataAsString; } else if (ctext) { nsAutoCString dataAsString; ctext->GetData(dataAsString); IPCDataTransferItem* item = aIPCDataTransfer->items().AppendElement(); - item->flavor() = nsCString(flavorStr); - item->data() = nsCString(dataAsString); + item->flavor() = flavorStr; + item->data() = dataAsString; } else { nsCOMPtr sip = do_QueryInterface(data); @@ -7382,7 +7382,7 @@ nsContentUtils::TransferableToIPCTransferable(nsITransferable* aTransferable, nsCOMPtr stream(do_QueryInterface(data)); if (stream) { IPCDataTransferItem* item = aIPCDataTransfer->items().AppendElement(); - item->flavor() = nsCString(flavorStr); + item->flavor() = flavorStr; nsCString imageData; NS_ConsumeStream(stream, UINT32_MAX, imageData); @@ -7405,7 +7405,7 @@ nsContentUtils::TransferableToIPCTransferable(nsITransferable* aTransferable, nsContentUtils::GetSurfaceData(dataSurface, &length, &stride); IPCDataTransferItem* item = aIPCDataTransfer->items().AppendElement(); - item->flavor() = nsCString(flavorStr); + item->flavor() = flavorStr; // Turn item->data() into an nsCString prior to accessing it. item->data() = EmptyCString(); item->data().get_nsCString().Adopt(surfaceData.release(), length); @@ -7481,7 +7481,7 @@ nsContentUtils::TransferableToIPCTransferable(nsITransferable* aTransferable, } IPCDataTransferItem* item = aIPCDataTransfer->items().AppendElement(); - item->flavor() = nsCString(flavorStr); + item->flavor() = flavorStr; item->data() = data; } else { // This is a hack to support kFilePromiseMime. @@ -7490,12 +7490,12 @@ nsContentUtils::TransferableToIPCTransferable(nsITransferable* aTransferable, // nsContentAreaDragDropDataProvider as nsIFlavorDataProvider. if (flavorStr.EqualsLiteral(kFilePromiseMime)) { IPCDataTransferItem* item = aIPCDataTransfer->items().AppendElement(); - item->flavor() = nsCString(flavorStr); + item->flavor() = flavorStr; item->data() = NS_ConvertUTF8toUTF16(flavorStr); } else if (!data) { // Empty element, transfer only the flavor IPCDataTransferItem* item = aIPCDataTransfer->items().AppendElement(); - item->flavor() = nsCString(flavorStr); + item->flavor() = flavorStr; item->data() = EmptyCString(); continue; }