Interceptor: Don't call HandlerProvider::GetPayloadSize for external process callers
Categories
(Core :: IPC: MSCOM, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: Jamie, Assigned: Jamie)
References
Details
Attachments
(1 file)
When an Interceptor is marshaled for an external (non-chrome) process caller, we do not provide a handler and thus don't call HandlerProvider::WriteHandlerPayload. However, GetMarshalSizeMax still calls HandlerProvider::GetPayloadSize. For a11y's handlerProvider, we must build the payload to get the size. This is wasteful (and maybe leaky?) if we're just going to throw it away.
To fix this, we can just avoid calling GetPayloadSize for external process callers.
Assignee | ||
Comment 1•4 years ago
|
||
When an Interceptor is marshaled for an external (non-chrome) process caller, we do not provide a handler and thus don't call HandlerProvider::WriteHandlerPayload.
However, GetMarshalSizeMax previously called HandlerProvider::GetPayloadSize even for external process callers.
For a11y's handlerProvider, we must build the payload to get the size.
This is wasteful in this case, since we're just going to throw it away.
Assignee | ||
Comment 2•4 years ago
|
||
(In reply to James Teh [:Jamie] from comment #0)
This is wasteful (and maybe leaky?) if we're just going to throw it away.
Some commentary on the "leaky" part of this. I'm not certain of this, but I think I'm right. :)
When we serialize the payload, it must AddRef on the interface pointers inside the payload. If the serializer isn't used, we do clean up its buffer when we destroy the Interceptor... but that doesn't Release on the interface pointers that the serializer AddReffed.
Comment 3•4 years ago
|
||
Oh, you know what? It probably does a CoMarshalInterface
while serializing payload in order to serialize the interfaces, which would then AddRef
.
Anyway, yeah, that's thorny. Better to not even do it in the first place.
Pushed by aklotz@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b24946004137 mscom::Interceptor: Don't call HandlerProvider::GetPayloadSize for external process callers. r=aklotz
Comment 5•4 years ago
|
||
bugherder |
Description
•