Backed out 8 changesets (bug 1168606) for failures in idbcursor-continuePrimaryKey.htm

Backed out changeset 066bee573945 (bug 1168606)
Backed out changeset 1485cea56f41 (bug 1168606)
Backed out changeset 4858e4e132de (bug 1168606)
Backed out changeset 5be5a3bf0499 (bug 1168606)
Backed out changeset 6078d5a9c010 (bug 1168606)
Backed out changeset f5aee1ae7282 (bug 1168606)
Backed out changeset acae76cea927 (bug 1168606)
Backed out changeset 0133605c6169 (bug 1168606)

--HG--
extra : rebase_source : 27477feb2e52f4149ede2fe5db9d86b5e322046d
This commit is contained in:
Mihai Alexandru Michis 2019-09-11 14:36:57 +03:00
Родитель d5fbc7aac4
Коммит b5c83385d6
7 изменённых файлов: 1237 добавлений и 962 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -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;