IndexedDatabase.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. #ifndef mozilla_dom_indexeddatabase_h__
  6. #define mozilla_dom_indexeddatabase_h__
  7. #include "js/StructuredClone.h"
  8. #include "nsCOMPtr.h"
  9. #include "nsTArray.h"
  10. namespace JS {
  11. struct WasmModule;
  12. } // namespace JS
  13. namespace mozilla {
  14. namespace dom {
  15. class Blob;
  16. class IDBDatabase;
  17. class IDBMutableFile;
  18. namespace indexedDB {
  19. class FileInfo;
  20. class SerializedStructuredCloneReadInfo;
  21. struct StructuredCloneFile
  22. {
  23. enum FileType {
  24. eBlob,
  25. eMutableFile,
  26. eStructuredClone,
  27. eWasmBytecode,
  28. eWasmCompiled,
  29. eEndGuard
  30. };
  31. RefPtr<Blob> mBlob;
  32. RefPtr<IDBMutableFile> mMutableFile;
  33. RefPtr<JS::WasmModule> mWasmModule;
  34. RefPtr<FileInfo> mFileInfo;
  35. FileType mType;
  36. // In IndexedDatabaseInlines.h
  37. inline
  38. StructuredCloneFile();
  39. // In IndexedDatabaseInlines.h
  40. inline
  41. ~StructuredCloneFile();
  42. // In IndexedDatabaseInlines.h
  43. inline bool
  44. operator==(const StructuredCloneFile& aOther) const;
  45. };
  46. struct StructuredCloneReadInfo
  47. {
  48. JSStructuredCloneData mData;
  49. nsTArray<StructuredCloneFile> mFiles;
  50. IDBDatabase* mDatabase;
  51. bool mHasPreprocessInfo;
  52. // In IndexedDatabaseInlines.h
  53. inline explicit
  54. StructuredCloneReadInfo(JS::StructuredCloneScope aScope);
  55. // In IndexedDatabaseInlines.h
  56. inline
  57. StructuredCloneReadInfo();
  58. // In IndexedDatabaseInlines.h
  59. inline
  60. ~StructuredCloneReadInfo();
  61. // In IndexedDatabaseInlines.h
  62. inline
  63. StructuredCloneReadInfo(StructuredCloneReadInfo&& aOther);
  64. // In IndexedDatabaseInlines.h
  65. inline StructuredCloneReadInfo&
  66. operator=(StructuredCloneReadInfo&& aOther);
  67. // In IndexedDatabaseInlines.h
  68. inline
  69. MOZ_IMPLICIT StructuredCloneReadInfo(SerializedStructuredCloneReadInfo&& aOther);
  70. };
  71. } // namespace indexedDB
  72. } // namespace dom
  73. } // namespace mozilla
  74. #endif // mozilla_dom_indexeddatabase_h__