PBackgroundFileHandle.ipdl 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  3. * You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. include protocol PBackgroundFileRequest;
  5. include protocol PBackgroundMutableFile;
  6. include protocol PBlob;
  7. namespace mozilla {
  8. namespace dom {
  9. struct FileRequestGetMetadataParams
  10. {
  11. bool size;
  12. bool lastModified;
  13. };
  14. struct FileRequestReadParams
  15. {
  16. uint64_t offset;
  17. uint64_t size;
  18. };
  19. struct FileRequestStringData
  20. {
  21. nsCString string;
  22. };
  23. struct FileRequestBlobData
  24. {
  25. PBlob blob;
  26. };
  27. union FileRequestData
  28. {
  29. FileRequestStringData;
  30. FileRequestBlobData;
  31. };
  32. struct FileRequestWriteParams
  33. {
  34. uint64_t offset;
  35. FileRequestData data;
  36. uint64_t dataLength;
  37. };
  38. struct FileRequestTruncateParams
  39. {
  40. uint64_t offset;
  41. };
  42. struct FileRequestFlushParams
  43. {
  44. };
  45. struct FileRequestGetFileParams
  46. {
  47. };
  48. union FileRequestParams
  49. {
  50. FileRequestGetMetadataParams;
  51. FileRequestReadParams;
  52. FileRequestWriteParams;
  53. FileRequestTruncateParams;
  54. FileRequestFlushParams;
  55. FileRequestGetFileParams;
  56. };
  57. protocol PBackgroundFileHandle
  58. {
  59. manager PBackgroundMutableFile;
  60. manages PBackgroundFileRequest;
  61. parent:
  62. async DeleteMe();
  63. async Finish();
  64. async Abort();
  65. async PBackgroundFileRequest(FileRequestParams params);
  66. child:
  67. async __delete__();
  68. async Complete(bool aborted);
  69. };
  70. } // namespace dom
  71. } // namespace mozilla