зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 8 changesets (bug 1168606) for causing failures in DatabaseConnection::CachedStatement function. CLOSED TREE
Backed out changeset a5809ccdc7d2 (bug 1168606) Backed out changeset eff806e9615d (bug 1168606) Backed out changeset b9c38ead5e55 (bug 1168606) Backed out changeset 300dc3034eeb (bug 1168606) Backed out changeset d6aa1c5bc7d9 (bug 1168606) Backed out changeset 6e46dad972c8 (bug 1168606) Backed out changeset 07cafa88a5b1 (bug 1168606) Backed out changeset e72ef41a4a78 (bug 1168606)
This commit is contained in:
Родитель
6ca74fface
Коммит
de6499f0ba
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -58,9 +58,6 @@ class IDBCursor final : public nsISupports, public nsWrapperCache {
|
|||
|
||||
indexedDB::BackgroundCursorChild* mBackgroundActor;
|
||||
|
||||
// TODO: mRequest, mSourceObjectStore and mSourceIndex could be made const if
|
||||
// Bug 1575173 is resolved. They are initialized in the constructor and never
|
||||
// modified/cleared.
|
||||
RefPtr<IDBRequest> mRequest;
|
||||
RefPtr<IDBObjectStore> mSourceObjectStore;
|
||||
RefPtr<IDBIndex> mSourceIndex;
|
||||
|
|
|
@ -455,12 +455,24 @@ already_AddRefed<IDBRequest> IDBIndex::OpenCursorInternal(
|
|||
|
||||
IDBCursor::Direction direction = IDBCursor::ConvertDirection(aDirection);
|
||||
|
||||
const CommonIndexOpenCursorParams commonIndexParams = {
|
||||
{objectStoreId, std::move(optionalKeyRange), direction}, indexId};
|
||||
OpenCursorParams params;
|
||||
if (aKeysOnly) {
|
||||
IndexOpenKeyCursorParams openParams;
|
||||
openParams.objectStoreId() = objectStoreId;
|
||||
openParams.indexId() = indexId;
|
||||
openParams.optionalKeyRange() = std::move(optionalKeyRange);
|
||||
openParams.direction() = direction;
|
||||
|
||||
const auto params =
|
||||
aKeysOnly ? OpenCursorParams{IndexOpenKeyCursorParams{commonIndexParams}}
|
||||
: OpenCursorParams{IndexOpenCursorParams{commonIndexParams}};
|
||||
params = std::move(openParams);
|
||||
} else {
|
||||
IndexOpenCursorParams openParams;
|
||||
openParams.objectStoreId() = objectStoreId;
|
||||
openParams.indexId() = indexId;
|
||||
openParams.optionalKeyRange() = std::move(optionalKeyRange);
|
||||
openParams.direction() = direction;
|
||||
|
||||
params = std::move(openParams);
|
||||
}
|
||||
|
||||
RefPtr<IDBRequest> request = GenerateRequest(aCx, this);
|
||||
MOZ_ASSERT(request);
|
||||
|
|
|
@ -35,8 +35,6 @@ class KeyPath;
|
|||
} // namespace indexedDB
|
||||
|
||||
class IDBIndex final : public nsISupports, public nsWrapperCache {
|
||||
// TODO: This could be made const if Bug 1575173 is resolved. It is
|
||||
// initialized in the constructor and never modified/cleared.
|
||||
RefPtr<IDBObjectStore> mObjectStore;
|
||||
|
||||
JS::Heap<JS::Value> mCachedKeyPath;
|
||||
|
|
|
@ -2270,14 +2270,22 @@ already_AddRefed<IDBRequest> IDBObjectStore::OpenCursorInternal(
|
|||
|
||||
IDBCursor::Direction direction = IDBCursor::ConvertDirection(aDirection);
|
||||
|
||||
const CommonOpenCursorParams commonParams = {
|
||||
objectStoreId, std::move(optionalKeyRange), direction};
|
||||
OpenCursorParams params;
|
||||
if (aKeysOnly) {
|
||||
ObjectStoreOpenKeyCursorParams openParams;
|
||||
openParams.objectStoreId() = objectStoreId;
|
||||
openParams.optionalKeyRange() = std::move(optionalKeyRange);
|
||||
openParams.direction() = direction;
|
||||
|
||||
// TODO: It would be great if the IPDL generator created a constructor
|
||||
// accepting a CommonOpenCursorParams by value or rvalue reference.
|
||||
const auto params =
|
||||
aKeysOnly ? OpenCursorParams{ObjectStoreOpenKeyCursorParams{commonParams}}
|
||||
: OpenCursorParams{ObjectStoreOpenCursorParams{commonParams}};
|
||||
params = std::move(openParams);
|
||||
} else {
|
||||
ObjectStoreOpenCursorParams openParams;
|
||||
openParams.objectStoreId() = objectStoreId;
|
||||
openParams.optionalKeyRange() = std::move(optionalKeyRange);
|
||||
openParams.direction() = direction;
|
||||
|
||||
params = std::move(openParams);
|
||||
}
|
||||
|
||||
RefPtr<IDBRequest> request = GenerateRequest(aCx, this);
|
||||
MOZ_ASSERT(request);
|
||||
|
|
|
@ -54,8 +54,6 @@ class IDBObjectStore final : public nsISupports, public nsWrapperCache {
|
|||
|
||||
static const JSClass sDummyPropJSClass;
|
||||
|
||||
// TODO: This could be made const if Bug 1575173 is resolved. It is
|
||||
// initialized in the constructor and never modified/cleared.
|
||||
RefPtr<IDBTransaction> mTransaction;
|
||||
JS::Heap<JS::Value> mCachedKeyPath;
|
||||
|
||||
|
|
|
@ -124,43 +124,36 @@ struct ObjectStoreSpec
|
|||
IndexMetadata[] indexes;
|
||||
};
|
||||
|
||||
struct CommonOpenCursorParams
|
||||
struct ObjectStoreOpenCursorParams
|
||||
{
|
||||
int64_t objectStoreId;
|
||||
SerializedKeyRange? optionalKeyRange;
|
||||
Direction direction;
|
||||
};
|
||||
|
||||
struct ObjectStoreOpenCursorParams
|
||||
{
|
||||
CommonOpenCursorParams commonParams;
|
||||
};
|
||||
|
||||
struct ObjectStoreOpenKeyCursorParams
|
||||
{
|
||||
CommonOpenCursorParams commonParams;
|
||||
};
|
||||
|
||||
struct CommonIndexOpenCursorParams
|
||||
{
|
||||
CommonOpenCursorParams commonParams;
|
||||
int64_t indexId;
|
||||
int64_t objectStoreId;
|
||||
SerializedKeyRange? optionalKeyRange;
|
||||
Direction direction;
|
||||
};
|
||||
|
||||
struct IndexOpenCursorParams
|
||||
{
|
||||
CommonIndexOpenCursorParams commonIndexParams;
|
||||
int64_t objectStoreId;
|
||||
int64_t indexId;
|
||||
SerializedKeyRange? optionalKeyRange;
|
||||
Direction direction;
|
||||
};
|
||||
|
||||
struct IndexOpenKeyCursorParams
|
||||
{
|
||||
CommonIndexOpenCursorParams commonIndexParams;
|
||||
int64_t objectStoreId;
|
||||
int64_t indexId;
|
||||
SerializedKeyRange? optionalKeyRange;
|
||||
Direction direction;
|
||||
};
|
||||
|
||||
// TODO: Actually, using a union here is not very nice, unless IPDL supported
|
||||
// struct inheritance. Alternatively, if IPDL supported enums, we could merge
|
||||
// the subtypes into one. Using a plain integer for discriminating the
|
||||
// subtypes would be too error-prone.
|
||||
union OpenCursorParams
|
||||
{
|
||||
ObjectStoreOpenCursorParams;
|
||||
|
|
Загрузка…
Ссылка в новой задаче