зеркало из 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;
|
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<IDBRequest> mRequest;
|
||||||
RefPtr<IDBObjectStore> mSourceObjectStore;
|
RefPtr<IDBObjectStore> mSourceObjectStore;
|
||||||
RefPtr<IDBIndex> mSourceIndex;
|
RefPtr<IDBIndex> mSourceIndex;
|
||||||
|
|
|
@ -455,12 +455,24 @@ already_AddRefed<IDBRequest> IDBIndex::OpenCursorInternal(
|
||||||
|
|
||||||
IDBCursor::Direction direction = IDBCursor::ConvertDirection(aDirection);
|
IDBCursor::Direction direction = IDBCursor::ConvertDirection(aDirection);
|
||||||
|
|
||||||
const CommonIndexOpenCursorParams commonIndexParams = {
|
OpenCursorParams params;
|
||||||
{objectStoreId, std::move(optionalKeyRange), direction}, indexId};
|
if (aKeysOnly) {
|
||||||
|
IndexOpenKeyCursorParams openParams;
|
||||||
|
openParams.objectStoreId() = objectStoreId;
|
||||||
|
openParams.indexId() = indexId;
|
||||||
|
openParams.optionalKeyRange() = std::move(optionalKeyRange);
|
||||||
|
openParams.direction() = direction;
|
||||||
|
|
||||||
const auto params =
|
params = std::move(openParams);
|
||||||
aKeysOnly ? OpenCursorParams{IndexOpenKeyCursorParams{commonIndexParams}}
|
} else {
|
||||||
: OpenCursorParams{IndexOpenCursorParams{commonIndexParams}};
|
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);
|
RefPtr<IDBRequest> request = GenerateRequest(aCx, this);
|
||||||
MOZ_ASSERT(request);
|
MOZ_ASSERT(request);
|
||||||
|
|
|
@ -35,8 +35,6 @@ class KeyPath;
|
||||||
} // namespace indexedDB
|
} // namespace indexedDB
|
||||||
|
|
||||||
class IDBIndex final : public nsISupports, public nsWrapperCache {
|
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;
|
RefPtr<IDBObjectStore> mObjectStore;
|
||||||
|
|
||||||
JS::Heap<JS::Value> mCachedKeyPath;
|
JS::Heap<JS::Value> mCachedKeyPath;
|
||||||
|
|
|
@ -2270,14 +2270,22 @@ already_AddRefed<IDBRequest> IDBObjectStore::OpenCursorInternal(
|
||||||
|
|
||||||
IDBCursor::Direction direction = IDBCursor::ConvertDirection(aDirection);
|
IDBCursor::Direction direction = IDBCursor::ConvertDirection(aDirection);
|
||||||
|
|
||||||
const CommonOpenCursorParams commonParams = {
|
OpenCursorParams params;
|
||||||
objectStoreId, std::move(optionalKeyRange), direction};
|
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
|
params = std::move(openParams);
|
||||||
// accepting a CommonOpenCursorParams by value or rvalue reference.
|
} else {
|
||||||
const auto params =
|
ObjectStoreOpenCursorParams openParams;
|
||||||
aKeysOnly ? OpenCursorParams{ObjectStoreOpenKeyCursorParams{commonParams}}
|
openParams.objectStoreId() = objectStoreId;
|
||||||
: OpenCursorParams{ObjectStoreOpenCursorParams{commonParams}};
|
openParams.optionalKeyRange() = std::move(optionalKeyRange);
|
||||||
|
openParams.direction() = direction;
|
||||||
|
|
||||||
|
params = std::move(openParams);
|
||||||
|
}
|
||||||
|
|
||||||
RefPtr<IDBRequest> request = GenerateRequest(aCx, this);
|
RefPtr<IDBRequest> request = GenerateRequest(aCx, this);
|
||||||
MOZ_ASSERT(request);
|
MOZ_ASSERT(request);
|
||||||
|
|
|
@ -54,8 +54,6 @@ class IDBObjectStore final : public nsISupports, public nsWrapperCache {
|
||||||
|
|
||||||
static const JSClass sDummyPropJSClass;
|
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;
|
RefPtr<IDBTransaction> mTransaction;
|
||||||
JS::Heap<JS::Value> mCachedKeyPath;
|
JS::Heap<JS::Value> mCachedKeyPath;
|
||||||
|
|
||||||
|
|
|
@ -124,43 +124,36 @@ struct ObjectStoreSpec
|
||||||
IndexMetadata[] indexes;
|
IndexMetadata[] indexes;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CommonOpenCursorParams
|
struct ObjectStoreOpenCursorParams
|
||||||
{
|
{
|
||||||
int64_t objectStoreId;
|
int64_t objectStoreId;
|
||||||
SerializedKeyRange? optionalKeyRange;
|
SerializedKeyRange? optionalKeyRange;
|
||||||
Direction direction;
|
Direction direction;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ObjectStoreOpenCursorParams
|
|
||||||
{
|
|
||||||
CommonOpenCursorParams commonParams;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ObjectStoreOpenKeyCursorParams
|
struct ObjectStoreOpenKeyCursorParams
|
||||||
{
|
{
|
||||||
CommonOpenCursorParams commonParams;
|
int64_t objectStoreId;
|
||||||
};
|
SerializedKeyRange? optionalKeyRange;
|
||||||
|
Direction direction;
|
||||||
struct CommonIndexOpenCursorParams
|
|
||||||
{
|
|
||||||
CommonOpenCursorParams commonParams;
|
|
||||||
int64_t indexId;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IndexOpenCursorParams
|
struct IndexOpenCursorParams
|
||||||
{
|
{
|
||||||
CommonIndexOpenCursorParams commonIndexParams;
|
int64_t objectStoreId;
|
||||||
|
int64_t indexId;
|
||||||
|
SerializedKeyRange? optionalKeyRange;
|
||||||
|
Direction direction;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IndexOpenKeyCursorParams
|
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
|
union OpenCursorParams
|
||||||
{
|
{
|
||||||
ObjectStoreOpenCursorParams;
|
ObjectStoreOpenCursorParams;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче