2010-06-23 12:46:08 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2012-05-21 04:12:37 -07: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 12:46:08 -07:00
|
|
|
|
|
|
|
#ifndef mozilla_dom_indexeddb_indexeddatabase_h__
|
|
|
|
#define mozilla_dom_indexeddb_indexeddatabase_h__
|
|
|
|
|
|
|
|
#include "nsIProgrammingLanguage.h"
|
|
|
|
|
2013-08-19 23:43:47 -07:00
|
|
|
#include "js/StructuredClone.h"
|
2010-06-23 12:46:08 -07:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsTArray.h"
|
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
class nsIInputStream;
|
2011-12-15 23:34:24 -08:00
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
2014-10-08 09:15:22 -07:00
|
|
|
|
2014-10-08 09:15:23 -07:00
|
|
|
class File;
|
2014-10-08 09:15:22 -07:00
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
namespace indexedDB {
|
2010-12-09 18:15:00 -08:00
|
|
|
|
2011-12-15 23:34:24 -08:00
|
|
|
class FileInfo;
|
2012-06-03 09:33:52 -07:00
|
|
|
class IDBDatabase;
|
|
|
|
class IDBTransaction;
|
2014-09-26 16:21:57 -07:00
|
|
|
class SerializedStructuredCloneReadInfo;
|
|
|
|
class SerializedStructuredCloneWriteInfo;
|
2012-06-03 09:33:52 -07:00
|
|
|
|
2012-08-01 23:02:29 -07:00
|
|
|
struct StructuredCloneFile
|
|
|
|
{
|
2014-10-08 09:15:23 -07:00
|
|
|
nsRefPtr<File> mFile;
|
2012-08-01 23:02:29 -07:00
|
|
|
nsRefPtr<FileInfo> mFileInfo;
|
2012-06-03 09:33:52 -07:00
|
|
|
|
2014-09-13 09:12:19 -07:00
|
|
|
// In IndexedDatabaseInlines.h
|
2014-09-26 16:21:57 -07:00
|
|
|
inline
|
|
|
|
StructuredCloneFile();
|
2014-09-17 16:36:01 -07:00
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
// In IndexedDatabaseInlines.h
|
|
|
|
inline
|
|
|
|
~StructuredCloneFile();
|
2011-12-15 23:34:24 -08:00
|
|
|
|
2012-06-01 10:21:12 -07:00
|
|
|
// In IndexedDatabaseInlines.h
|
|
|
|
inline bool
|
2014-09-26 16:21:57 -07:00
|
|
|
operator==(const StructuredCloneFile& aOther) const;
|
2014-09-17 16:36:01 -07:00
|
|
|
};
|
2012-06-01 10:21:12 -07:00
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
struct StructuredCloneReadInfo
|
2014-09-17 16:36:01 -07:00
|
|
|
{
|
2014-09-26 16:21:57 -07:00
|
|
|
nsTArray<uint8_t> mData;
|
|
|
|
nsTArray<StructuredCloneFile> mFiles;
|
|
|
|
IDBDatabase* mDatabase;
|
2012-06-01 10:21:12 -07:00
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
// XXX Remove!
|
|
|
|
JSAutoStructuredCloneBuffer mCloneBuffer;
|
2012-06-01 10:21:12 -07:00
|
|
|
|
|
|
|
// In IndexedDatabaseInlines.h
|
2014-09-26 16:21:57 -07:00
|
|
|
inline
|
|
|
|
StructuredCloneReadInfo();
|
2012-06-01 10:21:12 -07:00
|
|
|
|
2014-09-13 09:12:19 -07:00
|
|
|
// In IndexedDatabaseInlines.h
|
2014-09-26 16:21:57 -07:00
|
|
|
inline
|
|
|
|
~StructuredCloneReadInfo();
|
2011-12-15 23:34:24 -08:00
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
// In IndexedDatabaseInlines.h
|
|
|
|
inline StructuredCloneReadInfo&
|
|
|
|
operator=(StructuredCloneReadInfo&& aOther);
|
2014-09-17 16:36:01 -07:00
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
// In IndexedDatabaseInlines.h
|
|
|
|
inline
|
|
|
|
MOZ_IMPLICIT StructuredCloneReadInfo(SerializedStructuredCloneReadInfo&& aOther);
|
2012-06-01 10:21:12 -07:00
|
|
|
};
|
2010-12-09 18:15:00 -08:00
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
} // namespace indexedDB
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2010-12-09 18:15:00 -08:00
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
#endif // mozilla_dom_indexeddb_indexeddatabase_h__
|