Skip to content

Commit

Permalink
Bug 574811 - Rename IDBObjectStoreRequest to IDBObjectStore
Browse files Browse the repository at this point in the history
Updating interface names per recent specification changes.
r=bent

--HG--
rename : dom/indexedDB/IDBObjectStoreRequest.cpp => dom/indexedDB/IDBObjectStore.cpp
rename : dom/indexedDB/IDBObjectStoreRequest.h => dom/indexedDB/IDBObjectStore.h
  • Loading branch information
sdwilsh committed Jun 28, 2010
1 parent 1eeffd7 commit ad8dc5e
Show file tree
Hide file tree
Showing 18 changed files with 199 additions and 255 deletions.
7 changes: 3 additions & 4 deletions dom/base/nsDOMClassInfo.cpp
Expand Up @@ -483,7 +483,7 @@ using namespace mozilla::dom;
#include "mozilla/dom/indexedDB/IDBRequest.h"
#include "mozilla/dom/indexedDB/IDBDatabase.h"
#include "mozilla/dom/indexedDB/IDBEvents.h"
#include "mozilla/dom/indexedDB/IDBObjectStoreRequest.h"
#include "mozilla/dom/indexedDB/IDBObjectStore.h"
#include "mozilla/dom/indexedDB/IDBTransaction.h"
#include "mozilla/dom/indexedDB/IDBCursorRequest.h"
#include "mozilla/dom/indexedDB/IDBKeyRange.h"
Expand Down Expand Up @@ -1430,7 +1430,7 @@ static nsDOMClassInfoData sClassInfoData[] = {
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(IDBTransactionEvent, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(IDBObjectStoreRequest, nsDOMGenericSH,
NS_DEFINE_CLASSINFO_DATA(IDBObjectStore, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(IDBTransaction, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
Expand Down Expand Up @@ -3956,8 +3956,7 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent)
DOM_CLASSINFO_MAP_END

DOM_CLASSINFO_MAP_BEGIN(IDBObjectStoreRequest, nsIIDBObjectStoreRequest)
DOM_CLASSINFO_MAP_ENTRY(nsIIDBObjectStoreRequest)
DOM_CLASSINFO_MAP_BEGIN(IDBObjectStore, nsIIDBObjectStore)
DOM_CLASSINFO_MAP_ENTRY(nsIIDBObjectStore)
DOM_CLASSINFO_MAP_END

Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsDOMClassInfoClasses.h
Expand Up @@ -486,7 +486,7 @@ DOMCI_CLASS(IDBDatabase)
DOMCI_CLASS(IDBErrorEvent)
DOMCI_CLASS(IDBSuccessEvent)
DOMCI_CLASS(IDBTransactionEvent)
DOMCI_CLASS(IDBObjectStoreRequest)
DOMCI_CLASS(IDBObjectStore)
DOMCI_CLASS(IDBTransaction)
DOMCI_CLASS(IDBCursorRequest)
DOMCI_CLASS(IDBKeyRange)
Expand Down
2 changes: 1 addition & 1 deletion dom/indexedDB/DatabaseInfo.h
Expand Up @@ -43,7 +43,7 @@
// Only meant to be included in IndexedDB source files, not exported.
#include "IndexedDatabase.h"

#include "IDBObjectStoreRequest.h"
#include "IDBObjectStore.h"

BEGIN_INDEXEDDB_NAMESPACE

Expand Down
18 changes: 9 additions & 9 deletions dom/indexedDB/IDBCursorRequest.cpp
Expand Up @@ -58,7 +58,7 @@
#include "DatabaseInfo.h"
#include "IDBEvents.h"
#include "IDBIndexRequest.h"
#include "IDBObjectStoreRequest.h"
#include "IDBObjectStore.h"
#include "IDBTransaction.h"
#include "Savepoint.h"
#include "TransactionThreadPool.h"
Expand Down Expand Up @@ -143,7 +143,7 @@ END_INDEXEDDB_NAMESPACE
already_AddRefed<IDBCursorRequest>
IDBCursorRequest::Create(IDBRequest* aRequest,
IDBTransaction* aTransaction,
IDBObjectStoreRequest* aObjectStore,
IDBObjectStore* aObjectStore,
PRUint16 aDirection,
nsTArray<KeyValuePair>& aData)
{
Expand Down Expand Up @@ -420,7 +420,7 @@ IDBCursorRequest::Continue(nsIVariant* aKey,
}

Key key;
nsresult rv = IDBObjectStoreRequest::GetKeyFromVariant(aKey, key);
nsresult rv = IDBObjectStore::GetKeyFromVariant(aKey, key);
NS_ENSURE_SUCCESS(rv, rv);

if (key.IsNull()) {
Expand Down Expand Up @@ -571,9 +571,9 @@ IDBCursorRequest::Update(nsIVariant* aValue,
}

nsTArray<IndexUpdateInfo> indexUpdateInfo;
rv = IDBObjectStoreRequest::GetIndexUpdateInfo(mObjectStore->GetObjectStoreInfo(),
cx, clone.value(),
indexUpdateInfo);
rv = IDBObjectStore::GetIndexUpdateInfo(mObjectStore->GetObjectStoreInfo(),
cx, clone.value(),
indexUpdateInfo);
NS_ENSURE_SUCCESS(rv, rv);

nsCOMPtr<nsIJSON> json(new nsJSON());
Expand Down Expand Up @@ -671,9 +671,9 @@ UpdateHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
// Update our indexes if needed.
if (!mIndexUpdateInfo.IsEmpty()) {
PRInt64 objectDataId = mAutoIncrement ? mKey.IntValue() : LL_MININT;
rv = IDBObjectStoreRequest::UpdateIndexes(mTransaction, mOSID, mKey,
mAutoIncrement, true,
objectDataId, mIndexUpdateInfo);
rv = IDBObjectStore::UpdateIndexes(mTransaction, mOSID, mKey,
mAutoIncrement, true,
objectDataId, mIndexUpdateInfo);
if (rv == NS_ERROR_STORAGE_CONSTRAINT) {
return nsIIDBDatabaseException::CONSTRAINT_ERR;
}
Expand Down
8 changes: 4 additions & 4 deletions dom/indexedDB/IDBCursorRequest.h
Expand Up @@ -40,7 +40,7 @@
#ifndef mozilla_dom_indexeddb_idbcursorrequest_h__
#define mozilla_dom_indexeddb_idbcursorrequest_h__

#include "mozilla/dom/indexedDB/IDBObjectStoreRequest.h"
#include "mozilla/dom/indexedDB/IDBObjectStore.h"
#include "nsIIDBCursorRequest.h"

#include "jsapi.h"
Expand All @@ -51,7 +51,7 @@ BEGIN_INDEXEDDB_NAMESPACE

class IDBIndexRequest;
class IDBRequest;
class IDBObjectStoreRequest;
class IDBObjectStore;
class IDBTransaction;

struct KeyValuePair
Expand Down Expand Up @@ -82,7 +82,7 @@ class IDBCursorRequest : public IDBRequest::Generator,
already_AddRefed<IDBCursorRequest>
Create(IDBRequest* aRequest,
IDBTransaction* aTransaction,
IDBObjectStoreRequest* aObjectStore,
IDBObjectStore* aObjectStore,
PRUint16 aDirection,
nsTArray<KeyValuePair>& aData);

Expand Down Expand Up @@ -121,7 +121,7 @@ class IDBCursorRequest : public IDBRequest::Generator,

nsRefPtr<IDBRequest> mRequest;
nsRefPtr<IDBTransaction> mTransaction;
nsRefPtr<IDBObjectStoreRequest> mObjectStore;
nsRefPtr<IDBObjectStore> mObjectStore;
nsRefPtr<IDBIndexRequest> mIndex;

PRUint16 mDirection;
Expand Down
6 changes: 3 additions & 3 deletions dom/indexedDB/IDBDatabase.cpp
Expand Up @@ -49,7 +49,7 @@
#include "AsyncConnectionHelper.h"
#include "DatabaseInfo.h"
#include "IDBEvents.h"
#include "IDBObjectStoreRequest.h"
#include "IDBObjectStore.h"
#include "IDBTransaction.h"
#include "IDBFactory.h"
#include "LazyIdleThread.h"
Expand Down Expand Up @@ -625,7 +625,7 @@ NS_IMETHODIMP
IDBDatabase::ObjectStore(const nsAString& aName,
PRUint16 aMode,
PRUint8 aOptionalArgCount,
nsIIDBObjectStoreRequest** _retval)
nsIIDBObjectStore** _retval)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

Expand Down Expand Up @@ -767,7 +767,7 @@ CreateObjectStoreHelper::GetSuccessResult(nsIWritableVariant* aResult)
}
info.forget();

nsCOMPtr<nsIIDBObjectStoreRequest> result;
nsCOMPtr<nsIIDBObjectStore> result;
nsresult rv = mTransaction->ObjectStore(mName, getter_AddRefs(result));
NS_ENSURE_SUCCESS(rv, nsIIDBDatabaseException::UNKNOWN_ERR);

Expand Down
2 changes: 1 addition & 1 deletion dom/indexedDB/IDBEvents.h
Expand Up @@ -53,7 +53,7 @@
#include "jsapi.h"
#include "nsDOMEvent.h"

#include "mozilla/dom/indexedDB/IDBObjectStoreRequest.h"
#include "mozilla/dom/indexedDB/IDBObjectStore.h"

#define SUCCESS_EVT_STR "success"
#define ERROR_EVT_STR "error"
Expand Down
20 changes: 10 additions & 10 deletions dom/indexedDB/IDBIndexRequest.cpp
Expand Up @@ -50,7 +50,7 @@
#include "AsyncConnectionHelper.h"
#include "IDBCursorRequest.h"
#include "IDBEvents.h"
#include "IDBObjectStoreRequest.h"
#include "IDBObjectStore.h"
#include "IDBTransaction.h"
#include "DatabaseInfo.h"

Expand Down Expand Up @@ -227,7 +227,7 @@ class OpenObjectCursorHelper : public AsyncConnectionHelper

// static
already_AddRefed<IDBIndexRequest>
IDBIndexRequest::Create(IDBObjectStoreRequest* aObjectStore,
IDBIndexRequest::Create(IDBObjectStore* aObjectStore,
const IndexInfo* aIndexInfo)
{
NS_PRECONDITION(NS_IsMainThread(), "Wrong thread!");
Expand Down Expand Up @@ -315,7 +315,7 @@ IDBIndexRequest::Get(nsIVariant* aKey,
NS_WARNING("Using a slow path for Get! Fix this now!");

Key key;
nsresult rv = IDBObjectStoreRequest::GetKeyFromVariant(aKey, key);
nsresult rv = IDBObjectStore::GetKeyFromVariant(aKey, key);
NS_ENSURE_SUCCESS(rv, rv);

if (key.IsUnset() || key.IsNull()) {
Expand Down Expand Up @@ -344,7 +344,7 @@ IDBIndexRequest::GetObject(nsIVariant* aKey,
NS_WARNING("Using a slow path for Get! Fix this now!");

Key key;
nsresult rv = IDBObjectStoreRequest::GetKeyFromVariant(aKey, key);
nsresult rv = IDBObjectStore::GetKeyFromVariant(aKey, key);
NS_ENSURE_SUCCESS(rv, rv);

if (key.IsUnset() || key.IsNull()) {
Expand Down Expand Up @@ -373,7 +373,7 @@ IDBIndexRequest::GetAll(nsIVariant* aKey,
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

Key key;
nsresult rv = IDBObjectStoreRequest::GetKeyFromVariant(aKey, key);
nsresult rv = IDBObjectStore::GetKeyFromVariant(aKey, key);
NS_ENSURE_SUCCESS(rv, rv);

if (key.IsNull()) {
Expand Down Expand Up @@ -406,7 +406,7 @@ IDBIndexRequest::GetAllObjects(nsIVariant* aKey,
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

Key key;
nsresult rv = IDBObjectStoreRequest::GetKeyFromVariant(aKey, key);
nsresult rv = IDBObjectStore::GetKeyFromVariant(aKey, key);
NS_ENSURE_SUCCESS(rv, rv);

if (key.IsNull()) {
Expand Down Expand Up @@ -455,13 +455,13 @@ IDBIndexRequest::OpenCursor(nsIIDBKeyRange* aKeyRange,
rv = aKeyRange->GetLeft(getter_AddRefs(variant));
NS_ENSURE_SUCCESS(rv, rv);

rv = IDBObjectStoreRequest::GetKeyFromVariant(variant, leftKey);
rv = IDBObjectStore::GetKeyFromVariant(variant, leftKey);
NS_ENSURE_SUCCESS(rv, rv);

rv = aKeyRange->GetRight(getter_AddRefs(variant));
NS_ENSURE_SUCCESS(rv, rv);

rv = IDBObjectStoreRequest::GetKeyFromVariant(variant, rightKey);
rv = IDBObjectStore::GetKeyFromVariant(variant, rightKey);
NS_ENSURE_SUCCESS(rv, rv);
}

Expand Down Expand Up @@ -522,13 +522,13 @@ IDBIndexRequest::OpenObjectCursor(nsIIDBKeyRange* aKeyRange,
rv = aKeyRange->GetLeft(getter_AddRefs(variant));
NS_ENSURE_SUCCESS(rv, rv);

rv = IDBObjectStoreRequest::GetKeyFromVariant(variant, leftKey);
rv = IDBObjectStore::GetKeyFromVariant(variant, leftKey);
NS_ENSURE_SUCCESS(rv, rv);

rv = aKeyRange->GetRight(getter_AddRefs(variant));
NS_ENSURE_SUCCESS(rv, rv);

rv = IDBObjectStoreRequest::GetKeyFromVariant(variant, rightKey);
rv = IDBObjectStore::GetKeyFromVariant(variant, rightKey);
NS_ENSURE_SUCCESS(rv, rv);
}

Expand Down
8 changes: 4 additions & 4 deletions dom/indexedDB/IDBIndexRequest.h
Expand Up @@ -46,7 +46,7 @@

BEGIN_INDEXEDDB_NAMESPACE

class IDBObjectStoreRequest;
class IDBObjectStore;
struct IndexInfo;

class IDBIndexRequest : public IDBRequest::Generator,
Expand All @@ -58,10 +58,10 @@ class IDBIndexRequest : public IDBRequest::Generator,
NS_DECL_NSIIDBINDEXREQUEST

static already_AddRefed<IDBIndexRequest>
Create(IDBObjectStoreRequest* aObjectStore,
Create(IDBObjectStore* aObjectStore,
const IndexInfo* aIndexInfo);

IDBObjectStoreRequest* ObjectStore()
IDBObjectStore* ObjectStore()
{
return mObjectStore;
}
Expand All @@ -71,7 +71,7 @@ class IDBIndexRequest : public IDBRequest::Generator,
~IDBIndexRequest();

private:
nsRefPtr<IDBObjectStoreRequest> mObjectStore;
nsRefPtr<IDBObjectStore> mObjectStore;

PRInt64 mId;
nsString mName;
Expand Down

0 comments on commit ad8dc5e

Please sign in to comment.