mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1645540: Make IpdlQueue resize buffers when initial deserialization estimate was low r=jgilbert
When inserting an argument into the IpdlQueue for transmission, we need to resize the internal buffer if we end up with more data than expected. Differential Revision: https://phabricator.services.mozilla.com/D79581
This commit is contained in:
parent
ea1d95a265
commit
10ad51e7e6
@ -423,7 +423,11 @@ class IpdlProducer final : public SupportsWeakPtr<IpdlProducer<_Actor>> {
|
||||
template <typename Arg>
|
||||
QueueStatus WriteObject(size_t aRead, size_t* aWrite, const Arg& arg,
|
||||
size_t aArgSize) {
|
||||
// TODO: Queue needs one extra byte for PCQ (fixme).
|
||||
if (mSerializedData.Length() < (*aWrite) + aArgSize) {
|
||||
// Previous MinSizeOfArgs estimate was insufficient. Resize the
|
||||
// buffer to accomodate our real needs.
|
||||
mSerializedData.SetLength(*aWrite + aArgSize);
|
||||
}
|
||||
return mozilla::webgl::Marshaller::WriteObject(
|
||||
mSerializedData.Elements(), mSerializedData.Length() + 1, aRead, aWrite,
|
||||
arg, aArgSize);
|
||||
|
Loading…
Reference in New Issue
Block a user