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
|
|
|
|
|
|
|
#ifndef mozilla_dom_indexeddb_indexeddatabase_h__
|
|
|
|
#define mozilla_dom_indexeddb_indexeddatabase_h__
|
|
|
|
|
2013-08-20 10:43:47 +04:00
|
|
|
#include "js/StructuredClone.h"
|
2010-06-23 23:46:08 +04:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsTArray.h"
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
2014-10-08 20:15:22 +04:00
|
|
|
|
2015-05-12 00:54:02 +03:00
|
|
|
class File;
|
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;
|
2012-06-03 20:33:52 +04:00
|
|
|
class IDBDatabase;
|
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
|
|
|
|
{
|
2015-05-12 00:54:02 +03:00
|
|
|
nsRefPtr<File> mFile;
|
2012-08-02 10:02:29 +04:00
|
|
|
nsRefPtr<FileInfo> mFileInfo;
|
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
|
|
|
{
|
2014-09-27 03:21:57 +04:00
|
|
|
nsTArray<uint8_t> mData;
|
|
|
|
nsTArray<StructuredCloneFile> mFiles;
|
|
|
|
IDBDatabase* mDatabase;
|
2012-06-01 21:21:12 +04:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
// XXX Remove!
|
|
|
|
JSAutoStructuredCloneBuffer mCloneBuffer;
|
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
|
|
|
|
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
|
|
|
|
2010-06-23 23:46:08 +04:00
|
|
|
#endif // mozilla_dom_indexeddb_indexeddatabase_h__
|