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
|
|
|
|
2010-06-28 11:51:06 -07:00
|
|
|
#ifndef mozilla_dom_indexeddb_idbobjectstore_h__
|
|
|
|
#define mozilla_dom_indexeddb_idbobjectstore_h__
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-09-09 15:15:38 -07:00
|
|
|
#include "mozilla/dom/indexedDB/IndexedDatabase.h"
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2013-09-24 10:14:16 -07:00
|
|
|
#include "js/TypeDecls.h"
|
2013-07-31 08:48:36 -07:00
|
|
|
#include "mozilla/dom/IDBCursorBinding.h"
|
|
|
|
#include "mozilla/dom/IDBIndexBinding.h"
|
|
|
|
#include "mozilla/dom/IDBObjectStoreBinding.h"
|
2010-11-10 15:26:03 -08:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
2013-09-19 06:54:42 -07:00
|
|
|
#include "MainThreadUtils.h"
|
2010-11-10 15:26:03 -08:00
|
|
|
|
2013-07-31 08:48:36 -07:00
|
|
|
#include "mozilla/dom/indexedDB/IDBRequest.h"
|
2012-01-24 02:03:37 -08:00
|
|
|
#include "mozilla/dom/indexedDB/IDBTransaction.h"
|
2012-06-21 15:27:13 -07:00
|
|
|
#include "mozilla/dom/indexedDB/KeyPath.h"
|
2012-01-24 02:03:37 -08:00
|
|
|
|
2012-08-01 23:02:29 -07:00
|
|
|
class nsIDOMBlob;
|
2010-11-10 15:26:03 -08:00
|
|
|
class nsIScriptContext;
|
|
|
|
class nsPIDOMWindow;
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2012-08-01 23:02:29 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class ContentParent;
|
|
|
|
class PBlobChild;
|
|
|
|
class PBlobParent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
BEGIN_INDEXEDDB_NAMESPACE
|
|
|
|
|
2010-10-19 10:58:52 -07:00
|
|
|
class AsyncConnectionHelper;
|
2012-08-01 23:02:29 -07:00
|
|
|
class FileManager;
|
2012-06-01 10:21:12 -07:00
|
|
|
class IDBCursor;
|
|
|
|
class IDBKeyRange;
|
2012-06-19 18:50:39 -07:00
|
|
|
class IDBRequest;
|
2012-06-01 10:21:12 -07:00
|
|
|
class IndexedDBObjectStoreChild;
|
|
|
|
class IndexedDBObjectStoreParent;
|
2011-11-03 08:57:30 -07:00
|
|
|
class Key;
|
2010-10-19 10:58:52 -07:00
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
struct IndexInfo;
|
|
|
|
struct IndexUpdateInfo;
|
2012-06-01 10:21:12 -07:00
|
|
|
struct ObjectStoreInfo;
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2013-01-11 05:32:20 -08:00
|
|
|
struct FileHandleData;
|
|
|
|
struct BlobOrFileData;
|
|
|
|
|
2013-07-31 08:48:36 -07:00
|
|
|
class IDBObjectStore MOZ_FINAL : public nsISupports,
|
|
|
|
public nsWrapperCache
|
2010-06-23 12:46:08 -07:00
|
|
|
{
|
|
|
|
public:
|
2010-11-10 15:26:03 -08:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2012-06-22 14:00:53 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(IDBObjectStore)
|
2010-09-09 15:15:38 -07:00
|
|
|
|
2010-06-28 11:51:06 -07:00
|
|
|
static already_AddRefed<IDBObjectStore>
|
2010-09-09 15:15:38 -07:00
|
|
|
Create(IDBTransaction* aTransaction,
|
2011-12-16 16:40:47 -08:00
|
|
|
ObjectStoreInfo* aInfo,
|
2012-06-01 10:21:12 -07:00
|
|
|
nsIAtom* aDatabaseId,
|
|
|
|
bool aCreating);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
static nsresult
|
2012-08-22 08:56:38 -07:00
|
|
|
AppendIndexUpdateInfo(int64_t aIndexID,
|
2012-06-21 15:27:13 -07:00
|
|
|
const KeyPath& aKeyPath,
|
2011-12-04 09:39:01 -08:00
|
|
|
bool aUnique,
|
|
|
|
bool aMultiEntry,
|
|
|
|
JSContext* aCx,
|
2013-05-29 13:16:04 -07:00
|
|
|
JS::Handle<JS::Value> aObject,
|
2011-12-04 09:39:01 -08:00
|
|
|
nsTArray<IndexUpdateInfo>& aUpdateInfoArray);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
static nsresult
|
2010-06-28 09:46:21 -07:00
|
|
|
UpdateIndexes(IDBTransaction* aTransaction,
|
2012-08-22 08:56:38 -07:00
|
|
|
int64_t aObjectStoreId,
|
2010-06-23 12:46:08 -07:00
|
|
|
const Key& aObjectStoreKey,
|
|
|
|
bool aOverwrite,
|
2012-08-22 08:56:38 -07:00
|
|
|
int64_t aObjectDataId,
|
2010-06-23 12:46:08 -07:00
|
|
|
const nsTArray<IndexUpdateInfo>& aUpdateInfoArray);
|
|
|
|
|
2010-12-21 08:02:04 -08:00
|
|
|
static nsresult
|
2011-12-15 23:34:24 -08:00
|
|
|
GetStructuredCloneReadInfoFromStatement(mozIStorageStatement* aStatement,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t aDataIndex,
|
|
|
|
uint32_t aFileIdsIndex,
|
2012-06-03 09:33:52 -07:00
|
|
|
IDBDatabase* aDatabase,
|
2011-12-15 23:34:24 -08:00
|
|
|
StructuredCloneReadInfo& aInfo);
|
2010-12-21 08:02:04 -08:00
|
|
|
|
|
|
|
static void
|
2012-10-03 12:05:20 -07:00
|
|
|
ClearCloneReadInfo(StructuredCloneReadInfo& aReadInfo);
|
|
|
|
|
|
|
|
static void
|
|
|
|
ClearCloneWriteInfo(StructuredCloneWriteInfo& aWriteInfo);
|
2010-12-21 08:02:04 -08:00
|
|
|
|
2011-06-08 19:21:53 -07:00
|
|
|
static bool
|
|
|
|
DeserializeValue(JSContext* aCx,
|
2011-12-15 23:34:24 -08:00
|
|
|
StructuredCloneReadInfo& aCloneReadInfo,
|
2013-06-21 06:12:46 -07:00
|
|
|
JS::MutableHandle<JS::Value> aValue);
|
2011-06-08 19:21:53 -07:00
|
|
|
|
|
|
|
static bool
|
|
|
|
SerializeValue(JSContext* aCx,
|
2011-12-15 23:34:24 -08:00
|
|
|
StructuredCloneWriteInfo& aCloneWriteInfo,
|
2013-05-10 19:39:45 -07:00
|
|
|
JS::Handle<JS::Value> aValue);
|
2011-12-15 23:34:24 -08:00
|
|
|
|
2013-01-11 05:32:20 -08:00
|
|
|
template <class DeserializationTraits>
|
2011-12-15 23:34:24 -08:00
|
|
|
static JSObject*
|
|
|
|
StructuredCloneReadCallback(JSContext* aCx,
|
|
|
|
JSStructuredCloneReader* aReader,
|
2011-12-16 06:42:09 -08:00
|
|
|
uint32_t aTag,
|
|
|
|
uint32_t aData,
|
2011-12-15 23:34:24 -08:00
|
|
|
void* aClosure);
|
2013-08-08 15:53:04 -07:00
|
|
|
static bool
|
2011-12-15 23:34:24 -08:00
|
|
|
StructuredCloneWriteCallback(JSContext* aCx,
|
|
|
|
JSStructuredCloneWriter* aWriter,
|
2013-05-09 00:27:40 -07:00
|
|
|
JS::Handle<JSObject*> aObj,
|
2011-12-15 23:34:24 -08:00
|
|
|
void* aClosure);
|
|
|
|
|
|
|
|
static nsresult
|
|
|
|
ConvertFileIdsToArray(const nsAString& aFileIds,
|
2012-08-22 08:56:38 -07:00
|
|
|
nsTArray<int64_t>& aResult);
|
2011-06-08 19:21:53 -07:00
|
|
|
|
2012-08-01 23:02:29 -07:00
|
|
|
// Called only in the main process.
|
|
|
|
static nsresult
|
|
|
|
ConvertBlobsToActors(ContentParent* aContentParent,
|
|
|
|
FileManager* aFileManager,
|
|
|
|
const nsTArray<StructuredCloneFile>& aFiles,
|
|
|
|
InfallibleTArray<PBlobParent*>& aActors);
|
|
|
|
|
|
|
|
// Called only in the child process.
|
|
|
|
static void
|
|
|
|
ConvertActorsToBlobs(const InfallibleTArray<PBlobChild*>& aActors,
|
|
|
|
nsTArray<StructuredCloneFile>& aFiles);
|
|
|
|
|
2010-10-19 10:58:52 -07:00
|
|
|
const nsString& Name() const
|
|
|
|
{
|
|
|
|
return mName;
|
|
|
|
}
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
bool IsAutoIncrement() const
|
|
|
|
{
|
|
|
|
return mAutoIncrement;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsWriteAllowed() const
|
|
|
|
{
|
|
|
|
return mTransaction->IsWriteAllowed();
|
|
|
|
}
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
int64_t Id() const
|
2010-06-23 12:46:08 -07:00
|
|
|
{
|
2012-09-28 12:55:23 -07:00
|
|
|
NS_ASSERTION(mId != INT64_MIN, "Don't ask for this yet!");
|
2010-06-23 12:46:08 -07:00
|
|
|
return mId;
|
|
|
|
}
|
|
|
|
|
2012-06-21 15:27:13 -07:00
|
|
|
const KeyPath& GetKeyPath() const
|
2010-06-23 12:46:08 -07:00
|
|
|
{
|
|
|
|
return mKeyPath;
|
|
|
|
}
|
|
|
|
|
2012-06-21 15:27:13 -07:00
|
|
|
const bool HasValidKeyPath() const
|
2011-12-20 02:59:07 -08:00
|
|
|
{
|
2012-06-21 15:27:13 -07:00
|
|
|
return mKeyPath.IsValid();
|
2011-12-04 09:39:01 -08:00
|
|
|
}
|
|
|
|
|
2010-06-28 09:46:21 -07:00
|
|
|
IDBTransaction* Transaction()
|
2010-06-23 12:46:08 -07:00
|
|
|
{
|
|
|
|
return mTransaction;
|
|
|
|
}
|
|
|
|
|
2011-12-16 16:40:47 -08:00
|
|
|
ObjectStoreInfo* Info()
|
|
|
|
{
|
|
|
|
return mInfo;
|
|
|
|
}
|
2011-06-24 07:21:21 -07:00
|
|
|
|
2012-06-01 10:21:12 -07:00
|
|
|
void
|
|
|
|
SetActor(IndexedDBObjectStoreChild* aActorChild)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(!aActorChild || !mActorChild, "Shouldn't have more than one!");
|
|
|
|
mActorChild = aActorChild;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SetActor(IndexedDBObjectStoreParent* aActorParent)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(!aActorParent || !mActorParent,
|
|
|
|
"Shouldn't have more than one!");
|
|
|
|
mActorParent = aActorParent;
|
|
|
|
}
|
|
|
|
|
|
|
|
IndexedDBObjectStoreChild*
|
|
|
|
GetActorChild() const
|
|
|
|
{
|
|
|
|
return mActorChild;
|
|
|
|
}
|
|
|
|
|
|
|
|
IndexedDBObjectStoreParent*
|
|
|
|
GetActorParent() const
|
|
|
|
{
|
|
|
|
return mActorParent;
|
|
|
|
}
|
|
|
|
|
2013-07-31 08:48:40 -07:00
|
|
|
already_AddRefed<IDBIndex>
|
2012-06-01 10:21:12 -07:00
|
|
|
CreateIndexInternal(const IndexInfo& aInfo,
|
2013-07-31 08:48:36 -07:00
|
|
|
ErrorResult& aRv);
|
2012-06-01 10:21:12 -07:00
|
|
|
|
|
|
|
nsresult AddOrPutInternal(
|
|
|
|
const SerializedStructuredCloneWriteInfo& aCloneWriteInfo,
|
|
|
|
const Key& aKey,
|
|
|
|
const InfallibleTArray<IndexUpdateInfo>& aUpdateInfoArray,
|
2012-08-01 23:02:29 -07:00
|
|
|
const nsTArray<nsCOMPtr<nsIDOMBlob> >& aBlobs,
|
2012-06-01 10:21:12 -07:00
|
|
|
bool aOverwrite,
|
|
|
|
IDBRequest** _retval);
|
|
|
|
|
2013-07-31 08:48:36 -07:00
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
GetInternal(IDBKeyRange* aKeyRange,
|
|
|
|
ErrorResult& aRv);
|
2012-06-01 10:21:12 -07:00
|
|
|
|
2013-07-31 08:48:36 -07:00
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
GetAllInternal(IDBKeyRange* aKeyRange,
|
|
|
|
uint32_t aLimit,
|
|
|
|
ErrorResult& aRv);
|
2012-06-01 10:21:12 -07:00
|
|
|
|
2013-09-24 10:14:16 -07:00
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
GetAllKeysInternal(IDBKeyRange* aKeyRange,
|
|
|
|
uint32_t aLimit,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
2013-07-31 08:48:36 -07:00
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
DeleteInternal(IDBKeyRange* aKeyRange,
|
|
|
|
ErrorResult& aRv);
|
2012-06-01 10:21:12 -07:00
|
|
|
|
2013-07-31 08:48:36 -07:00
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
CountInternal(IDBKeyRange* aKeyRange,
|
|
|
|
ErrorResult& aRv);
|
2012-06-01 10:21:12 -07:00
|
|
|
|
2013-07-31 08:48:36 -07:00
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
OpenCursorInternal(IDBKeyRange* aKeyRange,
|
|
|
|
size_t aDirection,
|
|
|
|
ErrorResult& aRv);
|
2012-06-01 10:21:12 -07:00
|
|
|
|
2013-09-25 16:11:47 -07:00
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
OpenKeyCursorInternal(IDBKeyRange* aKeyRange,
|
|
|
|
size_t aDirection,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
2013-09-24 10:14:16 -07:00
|
|
|
nsresult
|
|
|
|
OpenCursorFromChildProcess(
|
2012-06-01 10:21:12 -07:00
|
|
|
IDBRequest* aRequest,
|
|
|
|
size_t aDirection,
|
|
|
|
const Key& aKey,
|
|
|
|
const SerializedStructuredCloneReadInfo& aCloneInfo,
|
2012-08-01 23:02:29 -07:00
|
|
|
nsTArray<StructuredCloneFile>& aBlobs,
|
2012-06-01 10:21:12 -07:00
|
|
|
IDBCursor** _retval);
|
|
|
|
|
2013-09-25 16:11:47 -07:00
|
|
|
nsresult
|
|
|
|
OpenCursorFromChildProcess(IDBRequest* aRequest,
|
|
|
|
size_t aDirection,
|
|
|
|
const Key& aKey,
|
|
|
|
IDBCursor** _retval);
|
|
|
|
|
2012-06-29 09:48:34 -07:00
|
|
|
void
|
|
|
|
SetInfo(ObjectStoreInfo* aInfo);
|
|
|
|
|
2013-09-11 05:49:05 -07:00
|
|
|
static const JSClass sDummyPropJSClass;
|
2012-06-21 15:27:13 -07:00
|
|
|
|
2013-07-31 08:48:36 -07:00
|
|
|
// nsWrapperCache
|
|
|
|
virtual JSObject*
|
|
|
|
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
// WebIDL
|
|
|
|
IDBTransaction*
|
|
|
|
GetParentObject() const
|
|
|
|
{
|
|
|
|
return mTransaction;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
GetName(nsString& aName) const
|
|
|
|
{
|
|
|
|
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
|
|
|
aName.Assign(mName);
|
|
|
|
}
|
|
|
|
|
|
|
|
JS::Value
|
|
|
|
GetKeyPath(JSContext* aCx, ErrorResult& aRv);
|
|
|
|
|
|
|
|
already_AddRefed<nsIDOMDOMStringList>
|
|
|
|
GetIndexNames(ErrorResult& aRv);
|
|
|
|
|
|
|
|
IDBTransaction*
|
|
|
|
Transaction() const
|
|
|
|
{
|
|
|
|
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
|
|
|
return mTransaction;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
AutoIncrement() const
|
|
|
|
{
|
|
|
|
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
|
|
|
return mAutoIncrement;
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
Put(JSContext* aCx, JS::Handle<JS::Value> aValue,
|
|
|
|
const Optional<JS::Handle<JS::Value> >& aKey, ErrorResult& aRv)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
|
|
|
return AddOrPut(aCx, aValue, aKey, true, aRv);
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
Add(JSContext* aCx, JS::Handle<JS::Value> aValue,
|
|
|
|
const Optional<JS::Handle<JS::Value> >& aKey, ErrorResult& aRv)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
|
|
|
return AddOrPut(aCx, aValue, aKey, false, aRv);
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
Delete(JSContext* aCx, JS::Handle<JS::Value> aKey, ErrorResult& aRv);
|
|
|
|
|
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
Get(JSContext* aCx, JS::Handle<JS::Value> aKey, ErrorResult& aRv);
|
|
|
|
|
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
Clear(ErrorResult& aRv);
|
|
|
|
|
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
OpenCursor(JSContext* aCx, const Optional<JS::Handle<JS::Value> >& aRange,
|
|
|
|
IDBCursorDirection aDirection, ErrorResult& aRv);
|
|
|
|
|
2013-07-31 08:48:40 -07:00
|
|
|
already_AddRefed<IDBIndex>
|
2013-07-31 08:48:36 -07:00
|
|
|
CreateIndex(JSContext* aCx, const nsAString& aName, const nsAString& aKeyPath,
|
|
|
|
const IDBIndexParameters& aOptionalParameters, ErrorResult& aRv);
|
|
|
|
|
2013-07-31 08:48:40 -07:00
|
|
|
already_AddRefed<IDBIndex>
|
2013-07-31 08:48:36 -07:00
|
|
|
CreateIndex(JSContext* aCx, const nsAString& aName,
|
2013-09-24 10:14:16 -07:00
|
|
|
const Sequence<nsString>& aKeyPath,
|
2013-07-31 08:48:36 -07:00
|
|
|
const IDBIndexParameters& aOptionalParameters, ErrorResult& aRv);
|
|
|
|
|
2013-07-31 08:48:40 -07:00
|
|
|
already_AddRefed<IDBIndex>
|
2013-07-31 08:48:36 -07:00
|
|
|
Index(const nsAString& aName, ErrorResult &aRv);
|
|
|
|
|
|
|
|
void
|
|
|
|
DeleteIndex(const nsAString& aIndexName, ErrorResult& aRv);
|
|
|
|
|
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
Count(JSContext* aCx, const Optional<JS::Handle<JS::Value> >& aKey,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
GetAll(JSContext* aCx, const Optional<JS::Handle<JS::Value> >& aKey,
|
2013-09-24 10:14:16 -07:00
|
|
|
const Optional<uint32_t>& aLimit, ErrorResult& aRv);
|
|
|
|
|
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
GetAllKeys(JSContext* aCx, const Optional<JS::HandleValue>& aKey,
|
|
|
|
const Optional<uint32_t>& aLimit, ErrorResult& aRv);
|
2013-09-25 16:11:47 -07:00
|
|
|
|
2013-09-25 16:11:47 -07:00
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
OpenKeyCursor(JSContext* aCx, const Optional<JS::HandleValue>& aRange,
|
|
|
|
IDBCursorDirection aDirection, ErrorResult& aRv);
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
protected:
|
2010-06-28 11:51:06 -07:00
|
|
|
IDBObjectStore();
|
|
|
|
~IDBObjectStore();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-06-28 15:22:41 -07:00
|
|
|
nsresult GetAddInfo(JSContext* aCx,
|
2013-05-10 19:39:45 -07:00
|
|
|
JS::Handle<JS::Value> aValue,
|
|
|
|
JS::Handle<JS::Value> aKeyVal,
|
2011-12-15 23:34:24 -08:00
|
|
|
StructuredCloneWriteInfo& aCloneWriteInfo,
|
2010-06-23 12:46:08 -07:00
|
|
|
Key& aKey,
|
2011-12-15 23:34:24 -08:00
|
|
|
nsTArray<IndexUpdateInfo>& aUpdateInfoArray);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2013-07-31 08:48:36 -07:00
|
|
|
already_AddRefed<IDBRequest>
|
|
|
|
AddOrPut(JSContext* aCx, JS::Handle<JS::Value> aValue,
|
|
|
|
const Optional<JS::Handle<JS::Value> >& aKey, bool aOverwrite,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
2013-07-31 08:48:40 -07:00
|
|
|
already_AddRefed<IDBIndex>
|
2013-07-31 08:48:36 -07:00
|
|
|
CreateIndex(JSContext* aCx, const nsAString& aName, KeyPath& aKeyPath,
|
|
|
|
const IDBIndexParameters& aOptionalParameters, ErrorResult& aRv);
|
2010-12-15 13:21:07 -08:00
|
|
|
|
2012-10-03 12:05:20 -07:00
|
|
|
static void
|
|
|
|
ClearStructuredCloneBuffer(JSAutoStructuredCloneBuffer& aBuffer);
|
|
|
|
|
2013-01-11 05:32:20 -08:00
|
|
|
static bool
|
|
|
|
ReadFileHandle(JSStructuredCloneReader* aReader,
|
|
|
|
FileHandleData* aRetval);
|
|
|
|
|
|
|
|
static bool
|
|
|
|
ReadBlobOrFile(JSStructuredCloneReader* aReader,
|
|
|
|
uint32_t aTag,
|
|
|
|
BlobOrFileData* aRetval);
|
2010-06-23 12:46:08 -07:00
|
|
|
private:
|
2010-06-28 09:46:21 -07:00
|
|
|
nsRefPtr<IDBTransaction> mTransaction;
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
int64_t mId;
|
2010-06-23 12:46:08 -07:00
|
|
|
nsString mName;
|
2012-06-21 15:27:13 -07:00
|
|
|
KeyPath mKeyPath;
|
2013-06-18 03:00:37 -07:00
|
|
|
JS::Heap<JS::Value> mCachedKeyPath;
|
2012-06-22 14:00:53 -07:00
|
|
|
bool mRooted;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mAutoIncrement;
|
2011-11-02 05:53:12 -07:00
|
|
|
nsCOMPtr<nsIAtom> mDatabaseId;
|
2011-12-16 16:40:47 -08:00
|
|
|
nsRefPtr<ObjectStoreInfo> mInfo;
|
2010-09-09 15:15:38 -07:00
|
|
|
|
2010-11-10 15:25:40 -08:00
|
|
|
nsTArray<nsRefPtr<IDBIndex> > mCreatedIndexes;
|
2012-06-01 10:21:12 -07:00
|
|
|
|
|
|
|
IndexedDBObjectStoreChild* mActorChild;
|
|
|
|
IndexedDBObjectStoreParent* mActorParent;
|
2010-06-23 12:46:08 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
END_INDEXEDDB_NAMESPACE
|
|
|
|
|
2010-06-28 11:51:06 -07:00
|
|
|
#endif // mozilla_dom_indexeddb_idbobjectstore_h__
|