Bug 761635 - Fix build in MSVC 8; r=khuey

This commit is contained in:
Ms2ger 2012-06-10 19:19:12 +02:00
parent eeae34a2b5
commit 0170d19adc
4 changed files with 88 additions and 90 deletions

View File

@ -29,6 +29,7 @@
#include "IndexedDatabaseInlines.h"
USING_INDEXEDDB_NAMESPACE
using namespace mozilla::dom::indexedDB::ipc;
MOZ_STATIC_ASSERT(sizeof(size_t) >= sizeof(IDBCursor::Direction),
"Relying on conversion between size_t and "
@ -39,8 +40,6 @@ namespace {
class CursorHelper : public AsyncConnectionHelper
{
public:
typedef ipc::CursorRequestParams CursorRequestParams;
CursorHelper(IDBCursor* aCursor)
: AsyncConnectionHelper(aCursor->Transaction(), aCursor->Request()),
mCursor(aCursor), mActor(nsnull)
@ -889,7 +888,7 @@ ContinueHelper::GetSuccessResult(JSContext* aCx,
nsresult
ContinueHelper::PackArgumentsForParentProcess(CursorRequestParams& aParams)
{
ipc::ContinueParams params;
ContinueParams params;
params.key() = mCursor->mContinueToKey;
params.count() = uint32_t(mCount);
@ -914,12 +913,12 @@ ContinueHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Error;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::ContinueResponse continueResponse;
ContinueResponse continueResponse;
continueResponse.key() = mKey;
continueResponse.objectKey() = mObjectKey;
continueResponse.cloneInfo() = mCloneReadInfo;
@ -942,7 +941,7 @@ ContinueHelper::UnpackResponseFromParentProcess(
NS_ASSERTION(aResponseValue.type() == ResponseValue::TContinueResponse,
"Bad response type!");
const ipc::ContinueResponse& response = aResponseValue.get_ContinueResponse();
const ContinueResponse& response = aResponseValue.get_ContinueResponse();
mKey = response.key();
mObjectKey = response.objectKey();

View File

@ -31,14 +31,13 @@
#include "IndexedDatabaseInlines.h"
USING_INDEXEDDB_NAMESPACE
using namespace mozilla::dom::indexedDB::ipc;
namespace {
class IndexHelper : public AsyncConnectionHelper
{
public:
typedef ipc::IndexRequestParams IndexRequestParams;
IndexHelper(IDBTransaction* aTransaction,
IDBRequest* aRequest,
IDBIndex* aIndex)
@ -374,15 +373,15 @@ IDBIndex::Create(IDBObjectStore* aObjectStore,
nsAutoPtr<IndexedDBIndexChild> actor(new IndexedDBIndexChild(index));
ipc::IndexConstructorParams params;
IndexConstructorParams params;
if (aCreating) {
ipc::CreateIndexParams createParams;
CreateIndexParams createParams;
createParams.info() = *aIndexInfo;
params = createParams;
}
else {
ipc::GetIndexParams getParams;
GetIndexParams getParams;
getParams.name() = aIndexInfo->name;
params = getParams;
}
@ -1081,7 +1080,7 @@ GetKeyHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
NS_ASSERTION(mKeyRange, "This should never be null!");
ipc::GetKeyParams params;
GetKeyParams params;
mKeyRange->ToSerializedKeyRange(params.keyRange());
@ -1100,12 +1099,12 @@ GetKeyHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::GetKeyResponse getKeyResponse;
GetKeyResponse getKeyResponse;
getKeyResponse.key() = mKey;
response = getKeyResponse;
}
@ -1203,7 +1202,7 @@ GetHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
NS_ASSERTION(mKeyRange, "This should never be null!");
ipc::FIXME_Bug_521898_index::GetParams params;
FIXME_Bug_521898_index::GetParams params;
mKeyRange->ToSerializedKeyRange(params.keyRange());
@ -1227,14 +1226,14 @@ GetHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Error;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
SerializedStructuredCloneReadInfo readInfo;
readInfo = mCloneReadInfo;
ipc::GetResponse getResponse = readInfo;
GetResponse getResponse = readInfo;
response = getResponse;
}
@ -1377,10 +1376,10 @@ GetAllKeysHelper::GetSuccessResult(JSContext* aCx,
nsresult
GetAllKeysHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
ipc::GetAllKeysParams params;
GetAllKeysParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_index::KeyRange keyRange;
FIXME_Bug_521898_index::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -1405,12 +1404,12 @@ GetAllKeysHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::GetAllKeysResponse getAllKeysResponse;
GetAllKeysResponse getAllKeysResponse;
getAllKeysResponse.keys().AppendElements(mKeys);
response = getAllKeysResponse;
}
@ -1525,10 +1524,10 @@ GetAllHelper::ReleaseMainThreadObjects()
nsresult
GetAllHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
ipc::FIXME_Bug_521898_index::GetAllParams params;
FIXME_Bug_521898_index::GetAllParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_index::KeyRange keyRange;
FIXME_Bug_521898_index::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -1560,12 +1559,12 @@ GetAllHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
}
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::GetAllResponse getAllResponse;
GetAllResponse getAllResponse;
InfallibleTArray<SerializedStructuredCloneReadInfo>& infos =
getAllResponse.cloneInfos();
@ -1821,10 +1820,10 @@ OpenKeyCursorHelper::ReleaseMainThreadObjects()
nsresult
OpenKeyCursorHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
ipc::OpenKeyCursorParams params;
OpenKeyCursorParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_index::KeyRange keyRange;
FIXME_Bug_521898_index::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -1859,12 +1858,12 @@ OpenKeyCursorHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
}
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::OpenCursorResponse openCursorResponse;
OpenCursorResponse openCursorResponse;
if (!mCursor) {
openCursorResponse = mozilla::void_t();
@ -1876,7 +1875,7 @@ OpenKeyCursorHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
IndexedDBRequestParentBase* requestActor = mRequest->GetActorParent();
NS_ASSERTION(requestActor, "Must have an actor here!");
ipc::IndexCursorConstructorParams params;
IndexCursorConstructorParams params;
params.requestParent() = requestActor;
params.direction() = mDirection;
params.key() = mKey;
@ -1909,20 +1908,20 @@ OpenKeyCursorHelper::UnpackResponseFromParentProcess(
NS_ASSERTION(aResponseValue.type() == ResponseValue::TOpenCursorResponse,
"Bad response type!");
NS_ASSERTION(aResponseValue.get_OpenCursorResponse().type() ==
ipc::OpenCursorResponse::Tvoid_t ||
OpenCursorResponse::Tvoid_t ||
aResponseValue.get_OpenCursorResponse().type() ==
ipc::OpenCursorResponse::TPIndexedDBCursorChild,
OpenCursorResponse::TPIndexedDBCursorChild,
"Bad response union type!");
NS_ASSERTION(!mCursor, "Shouldn't have this yet!");
const ipc::OpenCursorResponse& response =
const OpenCursorResponse& response =
aResponseValue.get_OpenCursorResponse();
switch (response.type()) {
case ipc::OpenCursorResponse::Tvoid_t:
case OpenCursorResponse::Tvoid_t:
break;
case ipc::OpenCursorResponse::TPIndexedDBCursorChild: {
case OpenCursorResponse::TPIndexedDBCursorChild: {
IndexedDBCursorChild* actor =
static_cast<IndexedDBCursorChild*>(
response.get_PIndexedDBCursorChild());
@ -2157,10 +2156,10 @@ OpenCursorHelper::ReleaseMainThreadObjects()
nsresult
OpenCursorHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
ipc::FIXME_Bug_521898_index::OpenCursorParams params;
FIXME_Bug_521898_index::OpenCursorParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_index::KeyRange keyRange;
FIXME_Bug_521898_index::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -2200,12 +2199,12 @@ OpenCursorHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
}
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::OpenCursorResponse openCursorResponse;
OpenCursorResponse openCursorResponse;
if (!mCursor) {
openCursorResponse = mozilla::void_t();
@ -2221,7 +2220,7 @@ OpenCursorHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
mSerializedCloneReadInfo.dataLength,
"Shouldn't be possible!");
ipc::IndexCursorConstructorParams params;
IndexCursorConstructorParams params;
params.requestParent() = requestActor;
params.direction() = mDirection;
params.key() = mKey;
@ -2328,10 +2327,10 @@ CountHelper::ReleaseMainThreadObjects()
nsresult
CountHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
ipc::FIXME_Bug_521898_index::CountParams params;
FIXME_Bug_521898_index::CountParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_index::KeyRange keyRange;
FIXME_Bug_521898_index::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -2354,12 +2353,12 @@ CountHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::CountResponse countResponse = mCount;
CountResponse countResponse = mCount;
response = countResponse;
}

View File

@ -21,6 +21,7 @@
#include "mozilla/dom/indexedDB/PIndexedDBObjectStore.h"
USING_INDEXEDDB_NAMESPACE
using namespace mozilla::dom::indexedDB::ipc;
namespace {
@ -419,17 +420,17 @@ IDBKeyRange::GetUpperOpen(bool* aUpperOpen)
// Explicitly instantiate for all our key range types... Grumble.
template already_AddRefed<IDBKeyRange>
IDBKeyRange::FromSerializedKeyRange<ipc::FIXME_Bug_521898_objectstore::KeyRange>
(const ipc::FIXME_Bug_521898_objectstore::KeyRange& aKeyRange);
IDBKeyRange::FromSerializedKeyRange<FIXME_Bug_521898_objectstore::KeyRange>
(const FIXME_Bug_521898_objectstore::KeyRange& aKeyRange);
template already_AddRefed<IDBKeyRange>
IDBKeyRange::FromSerializedKeyRange<ipc::FIXME_Bug_521898_index::KeyRange>
(const ipc::FIXME_Bug_521898_index::KeyRange& aKeyRange);
IDBKeyRange::FromSerializedKeyRange<FIXME_Bug_521898_index::KeyRange>
(const FIXME_Bug_521898_index::KeyRange& aKeyRange);
template void
IDBKeyRange::ToSerializedKeyRange<ipc::FIXME_Bug_521898_objectstore::KeyRange>
(ipc::FIXME_Bug_521898_objectstore::KeyRange& aKeyRange);
IDBKeyRange::ToSerializedKeyRange<FIXME_Bug_521898_objectstore::KeyRange>
(FIXME_Bug_521898_objectstore::KeyRange& aKeyRange);
template void
IDBKeyRange::ToSerializedKeyRange<ipc::FIXME_Bug_521898_index::KeyRange>
(ipc::FIXME_Bug_521898_index::KeyRange& aKeyRange);
IDBKeyRange::ToSerializedKeyRange<FIXME_Bug_521898_index::KeyRange>
(FIXME_Bug_521898_index::KeyRange& aKeyRange);

View File

@ -46,14 +46,13 @@
#define FILE_COPY_BUFFER_SIZE 32768
USING_INDEXEDDB_NAMESPACE
using namespace mozilla::dom::indexedDB::ipc;
namespace {
class ObjectStoreHelper : public AsyncConnectionHelper
{
public:
typedef ipc::ObjectStoreRequestParams ObjectStoreRequestParams;
ObjectStoreHelper(IDBTransaction* aTransaction,
IDBRequest* aRequest,
IDBObjectStore* aObjectStore)
@ -677,15 +676,15 @@ IDBObjectStore::Create(IDBTransaction* aTransaction,
IndexedDBTransactionChild* transactionActor = aTransaction->GetActorChild();
NS_ASSERTION(transactionActor, "Must have an actor here!");
ipc::ObjectStoreConstructorParams params;
ObjectStoreConstructorParams params;
if (aCreating) {
ipc::CreateObjectStoreParams createParams;
CreateObjectStoreParams createParams;
createParams.info() = *aStoreInfo;
params = createParams;
}
else {
ipc::GetObjectStoreParams getParams;
GetObjectStoreParams getParams;
getParams.name() = aStoreInfo->name;
params = getParams;
}
@ -2779,18 +2778,18 @@ AddHelper::ReleaseMainThreadObjects()
nsresult
AddHelper::PackArgumentsForParentProcess(ObjectStoreRequestParams& aParams)
{
ipc::AddPutParams commonParams;
AddPutParams commonParams;
commonParams.cloneInfo() = mCloneWriteInfo;
commonParams.key() = mKey;
commonParams.indexUpdateInfos().AppendElements(mIndexUpdateInfo);
if (mOverwrite) {
ipc::PutParams putParams;
PutParams putParams;
putParams.commonParams() = commonParams;
aParams = putParams;
}
else {
ipc::AddParams addParams;
AddParams addParams;
addParams.commonParams() = commonParams;
aParams = addParams;
}
@ -2809,17 +2808,17 @@ AddHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else if (mOverwrite) {
ipc::PutResponse putResponse;
PutResponse putResponse;
putResponse.key() = mKey;
response = putResponse;
}
else {
ipc::AddResponse addResponse;
AddResponse addResponse;
addResponse.key() = mKey;
response = addResponse;
}
@ -2909,7 +2908,7 @@ GetHelper::PackArgumentsForParentProcess(ObjectStoreRequestParams& aParams)
{
NS_ASSERTION(mKeyRange, "This should never be null!");
ipc::FIXME_Bug_521898_objectstore::GetParams params;
FIXME_Bug_521898_objectstore::GetParams params;
mKeyRange->ToSerializedKeyRange(params.keyRange());
@ -2933,14 +2932,14 @@ GetHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Error;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
SerializedStructuredCloneReadInfo readInfo;
readInfo = mCloneReadInfo;
ipc::GetResponse getResponse = readInfo;
GetResponse getResponse = readInfo;
response = getResponse;
}
@ -3017,7 +3016,7 @@ DeleteHelper::PackArgumentsForParentProcess(ObjectStoreRequestParams& aParams)
{
NS_ASSERTION(mKeyRange, "This should never be null!");
ipc::DeleteParams params;
DeleteParams params;
mKeyRange->ToSerializedKeyRange(params.keyRange());
@ -3036,12 +3035,12 @@ DeleteHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
response = ipc::DeleteResponse();
response = DeleteResponse();
}
if (!actor->Send__delete__(actor, response)) {
@ -3087,7 +3086,7 @@ ClearHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
nsresult
ClearHelper::PackArgumentsForParentProcess(ObjectStoreRequestParams& aParams)
{
aParams = ipc::ClearParams();
aParams = ClearParams();
return NS_OK;
}
@ -3102,12 +3101,12 @@ ClearHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
response = ipc::ClearResponse();
response = ClearResponse();
}
if (!actor->Send__delete__(actor, response)) {
@ -3309,10 +3308,10 @@ nsresult
OpenCursorHelper::PackArgumentsForParentProcess(
ObjectStoreRequestParams& aParams)
{
ipc::FIXME_Bug_521898_objectstore::OpenCursorParams params;
FIXME_Bug_521898_objectstore::OpenCursorParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_objectstore::KeyRange keyRange;
FIXME_Bug_521898_objectstore::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -3352,12 +3351,12 @@ OpenCursorHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
}
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::OpenCursorResponse openCursorResponse;
OpenCursorResponse openCursorResponse;
if (!mCursor) {
openCursorResponse = mozilla::void_t();
@ -3374,7 +3373,7 @@ OpenCursorHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
mSerializedCloneReadInfo.dataLength,
"Shouldn't be possible!");
ipc::ObjectStoreCursorConstructorParams params;
ObjectStoreCursorConstructorParams params;
params.requestParent() = requestActor;
params.direction() = mDirection;
params.key() = mKey;
@ -3407,20 +3406,20 @@ OpenCursorHelper::UnpackResponseFromParentProcess(
NS_ASSERTION(aResponseValue.type() == ResponseValue::TOpenCursorResponse,
"Bad response type!");
NS_ASSERTION(aResponseValue.get_OpenCursorResponse().type() ==
ipc::OpenCursorResponse::Tvoid_t ||
OpenCursorResponse::Tvoid_t ||
aResponseValue.get_OpenCursorResponse().type() ==
ipc::OpenCursorResponse::TPIndexedDBCursorChild,
OpenCursorResponse::TPIndexedDBCursorChild,
"Bad response union type!");
NS_ASSERTION(!mCursor, "Shouldn't have this yet!");
const ipc::OpenCursorResponse& response =
const OpenCursorResponse& response =
aResponseValue.get_OpenCursorResponse();
switch (response.type()) {
case ipc::OpenCursorResponse::Tvoid_t:
case OpenCursorResponse::Tvoid_t:
break;
case ipc::OpenCursorResponse::TPIndexedDBCursorChild: {
case OpenCursorResponse::TPIndexedDBCursorChild: {
IndexedDBCursorChild* actor =
static_cast<IndexedDBCursorChild*>(
response.get_PIndexedDBCursorChild());
@ -3750,10 +3749,10 @@ GetAllHelper::ReleaseMainThreadObjects()
nsresult
GetAllHelper::PackArgumentsForParentProcess(ObjectStoreRequestParams& aParams)
{
ipc::FIXME_Bug_521898_objectstore::GetAllParams params;
FIXME_Bug_521898_objectstore::GetAllParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_objectstore::KeyRange keyRange;
FIXME_Bug_521898_objectstore::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -3785,12 +3784,12 @@ GetAllHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
}
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::GetAllResponse getAllResponse;
GetAllResponse getAllResponse;
InfallibleTArray<SerializedStructuredCloneReadInfo>& infos =
getAllResponse.cloneInfos();
@ -3924,10 +3923,10 @@ CountHelper::ReleaseMainThreadObjects()
nsresult
CountHelper::PackArgumentsForParentProcess(ObjectStoreRequestParams& aParams)
{
ipc::FIXME_Bug_521898_objectstore::CountParams params;
FIXME_Bug_521898_objectstore::CountParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_objectstore::KeyRange keyRange;
FIXME_Bug_521898_objectstore::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -3950,12 +3949,12 @@ CountHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::CountResponse countResponse = mCount;
CountResponse countResponse = mCount;
response = countResponse;
}