2010-06-23 23:46:08 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2015-05-03 22:32:37 +03:00
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-06-23 23:46:08 +04:00
|
|
|
|
2016-02-17 00:46:08 +03:00
|
|
|
#ifndef mozilla_dom_indexeddatabase_h__
|
|
|
|
#define mozilla_dom_indexeddatabase_h__
|
2010-06-23 23:46:08 +04:00
|
|
|
|
2013-08-20 10:43:47 +04:00
|
|
|
#include "js/StructuredClone.h"
|
2010-06-23 23:46:08 +04:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsTArray.h"
|
|
|
|
|
2016-10-25 22:19:06 +03:00
|
|
|
namespace JS {
|
|
|
|
struct WasmModule;
|
|
|
|
} // namespace JS
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
2014-10-08 20:15:22 +04:00
|
|
|
|
2015-05-12 15:09:51 +03:00
|
|
|
class Blob;
|
2016-02-17 00:46:08 +03:00
|
|
|
class IDBDatabase;
|
|
|
|
class IDBMutableFile;
|
2014-10-08 20:15:22 +04:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
namespace indexedDB {
|
2010-12-10 05:15:00 +03:00
|
|
|
|
2011-12-16 11:34:24 +04:00
|
|
|
class FileInfo;
|
2014-09-27 03:21:57 +04:00
|
|
|
class SerializedStructuredCloneReadInfo;
|
2012-06-03 20:33:52 +04:00
|
|
|
|
2012-08-02 10:02:29 +04:00
|
|
|
struct StructuredCloneFile
|
|
|
|
{
|
2016-10-25 22:18:40 +03:00
|
|
|
enum FileType {
|
2016-10-25 22:18:03 +03:00
|
|
|
eBlob,
|
|
|
|
eMutableFile,
|
2016-10-25 22:18:22 +03:00
|
|
|
eStructuredClone,
|
2016-10-25 22:18:48 +03:00
|
|
|
eWasmBytecode,
|
|
|
|
eWasmCompiled,
|
2016-10-25 22:18:44 +03:00
|
|
|
eEndGuard
|
2016-10-25 22:18:03 +03:00
|
|
|
};
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<Blob> mBlob;
|
|
|
|
RefPtr<IDBMutableFile> mMutableFile;
|
2016-10-25 22:19:06 +03:00
|
|
|
RefPtr<JS::WasmModule> mWasmModule;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<FileInfo> mFileInfo;
|
2016-10-25 22:18:40 +03:00
|
|
|
FileType mType;
|
2012-06-03 20:33:52 +04:00
|
|
|
|
2014-09-13 20:12:19 +04:00
|
|
|
// In IndexedDatabaseInlines.h
|
2014-09-27 03:21:57 +04:00
|
|
|
inline
|
|
|
|
StructuredCloneFile();
|
2014-09-18 03:36:01 +04:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
// In IndexedDatabaseInlines.h
|
|
|
|
inline
|
|
|
|
~StructuredCloneFile();
|
2011-12-16 11:34:24 +04:00
|
|
|
|
2012-06-01 21:21:12 +04:00
|
|
|
// In IndexedDatabaseInlines.h
|
|
|
|
inline bool
|
2014-09-27 03:21:57 +04:00
|
|
|
operator==(const StructuredCloneFile& aOther) const;
|
2014-09-18 03:36:01 +04:00
|
|
|
};
|
2012-06-01 21:21:12 +04:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
struct StructuredCloneReadInfo
|
2014-09-18 03:36:01 +04:00
|
|
|
{
|
2016-06-07 11:49:43 +03:00
|
|
|
JSStructuredCloneData mData;
|
2014-09-27 03:21:57 +04:00
|
|
|
nsTArray<StructuredCloneFile> mFiles;
|
|
|
|
IDBDatabase* mDatabase;
|
2016-10-26 07:51:33 +03:00
|
|
|
bool mHasPreprocessInfo;
|
2012-06-01 21:21:12 +04:00
|
|
|
|
|
|
|
// In IndexedDatabaseInlines.h
|
2014-09-27 03:21:57 +04:00
|
|
|
inline
|
|
|
|
StructuredCloneReadInfo();
|
2012-06-01 21:21:12 +04:00
|
|
|
|
2014-09-13 20:12:19 +04:00
|
|
|
// In IndexedDatabaseInlines.h
|
2014-09-27 03:21:57 +04:00
|
|
|
inline
|
|
|
|
~StructuredCloneReadInfo();
|
2011-12-16 11:34:24 +04:00
|
|
|
|
2016-08-10 09:18:29 +03:00
|
|
|
// In IndexedDatabaseInlines.h
|
|
|
|
inline
|
|
|
|
StructuredCloneReadInfo(StructuredCloneReadInfo&& aOther);
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
// In IndexedDatabaseInlines.h
|
|
|
|
inline StructuredCloneReadInfo&
|
|
|
|
operator=(StructuredCloneReadInfo&& aOther);
|
2014-09-18 03:36:01 +04:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
// In IndexedDatabaseInlines.h
|
|
|
|
inline
|
|
|
|
MOZ_IMPLICIT StructuredCloneReadInfo(SerializedStructuredCloneReadInfo&& aOther);
|
2012-06-01 21:21:12 +04:00
|
|
|
};
|
2010-12-10 05:15:00 +03:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
} // namespace indexedDB
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2010-12-10 05:15:00 +03:00
|
|
|
|
2016-02-17 00:46:08 +03:00
|
|
|
#endif // mozilla_dom_indexeddatabase_h__
|