PTCPSocket.ipdl 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. include protocol PNecko;
  6. include "mozilla/net/NeckoMessageUtils.h";
  7. using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
  8. struct TCPError {
  9. nsString name;
  10. nsString message;
  11. };
  12. union SendableData {
  13. uint8_t[];
  14. nsCString;
  15. };
  16. union CallbackData {
  17. void_t;
  18. SendableData;
  19. TCPError;
  20. };
  21. namespace mozilla {
  22. namespace net {
  23. //-------------------------------------------------------------------
  24. protocol PTCPSocket
  25. {
  26. manager PNecko;
  27. parent:
  28. // Forward calling to child's open() method to parent, expect TCPOptions
  29. // is expanded to |useSSL| (from TCPOptions.useSecureTransport) and
  30. // |binaryType| (from TCPOption.binaryType).
  31. async Open(nsString host, uint16_t port, bool useSSL, bool useArrayBuffers);
  32. // Ask parent to open a socket and bind the newly-opened socket to a local
  33. // address specified in |localAddr| and |localPort|.
  34. async OpenBind(nsCString host, uint16_t port,
  35. nsCString localAddr, uint16_t localPort,
  36. bool useSSL, bool aUseArrayBuffers, nsCString aFilter);
  37. // When child's send() is called, this message requrests parent to send
  38. // data and update it's trackingNumber.
  39. async Data(SendableData data, uint32_t trackingNumber);
  40. // Forward calling to child's upgradeToSecure() method to parent.
  41. async StartTLS();
  42. // Forward calling to child's send() method to parent.
  43. async Suspend();
  44. // Forward calling to child's resume() method to parent.
  45. async Resume();
  46. // Forward calling to child's close() method to parent.
  47. async Close();
  48. child:
  49. // Forward events that are dispatched by parent.
  50. async Callback(nsString type, CallbackData data, uint32_t readyState);
  51. // Update child's bufferedAmount when parent's bufferedAmount is updated.
  52. // trackingNumber is also passed back to child to ensure the bufferedAmount
  53. // is corresponding the last call to send().
  54. async UpdateBufferedAmount(uint32_t bufferedAmount, uint32_t trackingNumber);
  55. both:
  56. async RequestDelete();
  57. async __delete__();
  58. };
  59. } // namespace net
  60. } // namespace mozilla