Closed Bug 1333917 Opened 3 years ago Closed 3 years ago

Convert PContentBridge to use endpoints

Categories

(Core :: DOM: Content Processes, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(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: https://treeherder.mozilla.org/#/jobs?repo=try&revision=77698207146ec22bd281e020a87ed3021ae8f5d0

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.

https://reviewboard.mozilla.org/r/107646/#review110222

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 amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fc0e726a478f
Make ContentBridge use endpoints, not bridges. r=kanru
https://hg.mozilla.org/mozilla-central/rev/fc0e726a478f
Status: NEW → RESOLVED
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.