Closed Bug 1333917 Opened 3 years ago Closed 3 years ago

Convert PContentBridge to use endpoints


(Core :: DOM: Content Processes, defect)

Not set



Tracking Status
firefox54 --- fixed


(Reporter: mccr8, Assigned: mccr8)




(1 file)

Right now it contains:
  bridges PContent, PContent;

This should be replaced with the usage of endpoints.
Assignee: nobody → continuation
Depends on: 1334328
try run:

I'm not sure if we have any tests for this. If we do, hopefully try will run them. I mostly followed what my plugin changes did, so hopefully it is okay.
Attachment #8830987 - Flags: review?(kchen)
I may have a simpler way to do this, so I'm cancelling review for now.
Rather than sending a separate message back to the child with the endpoint, this returns the endpoint back with the initial sync call. A nice side effect is that this allows me to get rid of the odd ContentChild::mLastBridge field which was used to pass back a value in a very indirect way across the bridge call.
Comment on attachment 8830987 [details]
Bug 1333917 - Make ContentBridge use endpoints, not bridges.

LGTM. This is not activly tested. To test you can run mochitest with --nested_oop switch locally (hopefully it still works). Project Mortar is using this so soon or later will know if it breaks anything.

::: dom/ipc/ContentParent.cpp:1021
(Diff revision 2)
>    }
> -  if (!child->SendBridgeToChildProcess(cpId)) {
> +  Endpoint<PContentBridgeParent> endpoint;
> +  if (!child->SendBridgeToChildProcess(cpId, &endpoint)) {
>      return nullptr;
>    }

Currently we always create a bridge after creating the child process. Maybe we can combine the CreateChildProcess message and BridgeToChildProcess message so we can avoid one sync message.
Attachment #8830987 - Flags: review?(kchen) → review+
Pushed by
Make ContentBridge use endpoints, not bridges. r=kanru
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.