PContentBridge.ipdl 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  4. * You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. include protocol PBlob;
  6. include protocol PBrowser;
  7. include protocol PContent;
  8. include protocol PJavaScript;
  9. include protocol PFileDescriptorSet;
  10. include protocol PSendStream;
  11. include DOMTypes;
  12. include JavaScriptTypes;
  13. include PTabContext;
  14. using class IPC::Principal from "mozilla/dom/PermissionMessageUtils.h";
  15. using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
  16. using mozilla::dom::ContentParentId from "mozilla/dom/ipc/IdType.h";
  17. using class mozilla::dom::MessagePort from "mozilla/dom/MessagePort.h";
  18. using class mozilla::dom::ipc::StructuredCloneData from "mozilla/dom/ipc/StructuredCloneData.h";
  19. namespace mozilla {
  20. namespace dom {
  21. /*
  22. * PContentBridge allows us to represent a parent/child relationship between two
  23. * child processes. When a child process wants to open its own child, it asks
  24. * the root process to create a new process and then bridge them. The first
  25. * child will allocate the PContentBridgeParent, and the newly opened child will
  26. * allocate the PContentBridgeChild. This protocol allows these processes to
  27. * share PBrowsers and send messages to each other.
  28. */
  29. nested(upto inside_cpow) sync protocol PContentBridge
  30. {
  31. bridges PContent, PContent;
  32. manages PBlob;
  33. manages PBrowser;
  34. manages PFileDescriptorSet;
  35. manages PJavaScript;
  36. manages PSendStream;
  37. parent:
  38. sync SyncMessage(nsString aMessage, ClonedMessageData aData,
  39. CpowEntry[] aCpows, Principal aPrincipal)
  40. returns (StructuredCloneData[] retval);
  41. async PJavaScript();
  42. async PSendStream();
  43. both:
  44. // Both the parent and the child can construct the PBrowser.
  45. // See the comment in PContent::PBrowser().
  46. async PBrowser(TabId tabId, IPCTabContext context, uint32_t chromeFlags,
  47. ContentParentId cpId, bool isForApp, bool isForBrowser);
  48. async PBlob(BlobConstructorParams params);
  49. async PFileDescriptorSet(FileDescriptor fd);
  50. async AsyncMessage(nsString aMessage, CpowEntry[] aCpows,
  51. Principal aPrincipal, ClonedMessageData aData);
  52. };
  53. }
  54. }