Migrate DataTransfer IPC to use BigBuffer instead of Shmem
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: nika, Assigned: nika, NeedInfo)
References
(Blocks 2 open bugs)
Details
Attachments
(4 files)
I originally wrote these patches in the original bug 1681359, but figured it might make more sense to split up the landings.
This should improve the ergonomics of using these APIs, as well as open up opportunities for us to handle some cases which were previously impossible with e10s such as pasting arbitrary files.
Assignee | ||
Comment 1•2 years ago
|
||
The IPCDataTransfer type is used to transfer Clipboard/Drag & Drop payloads
over IPC to allow them to be written to or read from the relevant system
interfaces. Previously, the system which was used was somewhat complex, and
tried to use Shmem in some cases to store buffers out of line. Now that
BigBuffer is available, it can be simplified substantially.
In addition, this change removed the memory buffer overload of GetSurfaceData,
as the only consumer was using it to immediately send the payload over IPC as a
nsCString. It was changed to instead use BigBuffer
as that is more efficient
in a large buffer situation, and reduces the number of required copies.
Depends on D151851
Assignee | ||
Comment 2•2 years ago
|
||
The ShmemImage type was previously implemented using a Shmem, however due to
the usage patterns, BigBuffer
is probably a better fit, and allows unifying
more code in nsContentUtils.
Depends on D151852
Assignee | ||
Comment 3•2 years ago
|
||
After the previous changes there was only one consumer left of the Shmem
version of GetSurfaceData, which could easily be changed to use BigBuffer,
removing the need for that overload.
After that consumer is removed, the interface was also simplified as the
generic logic in the implementation was no longer necessary.
Depends on D151853
Assignee | ||
Comment 4•2 years ago
|
||
Due to Shmem implementing ParamTraits, it is possible for a Shmem argument to
not be visible to the IPDL compiler as it is only serialized within an opaque
type included with using
. If that happens, it would cause the construction of
the Shmem to fail on the other side, in a hard to diagnose manner. This changes
the logic to always allow any actor to manage shmems, to make it more in line
with the AllocShmem
method being directly declared on IProtocol.
This specifically caused issues after this patch stack with PContent, which no
longer has any shmem arguments visible to IPDL after these changes, but still
is used as a manager for Shmems included in some messages.
Depends on D151854
Comment 5•2 years ago
|
||
Oh this is extremely cool. Thank you Nika! Copy and pasting files now seems to work on Linux with some obvious tweaks in DataTransfer::CacheExternalData
.
Comment 7•2 years ago
|
||
Backed out 4 changesets (Bug 1781129) for causing bustages on nsContentUtils.cpp.
Backout link
Push with failures
Failure Log
Assignee | ||
Updated•2 years ago
|
Comment 9•2 years ago
|
||
Backed out 4 changesets (Bug 1781129) for causing bustages on nsContentUtils.cpp.
Backout link
Push with failures <--> Bb
Failure Log
Assignee | ||
Updated•2 years ago
|
Comment 10•2 years ago
|
||
Comment 11•2 years ago
|
||
Backed out 4 changesets (Bug 1781129) for causing mochitest failures on test_bug490879.html.
Backout link
Push with failures <--> 4
Failure Log
Comment 12•2 years ago
|
||
Comment 13•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8ab38c9b4f25
https://hg.mozilla.org/mozilla-central/rev/ac8bea9c2071
https://hg.mozilla.org/mozilla-central/rev/3f7f3285c842
https://hg.mozilla.org/mozilla-central/rev/be22852de7df
Description
•