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