Bug 1681529 - Part 5: Serialize `nsIInputStream` over IPC with aDelayedStart by default, r=baku

The current set of cases where a nsIInputStream is directly serialized over IPC
is fairly limited, and includes cases where the IPDL struct may be directly
stored within a content process, having the nsIInputStream left unused.

By switching this serialization to DelayedStart, we can avoid performing
unnecessary streaming copies of IPC data when sending postdata streams related
to session history and document navigation, while also avoiding issues like this
coming up again due to delayed start being the default.

Differential Revision: https://phabricator.services.mozilla.com/D101804
This commit is contained in:
Nika Layzell 2021-01-20 16:20:11 +00:00
Родитель f48d3f14bd
Коммит b95186c4e1
2 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -551,7 +551,7 @@ Maybe<IPCStream>& AutoIPCStream::TakeOptionalValue() {
void IPDLParamTraits<nsIInputStream*>::Write(IPC::Message* aMsg,
IProtocol* aActor,
nsIInputStream* aParam) {
auto autoStream = MakeRefPtr<HoldIPCStream>();
auto autoStream = MakeRefPtr<HoldIPCStream>(/* aDelayedStart */ true);
bool ok = false;
bool found = false;

Просмотреть файл

@ -200,6 +200,8 @@ class HoldIPCStream final : public AutoIPCStream {
public:
NS_INLINE_DECL_REFCOUNTING(HoldIPCStream)
using AutoIPCStream::AutoIPCStream;
private:
~HoldIPCStream() = default;
};