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 09:46:21 -07:00
|
|
|
#ifndef mozilla_dom_indexeddb_idbtransaction_h__
|
|
|
|
#define mozilla_dom_indexeddb_idbtransaction_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
|
|
|
|
2011-12-15 23:34:24 -08:00
|
|
|
#include "mozIStorageConnection.h"
|
|
|
|
#include "mozIStorageStatement.h"
|
|
|
|
#include "mozIStorageFunction.h"
|
2010-06-28 09:46:21 -07:00
|
|
|
#include "nsIIDBTransaction.h"
|
2012-06-25 12:15:17 -07:00
|
|
|
#include "nsIDOMDOMError.h"
|
2010-06-23 12:46:08 -07:00
|
|
|
#include "nsIRunnable.h"
|
|
|
|
|
|
|
|
#include "nsAutoPtr.h"
|
2011-12-15 23:34:24 -08:00
|
|
|
#include "nsClassHashtable.h"
|
2010-06-23 12:46:08 -07:00
|
|
|
#include "nsHashKeys.h"
|
|
|
|
#include "nsInterfaceHashtable.h"
|
|
|
|
|
2012-01-24 02:03:37 -08:00
|
|
|
#include "mozilla/dom/indexedDB/IDBDatabase.h"
|
|
|
|
#include "mozilla/dom/indexedDB/IDBWrapperCache.h"
|
|
|
|
#include "mozilla/dom/indexedDB/FileInfo.h"
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
class nsIThread;
|
|
|
|
|
|
|
|
BEGIN_INDEXEDDB_NAMESPACE
|
|
|
|
|
|
|
|
class AsyncConnectionHelper;
|
|
|
|
class CommitHelper;
|
2012-06-25 12:15:17 -07:00
|
|
|
class IDBRequest;
|
2012-06-01 10:21:12 -07:00
|
|
|
class IndexedDBDatabaseChild;
|
|
|
|
class IndexedDBTransactionChild;
|
|
|
|
class IndexedDBTransactionParent;
|
2010-06-23 12:46:08 -07:00
|
|
|
struct ObjectStoreInfo;
|
|
|
|
class TransactionThreadPool;
|
2011-12-15 23:34:24 -08:00
|
|
|
class UpdateRefcountFunction;
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2011-10-20 09:10:56 -07:00
|
|
|
class IDBTransactionListener
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_IMETHOD_(nsrefcnt) AddRef() = 0;
|
|
|
|
NS_IMETHOD_(nsrefcnt) Release() = 0;
|
|
|
|
|
2012-06-26 08:09:25 -07:00
|
|
|
// Called just before dispatching the final events on the transaction.
|
|
|
|
virtual nsresult NotifyTransactionPreComplete(IDBTransaction* aTransaction) = 0;
|
|
|
|
// Called just after dispatching the final events on the transaction.
|
|
|
|
virtual nsresult NotifyTransactionPostComplete(IDBTransaction* aTransaction) = 0;
|
2011-10-20 09:10:56 -07:00
|
|
|
};
|
|
|
|
|
2012-01-24 02:03:37 -08:00
|
|
|
class IDBTransaction : public IDBWrapperCache,
|
2010-11-18 14:19:19 -08:00
|
|
|
public nsIIDBTransaction,
|
2012-04-06 13:40:10 -07:00
|
|
|
public nsIRunnable
|
2010-06-23 12:46:08 -07:00
|
|
|
{
|
|
|
|
friend class AsyncConnectionHelper;
|
|
|
|
friend class CommitHelper;
|
2012-06-01 10:21:12 -07:00
|
|
|
friend class IndexedDBDatabaseChild;
|
2010-11-15 13:49:49 -08:00
|
|
|
friend class ThreadObserver;
|
2010-06-23 12:46:08 -07:00
|
|
|
friend class TransactionThreadPool;
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
NS_DECL_NSIIDBTRANSACTION
|
2012-04-06 13:40:10 -07:00
|
|
|
NS_DECL_NSIRUNNABLE
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2012-01-24 02:03:37 -08:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(IDBTransaction, IDBWrapperCache)
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2012-03-12 21:44:45 -07:00
|
|
|
enum Mode
|
|
|
|
{
|
|
|
|
READ_ONLY = 0,
|
|
|
|
READ_WRITE,
|
2012-06-01 10:21:12 -07:00
|
|
|
VERSION_CHANGE,
|
|
|
|
|
|
|
|
// Only needed for IPC serialization helper, should never be used in code.
|
|
|
|
MODE_INVALID
|
2012-03-12 21:44:45 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
enum ReadyState
|
|
|
|
{
|
|
|
|
INITIAL = 0,
|
|
|
|
LOADING,
|
|
|
|
COMMITTING,
|
|
|
|
DONE
|
|
|
|
};
|
|
|
|
|
2010-06-28 09:46:21 -07:00
|
|
|
static already_AddRefed<IDBTransaction>
|
2010-09-09 15:15:38 -07:00
|
|
|
Create(IDBDatabase* aDatabase,
|
2010-06-23 12:46:08 -07:00
|
|
|
nsTArray<nsString>& aObjectStoreNames,
|
2012-03-12 21:44:45 -07:00
|
|
|
Mode aMode,
|
2012-06-01 10:21:12 -07:00
|
|
|
bool aDispatchDelayed)
|
|
|
|
{
|
|
|
|
return CreateInternal(aDatabase, aObjectStoreNames, aMode, aDispatchDelayed,
|
|
|
|
false);
|
|
|
|
}
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2011-06-23 19:18:00 -07:00
|
|
|
// nsIDOMEventTarget
|
2010-11-10 15:26:03 -08:00
|
|
|
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
void OnNewRequest();
|
|
|
|
void OnRequestFinished();
|
2012-11-09 19:29:07 -08:00
|
|
|
void OnRequestDisconnected();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2011-12-16 16:40:47 -08:00
|
|
|
void RemoveObjectStore(const nsAString& aName);
|
2011-12-04 09:39:01 -08:00
|
|
|
|
2011-10-20 09:10:56 -07:00
|
|
|
void SetTransactionListener(IDBTransactionListener* aListener);
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
bool StartSavepoint();
|
|
|
|
nsresult ReleaseSavepoint();
|
|
|
|
void RollbackSavepoint();
|
|
|
|
|
2010-10-19 10:58:52 -07:00
|
|
|
// Only meant to be called on mStorageThread!
|
|
|
|
nsresult GetOrCreateConnection(mozIStorageConnection** aConnection);
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
already_AddRefed<mozIStorageStatement>
|
|
|
|
GetCachedStatement(const nsACString& aQuery);
|
|
|
|
|
|
|
|
template<int N>
|
|
|
|
already_AddRefed<mozIStorageStatement>
|
|
|
|
GetCachedStatement(const char (&aQuery)[N])
|
|
|
|
{
|
2011-12-16 16:40:47 -08:00
|
|
|
return GetCachedStatement(NS_LITERAL_CSTRING(aQuery));
|
2010-06-23 12:46:08 -07:00
|
|
|
}
|
|
|
|
|
2010-12-15 13:21:17 -08:00
|
|
|
bool IsOpen() const;
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2012-06-26 08:09:25 -07:00
|
|
|
bool IsFinished() const
|
|
|
|
{
|
|
|
|
return mReadyState > LOADING;
|
|
|
|
}
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
bool IsWriteAllowed() const
|
|
|
|
{
|
2012-03-12 21:44:45 -07:00
|
|
|
return mMode == READ_WRITE || mMode == VERSION_CHANGE;
|
2010-06-23 12:46:08 -07:00
|
|
|
}
|
|
|
|
|
2010-12-15 13:21:17 -08:00
|
|
|
bool IsAborted() const
|
|
|
|
{
|
2012-06-01 10:21:12 -07:00
|
|
|
return NS_FAILED(mAbortCode);
|
2010-12-15 13:21:17 -08:00
|
|
|
}
|
|
|
|
|
2012-03-12 21:44:45 -07:00
|
|
|
// 'Get' prefix is to avoid name collisions with the enum
|
|
|
|
Mode GetMode()
|
2010-10-19 10:58:52 -07:00
|
|
|
{
|
|
|
|
return mMode;
|
|
|
|
}
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-09-09 15:15:38 -07:00
|
|
|
IDBDatabase* Database()
|
2010-08-26 13:57:25 -07:00
|
|
|
{
|
2010-09-09 15:15:38 -07:00
|
|
|
NS_ASSERTION(mDatabase, "This should never be null!");
|
|
|
|
return mDatabase;
|
2010-08-26 13:57:25 -07:00
|
|
|
}
|
|
|
|
|
2011-12-16 16:40:47 -08:00
|
|
|
DatabaseInfo* DBInfo() const
|
|
|
|
{
|
|
|
|
return mDatabaseInfo;
|
|
|
|
}
|
|
|
|
|
2010-11-10 15:25:40 -08:00
|
|
|
already_AddRefed<IDBObjectStore>
|
|
|
|
GetOrCreateObjectStore(const nsAString& aName,
|
2012-06-01 10:21:12 -07:00
|
|
|
ObjectStoreInfo* aObjectStoreInfo,
|
|
|
|
bool aCreating);
|
2010-11-10 15:25:40 -08:00
|
|
|
|
2012-06-03 09:33:52 -07:00
|
|
|
already_AddRefed<FileInfo> GetFileInfo(nsIDOMBlob* aBlob);
|
|
|
|
void AddFileInfo(nsIDOMBlob* aBlob, FileInfo* aFileInfo);
|
2011-12-15 23:34:24 -08:00
|
|
|
|
|
|
|
void ClearCreatedFileInfos();
|
|
|
|
|
2012-06-01 10:21:12 -07:00
|
|
|
void
|
|
|
|
SetActor(IndexedDBTransactionChild* aActorChild)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(!aActorChild || !mActorChild, "Shouldn't have more than one!");
|
|
|
|
mActorChild = aActorChild;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SetActor(IndexedDBTransactionParent* aActorParent)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(!aActorParent || !mActorParent,
|
|
|
|
"Shouldn't have more than one!");
|
|
|
|
mActorParent = aActorParent;
|
|
|
|
}
|
|
|
|
|
|
|
|
IndexedDBTransactionChild*
|
|
|
|
GetActorChild() const
|
|
|
|
{
|
|
|
|
return mActorChild;
|
|
|
|
}
|
|
|
|
|
2012-11-09 19:29:07 -08:00
|
|
|
IndexedDBTransactionParent*
|
|
|
|
GetActorParent() const
|
|
|
|
{
|
|
|
|
return mActorParent;
|
|
|
|
}
|
|
|
|
|
2012-06-01 10:21:12 -07:00
|
|
|
nsresult
|
|
|
|
ObjectStoreInternal(const nsAString& aName,
|
|
|
|
IDBObjectStore** _retval);
|
|
|
|
|
|
|
|
nsresult
|
2012-06-29 09:48:34 -07:00
|
|
|
Abort(IDBRequest* aRequest);
|
2012-06-01 10:21:12 -07:00
|
|
|
|
2012-06-25 12:15:17 -07:00
|
|
|
nsresult
|
2012-06-29 09:48:34 -07:00
|
|
|
Abort(nsresult aAbortCode);
|
2012-06-25 12:15:17 -07:00
|
|
|
|
2012-06-01 10:21:12 -07:00
|
|
|
nsresult
|
|
|
|
GetAbortCode() const
|
|
|
|
{
|
|
|
|
return mAbortCode;
|
|
|
|
}
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
private:
|
2012-06-29 09:48:34 -07:00
|
|
|
nsresult
|
|
|
|
AbortInternal(nsresult aAbortCode, already_AddRefed<nsIDOMDOMError> aError);
|
|
|
|
|
2012-06-01 10:21:12 -07:00
|
|
|
// Should only be called directly through IndexedDBDatabaseChild.
|
|
|
|
static already_AddRefed<IDBTransaction>
|
|
|
|
CreateInternal(IDBDatabase* aDatabase,
|
|
|
|
nsTArray<nsString>& aObjectStoreNames,
|
|
|
|
Mode aMode,
|
|
|
|
bool aDispatchDelayed,
|
|
|
|
bool aIsVersionChangeTransactionChild);
|
|
|
|
|
2010-06-28 09:46:21 -07:00
|
|
|
IDBTransaction();
|
|
|
|
~IDBTransaction();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
nsresult CommitOrRollback();
|
|
|
|
|
2010-06-28 09:46:49 -07:00
|
|
|
nsRefPtr<IDBDatabase> mDatabase;
|
2011-12-16 16:40:47 -08:00
|
|
|
nsRefPtr<DatabaseInfo> mDatabaseInfo;
|
2012-06-25 12:15:17 -07:00
|
|
|
nsCOMPtr<nsIDOMDOMError> mError;
|
2010-06-23 12:46:08 -07:00
|
|
|
nsTArray<nsString> mObjectStoreNames;
|
2012-03-12 21:44:45 -07:00
|
|
|
ReadyState mReadyState;
|
|
|
|
Mode mMode;
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mPendingRequests;
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
nsInterfaceHashtable<nsCStringHashKey, mozIStorageStatement>
|
|
|
|
mCachedStatements;
|
|
|
|
|
2011-10-20 09:10:56 -07:00
|
|
|
nsRefPtr<IDBTransactionListener> mListener;
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
// Only touched on the database thread.
|
|
|
|
nsCOMPtr<mozIStorageConnection> mConnection;
|
|
|
|
|
|
|
|
// Only touched on the database thread.
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mSavepointCount;
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-11-10 15:25:40 -08:00
|
|
|
nsTArray<nsRefPtr<IDBObjectStore> > mCreatedObjectStores;
|
2012-06-29 09:48:34 -07:00
|
|
|
nsTArray<nsRefPtr<IDBObjectStore> > mDeletedObjectStores;
|
2010-11-10 15:25:40 -08:00
|
|
|
|
2012-06-01 10:21:12 -07:00
|
|
|
nsRefPtr<UpdateRefcountFunction> mUpdateFileRefcountFunction;
|
2012-06-03 09:33:52 -07:00
|
|
|
nsRefPtrHashtable<nsISupportsHashKey, FileInfo> mCreatedFileInfos;
|
2012-06-01 10:21:12 -07:00
|
|
|
|
|
|
|
IndexedDBTransactionChild* mActorChild;
|
|
|
|
IndexedDBTransactionParent* mActorParent;
|
|
|
|
|
|
|
|
nsresult mAbortCode;
|
2010-11-15 13:49:49 -08:00
|
|
|
bool mCreating;
|
2010-12-15 13:21:17 -08:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
bool mFiredCompleteOrAbort;
|
|
|
|
#endif
|
2010-06-23 12:46:08 -07:00
|
|
|
};
|
|
|
|
|
2012-05-14 21:50:29 -07:00
|
|
|
class CommitHelper MOZ_FINAL : public nsIRunnable
|
2010-06-23 12:46:08 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIRUNNABLE
|
|
|
|
|
2011-10-20 09:10:56 -07:00
|
|
|
CommitHelper(IDBTransaction* aTransaction,
|
2011-12-16 16:40:47 -08:00
|
|
|
IDBTransactionListener* aListener,
|
|
|
|
const nsTArray<nsRefPtr<IDBObjectStore> >& mUpdatedObjectStores);
|
2012-06-01 10:21:12 -07:00
|
|
|
CommitHelper(IDBTransaction* aTransaction,
|
|
|
|
nsresult aAbortCode);
|
2010-10-19 10:58:52 -07:00
|
|
|
~CommitHelper();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
template<class T>
|
|
|
|
bool AddDoomedObject(nsCOMPtr<T>& aCOMPtr)
|
|
|
|
{
|
|
|
|
if (aCOMPtr) {
|
|
|
|
if (!mDoomedObjects.AppendElement(do_QueryInterface(aCOMPtr))) {
|
|
|
|
NS_ERROR("Out of memory!");
|
|
|
|
return false;
|
|
|
|
}
|
2012-07-30 07:20:58 -07:00
|
|
|
aCOMPtr = nullptr;
|
2010-06-23 12:46:08 -07:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2011-12-16 16:40:47 -08:00
|
|
|
// Writes new autoincrement counts to database
|
|
|
|
nsresult WriteAutoIncrementCounts();
|
|
|
|
|
|
|
|
// Updates counts after a successful commit
|
|
|
|
void CommitAutoIncrementCounts();
|
|
|
|
|
|
|
|
// Reverts counts when a transaction is aborted
|
|
|
|
void RevertAutoIncrementCounts();
|
|
|
|
|
2010-06-28 09:46:21 -07:00
|
|
|
nsRefPtr<IDBTransaction> mTransaction;
|
2011-10-20 09:10:56 -07:00
|
|
|
nsRefPtr<IDBTransactionListener> mListener;
|
2010-06-23 12:46:08 -07:00
|
|
|
nsCOMPtr<mozIStorageConnection> mConnection;
|
2011-12-15 23:34:24 -08:00
|
|
|
nsRefPtr<UpdateRefcountFunction> mUpdateFileRefcountFunction;
|
2010-06-23 12:46:08 -07:00
|
|
|
nsAutoTArray<nsCOMPtr<nsISupports>, 10> mDoomedObjects;
|
2011-12-16 16:40:47 -08:00
|
|
|
nsAutoTArray<nsRefPtr<IDBObjectStore>, 10> mAutoIncrementObjectStores;
|
2010-10-19 10:58:52 -07:00
|
|
|
|
2012-06-01 10:21:12 -07:00
|
|
|
nsresult mAbortCode;
|
2010-06-23 12:46:08 -07:00
|
|
|
};
|
|
|
|
|
2012-05-14 21:50:29 -07:00
|
|
|
class UpdateRefcountFunction MOZ_FINAL : public mozIStorageFunction
|
2011-12-15 23:34:24 -08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_MOZISTORAGEFUNCTION
|
|
|
|
|
|
|
|
UpdateRefcountFunction(FileManager* aFileManager)
|
|
|
|
: mFileManager(aFileManager)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
~UpdateRefcountFunction()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
nsresult Init();
|
|
|
|
|
|
|
|
void ClearFileInfoEntries()
|
|
|
|
{
|
|
|
|
mFileInfoEntries.Clear();
|
|
|
|
}
|
|
|
|
|
2012-08-24 11:51:33 -07:00
|
|
|
nsresult WillCommit(mozIStorageConnection* aConnection);
|
|
|
|
void DidCommit();
|
|
|
|
void DidAbort();
|
2011-12-15 23:34:24 -08:00
|
|
|
|
|
|
|
private:
|
|
|
|
class FileInfoEntry
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FileInfoEntry(FileInfo* aFileInfo)
|
|
|
|
: mFileInfo(aFileInfo), mDelta(0)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
~FileInfoEntry()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
nsRefPtr<FileInfo> mFileInfo;
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t mDelta;
|
2011-12-15 23:34:24 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
enum UpdateType {
|
|
|
|
eIncrement,
|
|
|
|
eDecrement
|
|
|
|
};
|
|
|
|
|
|
|
|
class DatabaseUpdateFunction
|
|
|
|
{
|
|
|
|
public:
|
2012-08-24 11:51:33 -07:00
|
|
|
DatabaseUpdateFunction(mozIStorageConnection* aConnection,
|
|
|
|
UpdateRefcountFunction* aFunction)
|
|
|
|
: mConnection(aConnection), mFunction(aFunction), mErrorCode(NS_OK)
|
2011-12-15 23:34:24 -08:00
|
|
|
{ }
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
bool Update(int64_t aId, int32_t aDelta);
|
2011-12-15 23:34:24 -08:00
|
|
|
nsresult ErrorCode()
|
|
|
|
{
|
|
|
|
return mErrorCode;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2012-08-22 08:56:38 -07:00
|
|
|
nsresult UpdateInternal(int64_t aId, int32_t aDelta);
|
2011-12-15 23:34:24 -08:00
|
|
|
|
|
|
|
nsCOMPtr<mozIStorageConnection> mConnection;
|
|
|
|
nsCOMPtr<mozIStorageStatement> mUpdateStatement;
|
2012-08-24 11:51:33 -07:00
|
|
|
nsCOMPtr<mozIStorageStatement> mSelectStatement;
|
2011-12-15 23:34:24 -08:00
|
|
|
nsCOMPtr<mozIStorageStatement> mInsertStatement;
|
|
|
|
|
2012-08-24 11:51:33 -07:00
|
|
|
UpdateRefcountFunction* mFunction;
|
|
|
|
|
2011-12-15 23:34:24 -08:00
|
|
|
nsresult mErrorCode;
|
|
|
|
};
|
|
|
|
|
|
|
|
nsresult ProcessValue(mozIStorageValueArray* aValues,
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t aIndex,
|
2011-12-15 23:34:24 -08:00
|
|
|
UpdateType aUpdateType);
|
|
|
|
|
2012-08-24 11:51:33 -07:00
|
|
|
nsresult CreateJournals();
|
|
|
|
|
|
|
|
nsresult RemoveJournals(const nsTArray<int64_t>& aJournals);
|
|
|
|
|
2011-12-15 23:34:24 -08:00
|
|
|
static PLDHashOperator
|
2012-08-22 08:56:38 -07:00
|
|
|
DatabaseUpdateCallback(const uint64_t& aKey,
|
2011-12-15 23:34:24 -08:00
|
|
|
FileInfoEntry* aValue,
|
|
|
|
void* aUserArg);
|
|
|
|
|
|
|
|
static PLDHashOperator
|
2012-08-22 08:56:38 -07:00
|
|
|
FileInfoUpdateCallback(const uint64_t& aKey,
|
2011-12-15 23:34:24 -08:00
|
|
|
FileInfoEntry* aValue,
|
|
|
|
void* aUserArg);
|
|
|
|
|
|
|
|
FileManager* mFileManager;
|
|
|
|
nsClassHashtable<nsUint64HashKey, FileInfoEntry> mFileInfoEntries;
|
2012-08-24 11:51:33 -07:00
|
|
|
|
|
|
|
nsTArray<int64_t> mJournalsToCreateBeforeCommit;
|
|
|
|
nsTArray<int64_t> mJournalsToRemoveAfterCommit;
|
|
|
|
nsTArray<int64_t> mJournalsToRemoveAfterAbort;
|
2011-12-15 23:34:24 -08:00
|
|
|
};
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
END_INDEXEDDB_NAMESPACE
|
|
|
|
|
2010-06-28 09:46:21 -07:00
|
|
|
#endif // mozilla_dom_indexeddb_idbtransaction_h__
|