mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1535397 - Part 4 - use native Maybe syntax in place of NullableVersion in IDPL; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D23561 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
e226477611
commit
d3444f6ef7
@ -2053,7 +2053,7 @@ bool BackgroundDatabaseChild::DeallocPBackgroundMutableFileChild(
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult BackgroundDatabaseChild::RecvVersionChange(
|
||||
const uint64_t& aOldVersion, const NullableVersion& aNewVersion) {
|
||||
const uint64_t& aOldVersion, const Maybe<uint64_t>& aNewVersion) {
|
||||
AssertIsOnOwningThread();
|
||||
|
||||
MaybeCollectGarbageOnIPCMessage();
|
||||
@ -2092,21 +2092,14 @@ mozilla::ipc::IPCResult BackgroundDatabaseChild::RecvVersionChange(
|
||||
|
||||
RefPtr<Event> versionChangeEvent;
|
||||
|
||||
switch (aNewVersion.type()) {
|
||||
case NullableVersion::Tnull_t:
|
||||
versionChangeEvent =
|
||||
IDBVersionChangeEvent::Create(kungFuDeathGrip, type, aOldVersion);
|
||||
MOZ_ASSERT(versionChangeEvent);
|
||||
break;
|
||||
|
||||
case NullableVersion::Tuint64_t:
|
||||
versionChangeEvent = IDBVersionChangeEvent::Create(
|
||||
kungFuDeathGrip, type, aOldVersion, aNewVersion.get_uint64_t());
|
||||
MOZ_ASSERT(versionChangeEvent);
|
||||
break;
|
||||
|
||||
default:
|
||||
MOZ_CRASH("Should never get here!");
|
||||
if (aNewVersion.isNothing()) {
|
||||
versionChangeEvent =
|
||||
IDBVersionChangeEvent::Create(kungFuDeathGrip, type, aOldVersion);
|
||||
MOZ_ASSERT(versionChangeEvent);
|
||||
} else {
|
||||
versionChangeEvent = IDBVersionChangeEvent::Create(
|
||||
kungFuDeathGrip, type, aOldVersion, aNewVersion.value());
|
||||
MOZ_ASSERT(versionChangeEvent);
|
||||
}
|
||||
|
||||
IDB_LOG_MARK("IndexedDB %s: Child : Firing \"versionchange\" event",
|
||||
|
@ -351,7 +351,7 @@ class BackgroundDatabaseChild final : public PBackgroundIDBDatabaseChild {
|
||||
PBackgroundMutableFileChild* aActor) override;
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvVersionChange(
|
||||
const uint64_t& aOldVersion, const NullableVersion& aNewVersion) override;
|
||||
const uint64_t& aOldVersion, const Maybe<uint64_t>& aNewVersion) override;
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvInvalidate() override;
|
||||
|
||||
|
@ -6600,7 +6600,7 @@ class FactoryOp : public DatabaseOperationBase,
|
||||
nsresult SendVersionChangeMessages(DatabaseActorInfo* aDatabaseActorInfo,
|
||||
Database* aOpeningDatabase,
|
||||
uint64_t aOldVersion,
|
||||
const NullableVersion& aNewVersion);
|
||||
const Maybe<uint64_t>& aNewVersion);
|
||||
|
||||
// Methods that subclasses must implement.
|
||||
virtual nsresult DatabaseOpen() = 0;
|
||||
@ -19394,7 +19394,7 @@ nsresult FactoryOp::CheckPermission(
|
||||
|
||||
nsresult FactoryOp::SendVersionChangeMessages(
|
||||
DatabaseActorInfo* aDatabaseActorInfo, Database* aOpeningDatabase,
|
||||
uint64_t aOldVersion, const NullableVersion& aNewVersion) {
|
||||
uint64_t aOldVersion, const Maybe<uint64_t>& aNewVersion) {
|
||||
AssertIsOnOwningThread();
|
||||
MOZ_ASSERT(aDatabaseActorInfo);
|
||||
MOZ_ASSERT(mState == State::BeginVersionChange);
|
||||
@ -20426,7 +20426,7 @@ nsresult OpenDatabaseOp::BeginVersionChange() {
|
||||
MOZ_ASSERT(info->mMetadata != mMetadata);
|
||||
mMetadata = info->mMetadata;
|
||||
|
||||
NullableVersion newVersion = mRequestedVersion;
|
||||
Maybe<uint64_t> newVersion = Some(mRequestedVersion);
|
||||
|
||||
nsresult rv = SendVersionChangeMessages(
|
||||
info, mDatabase, mMetadata->mCommonMetadata.version(), newVersion);
|
||||
@ -21185,10 +21185,8 @@ nsresult DeleteDatabaseOp::BeginVersionChange() {
|
||||
if (gLiveDatabaseHashtable->Get(mDatabaseId, &info)) {
|
||||
MOZ_ASSERT(!info->mWaitingFactoryOp);
|
||||
|
||||
NullableVersion newVersion = null_t();
|
||||
|
||||
nsresult rv =
|
||||
SendVersionChangeMessages(info, nullptr, mPreviousVersion, newVersion);
|
||||
SendVersionChangeMessages(info, nullptr, mPreviousVersion, Nothing());
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -40,12 +40,6 @@ union DatabaseRequestParams
|
||||
CreateFileParams;
|
||||
};
|
||||
|
||||
union NullableVersion
|
||||
{
|
||||
null_t;
|
||||
uint64_t;
|
||||
};
|
||||
|
||||
sync protocol PBackgroundIDBDatabase
|
||||
{
|
||||
manager PBackgroundIDBFactory;
|
||||
@ -72,7 +66,7 @@ parent:
|
||||
child:
|
||||
async __delete__();
|
||||
|
||||
async VersionChange(uint64_t oldVersion, NullableVersion newVersion);
|
||||
async VersionChange(uint64_t oldVersion, uint64_t? newVersion);
|
||||
|
||||
async Invalidate();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user