Use the utility functions for `IPCDataTransfer` conversion
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox102 | --- | fixed |
People
(Reporter: edgar, Assigned: edgar)
References
Details
Attachments
(3 files)
This bug is filed while working on bug 1524237.
In bug 1524237, we would like to use Shmem to pass the large string over IPC for clipboard operation. I found there are duplicate codes for IPCDataTransfer
conversion. It would be nice to have a central place doing the conversion, so that changes in bug 1524237 don't need to be applied into multiple places.
Assignee | ||
Comment 1•2 years ago
|
||
If a IPCDataTransferItem fails to be converted, the subsequent IPCDataTransferItems
will be ignored, and the data in Shmem won't be deallocated properly if any.
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D145940
Assignee | ||
Comment 3•2 years ago
|
||
Depends on D145941
Assignee | ||
Comment 4•2 years ago
|
||
Comment 5•2 years ago
|
||
See also bug 1732920. I don't remember the exact data types involved anymore, but we do handle some types differently depending on whether the data is being send for drag and drop or copy/paste.
Assignee | ||
Comment 6•2 years ago
•
|
||
Yeah, we do differently on image type for dnd and copy/paste,
- dnd: we use
imgIContainer
, https://searchfox.org/mozilla-central/rev/390f7009e9e5a9585297aeea5fb9202f800eaf12/dom/events/RemoteDragStartData.cpp#61-68 - copy/paste: we use
nsIInputStream
, https://searchfox.org/mozilla-central/rev/390f7009e9e5a9585297aeea5fb9202f800eaf12/widget/nsClipboardProxy.cpp#78-85
But luckily, we setup IPCDataTransferImage
only when covering imgIContainer
into Shmem type, https://searchfox.org/mozilla-central/rev/390f7009e9e5a9585297aeea5fb9202f800eaf12/dom/base/nsContentUtils.cpp#7896-7901. So we could make IPCDataTransferImage "nullable" in https://searchfox.org/mozilla-central/rev/390f7009e9e5a9585297aeea5fb9202f800eaf12/dom/ipc/DOMTypes.ipdlh#122, and base on that to decide how to handle shmem data for image type.
Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e92cac424950 Part 1: Ensure all Shmem data is deallocated in nsContentUtils::IPCTransferableToTransferable; r=NeilDeakin https://hg.mozilla.org/integration/autoland/rev/f41095466201 Part 2: Use nsContentUtils::IPCTransferableToTransferable to convert IPCDataTransfer into nsITransferable; r=NeilDeakin https://hg.mozilla.org/integration/autoland/rev/ae2100095307 Part 3: Use utility function to convert IPCDataTransferItem into nsIVariant; r=NeilDeakin
Comment 8•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e92cac424950
https://hg.mozilla.org/mozilla-central/rev/f41095466201
https://hg.mozilla.org/mozilla-central/rev/ae2100095307
Description
•