Bug 1184667 - Remove some unnecessary const_casts from ActorsParent.cpp. r=janv

This commit is contained in:
Reuben Morais 2015-08-05 15:25:14 -03:00
parent b9e8388b3d
commit fd3e71878e

View File

@ -6723,7 +6723,7 @@ class OpenDatabaseOp final
class VersionChangeOp;
const OptionalContentId mOptionalContentParentId;
OptionalContentId mOptionalContentParentId;
nsRefPtr<FullDatabaseMetadata> mMetadata;
@ -7239,7 +7239,7 @@ class ObjectStoreAddOrPutRequestOp final
const nsCString mOrigin;
const PersistenceType mPersistenceType;
const bool mOverwrite;
const bool mObjectStoreMayHaveIndexes;
bool mObjectStoreMayHaveIndexes;
private:
// Only created by TransactionBase.
@ -7357,7 +7357,7 @@ class ObjectStoreDeleteRequestOp final
const ObjectStoreDeleteParams mParams;
ObjectStoreDeleteResponse mResponse;
const bool mObjectStoreMayHaveIndexes;
bool mObjectStoreMayHaveIndexes;
private:
ObjectStoreDeleteRequestOp(TransactionBase* aTransaction,
@ -7383,7 +7383,7 @@ class ObjectStoreClearRequestOp final
const ObjectStoreClearParams mParams;
ObjectStoreClearResponse mResponse;
const bool mObjectStoreMayHaveIndexes;
bool mObjectStoreMayHaveIndexes;
private:
ObjectStoreClearRequestOp(TransactionBase* aTransaction,
@ -18790,15 +18790,12 @@ OpenDatabaseOp::OpenDatabaseOp(Factory* aFactory,
, mVersionChangeOp(nullptr)
, mTelemetryId(0)
{
auto& optionalContentParentId =
const_cast<OptionalContentId&>(mOptionalContentParentId);
if (mContentParent) {
// This is a little scary but it looks safe to call this off the main thread
// for now.
optionalContentParentId = mContentParent->ChildID();
mOptionalContentParentId = mContentParent->ChildID();
} else {
optionalContentParentId = void_t();
mOptionalContentParentId = void_t();
}
}
@ -22634,7 +22631,7 @@ ObjectStoreAddOrPutRequestOp::ObjectStoreAddOrPutRequestOp(
aTransaction->GetMetadataForObjectStoreId(mParams.objectStoreId());
MOZ_ASSERT(mMetadata);
const_cast<bool&>(mObjectStoreMayHaveIndexes) = mMetadata->HasLiveIndexes();
mObjectStoreMayHaveIndexes = mMetadata->HasLiveIndexes();
}
nsresult
@ -23565,7 +23562,7 @@ ObjectStoreDeleteRequestOp::ObjectStoreDeleteRequestOp(
aTransaction->GetMetadataForObjectStoreId(mParams.objectStoreId());
MOZ_ASSERT(metadata);
const_cast<bool&>(mObjectStoreMayHaveIndexes) = metadata->HasLiveIndexes();
mObjectStoreMayHaveIndexes = metadata->HasLiveIndexes();
}
nsresult
@ -23657,7 +23654,7 @@ ObjectStoreClearRequestOp::ObjectStoreClearRequestOp(
aTransaction->GetMetadataForObjectStoreId(mParams.objectStoreId());
MOZ_ASSERT(metadata);
const_cast<bool&>(mObjectStoreMayHaveIndexes) = metadata->HasLiveIndexes();
mObjectStoreMayHaveIndexes = metadata->HasLiveIndexes();
}
nsresult