Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
We will use the new type for the generated IPDL message handler prototype to make sure correct error handling method is called. MozReview-Commit-ID: AzVbApxFGZ0
This commit is contained in:
@@ -705,14 +705,14 @@ PluginScriptableObjectChild::NPObjectDestroyed()
|
||||
mObject = nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
mozilla::ipc::IPCResult
|
||||
PluginScriptableObjectChild::AnswerInvalidate()
|
||||
{
|
||||
AssertPluginThread();
|
||||
PluginInstanceChild::AutoStackHelper guard(mInstance);
|
||||
|
||||
if (mInvalidated) {
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mInvalidated = true;
|
||||
@@ -726,10 +726,10 @@ PluginScriptableObjectChild::AnswerInvalidate()
|
||||
|
||||
Unprotect();
|
||||
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
bool
|
||||
mozilla::ipc::IPCResult
|
||||
PluginScriptableObjectChild::AnswerHasMethod(const PluginIdentifier& aId,
|
||||
bool* aHasMethod)
|
||||
{
|
||||
@@ -739,7 +739,7 @@ PluginScriptableObjectChild::AnswerHasMethod(const PluginIdentifier& aId,
|
||||
if (mInvalidated) {
|
||||
NS_WARNING("Calling AnswerHasMethod with an invalidated object!");
|
||||
*aHasMethod = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
|
||||
@@ -747,15 +747,15 @@ PluginScriptableObjectChild::AnswerHasMethod(const PluginIdentifier& aId,
|
||||
|
||||
if (!(mObject->_class && mObject->_class->hasMethod)) {
|
||||
*aHasMethod = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
StackIdentifier id(aId);
|
||||
*aHasMethod = mObject->_class->hasMethod(mObject, id.ToNPIdentifier());
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
bool
|
||||
mozilla::ipc::IPCResult
|
||||
PluginScriptableObjectChild::AnswerInvoke(const PluginIdentifier& aId,
|
||||
InfallibleTArray<Variant>&& aArgs,
|
||||
Variant* aResult,
|
||||
@@ -768,7 +768,7 @@ PluginScriptableObjectChild::AnswerInvoke(const PluginIdentifier& aId,
|
||||
NS_WARNING("Calling AnswerInvoke with an invalidated object!");
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
|
||||
@@ -777,7 +777,7 @@ PluginScriptableObjectChild::AnswerInvoke(const PluginIdentifier& aId,
|
||||
if (!(mObject->_class && mObject->_class->invoke)) {
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
AutoTArray<NPVariant, 10> convertedArgs;
|
||||
@@ -786,7 +786,7 @@ PluginScriptableObjectChild::AnswerInvoke(const PluginIdentifier& aId,
|
||||
if (!convertedArgs.SetLength(argCount, mozilla::fallible)) {
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
for (uint32_t index = 0; index < argCount; index++) {
|
||||
@@ -807,7 +807,7 @@ PluginScriptableObjectChild::AnswerInvoke(const PluginIdentifier& aId,
|
||||
if (!success) {
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
Variant convertedResult;
|
||||
@@ -819,15 +819,15 @@ PluginScriptableObjectChild::AnswerInvoke(const PluginIdentifier& aId,
|
||||
if (!success) {
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
*aSuccess = true;
|
||||
*aResult = convertedResult;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
bool
|
||||
mozilla::ipc::IPCResult
|
||||
PluginScriptableObjectChild::AnswerInvokeDefault(InfallibleTArray<Variant>&& aArgs,
|
||||
Variant* aResult,
|
||||
bool* aSuccess)
|
||||
@@ -839,7 +839,7 @@ PluginScriptableObjectChild::AnswerInvokeDefault(InfallibleTArray<Variant>&& aAr
|
||||
NS_WARNING("Calling AnswerInvokeDefault with an invalidated object!");
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
|
||||
@@ -848,7 +848,7 @@ PluginScriptableObjectChild::AnswerInvokeDefault(InfallibleTArray<Variant>&& aAr
|
||||
if (!(mObject->_class && mObject->_class->invokeDefault)) {
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
AutoTArray<NPVariant, 10> convertedArgs;
|
||||
@@ -857,7 +857,7 @@ PluginScriptableObjectChild::AnswerInvokeDefault(InfallibleTArray<Variant>&& aAr
|
||||
if (!convertedArgs.SetLength(argCount, mozilla::fallible)) {
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
for (uint32_t index = 0; index < argCount; index++) {
|
||||
@@ -877,7 +877,7 @@ PluginScriptableObjectChild::AnswerInvokeDefault(InfallibleTArray<Variant>&& aAr
|
||||
if (!success) {
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
Variant convertedResult;
|
||||
@@ -889,15 +889,15 @@ PluginScriptableObjectChild::AnswerInvokeDefault(InfallibleTArray<Variant>&& aAr
|
||||
if (!success) {
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
*aResult = convertedResult;
|
||||
*aSuccess = true;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
bool
|
||||
mozilla::ipc::IPCResult
|
||||
PluginScriptableObjectChild::AnswerHasProperty(const PluginIdentifier& aId,
|
||||
bool* aHasProperty)
|
||||
{
|
||||
@@ -907,7 +907,7 @@ PluginScriptableObjectChild::AnswerHasProperty(const PluginIdentifier& aId,
|
||||
if (mInvalidated) {
|
||||
NS_WARNING("Calling AnswerHasProperty with an invalidated object!");
|
||||
*aHasProperty = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
|
||||
@@ -915,15 +915,15 @@ PluginScriptableObjectChild::AnswerHasProperty(const PluginIdentifier& aId,
|
||||
|
||||
if (!(mObject->_class && mObject->_class->hasProperty)) {
|
||||
*aHasProperty = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
StackIdentifier id(aId);
|
||||
*aHasProperty = mObject->_class->hasProperty(mObject, id.ToNPIdentifier());
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
bool
|
||||
mozilla::ipc::IPCResult
|
||||
PluginScriptableObjectChild::AnswerGetChildProperty(const PluginIdentifier& aId,
|
||||
bool* aHasProperty,
|
||||
bool* aHasMethod,
|
||||
@@ -938,7 +938,7 @@ PluginScriptableObjectChild::AnswerGetChildProperty(const PluginIdentifier& aId,
|
||||
|
||||
if (mInvalidated) {
|
||||
NS_WARNING("Calling AnswerGetProperty with an invalidated object!");
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
|
||||
@@ -946,7 +946,7 @@ PluginScriptableObjectChild::AnswerGetChildProperty(const PluginIdentifier& aId,
|
||||
|
||||
if (!(mObject->_class && mObject->_class->hasProperty &&
|
||||
mObject->_class->hasMethod && mObject->_class->getProperty)) {
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
StackIdentifier stackID(aId);
|
||||
@@ -960,7 +960,7 @@ PluginScriptableObjectChild::AnswerGetChildProperty(const PluginIdentifier& aId,
|
||||
VOID_TO_NPVARIANT(result);
|
||||
|
||||
if (!mObject->_class->getProperty(mObject, id, &result)) {
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
Variant converted;
|
||||
@@ -971,10 +971,10 @@ PluginScriptableObjectChild::AnswerGetChildProperty(const PluginIdentifier& aId,
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
bool
|
||||
mozilla::ipc::IPCResult
|
||||
PluginScriptableObjectChild::AnswerSetProperty(const PluginIdentifier& aId,
|
||||
const Variant& aValue,
|
||||
bool* aSuccess)
|
||||
@@ -985,7 +985,7 @@ PluginScriptableObjectChild::AnswerSetProperty(const PluginIdentifier& aId,
|
||||
if (mInvalidated) {
|
||||
NS_WARNING("Calling AnswerSetProperty with an invalidated object!");
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
|
||||
@@ -994,7 +994,7 @@ PluginScriptableObjectChild::AnswerSetProperty(const PluginIdentifier& aId,
|
||||
if (!(mObject->_class && mObject->_class->hasProperty &&
|
||||
mObject->_class->setProperty)) {
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
StackIdentifier stackID(aId);
|
||||
@@ -1002,7 +1002,7 @@ PluginScriptableObjectChild::AnswerSetProperty(const PluginIdentifier& aId,
|
||||
|
||||
if (!mObject->_class->hasProperty(mObject, id)) {
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
NPVariant converted;
|
||||
@@ -1011,10 +1011,10 @@ PluginScriptableObjectChild::AnswerSetProperty(const PluginIdentifier& aId,
|
||||
if ((*aSuccess = mObject->_class->setProperty(mObject, id, &converted))) {
|
||||
PluginModuleChild::sBrowserFuncs.releasevariantvalue(&converted);
|
||||
}
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
bool
|
||||
mozilla::ipc::IPCResult
|
||||
PluginScriptableObjectChild::AnswerRemoveProperty(const PluginIdentifier& aId,
|
||||
bool* aSuccess)
|
||||
{
|
||||
@@ -1024,7 +1024,7 @@ PluginScriptableObjectChild::AnswerRemoveProperty(const PluginIdentifier& aId,
|
||||
if (mInvalidated) {
|
||||
NS_WARNING("Calling AnswerRemoveProperty with an invalidated object!");
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
|
||||
@@ -1033,7 +1033,7 @@ PluginScriptableObjectChild::AnswerRemoveProperty(const PluginIdentifier& aId,
|
||||
if (!(mObject->_class && mObject->_class->hasProperty &&
|
||||
mObject->_class->removeProperty)) {
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
StackIdentifier stackID(aId);
|
||||
@@ -1042,10 +1042,10 @@ PluginScriptableObjectChild::AnswerRemoveProperty(const PluginIdentifier& aId,
|
||||
mObject->_class->removeProperty(mObject, id) :
|
||||
true;
|
||||
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
bool
|
||||
mozilla::ipc::IPCResult
|
||||
PluginScriptableObjectChild::AnswerEnumerate(InfallibleTArray<PluginIdentifier>* aProperties,
|
||||
bool* aSuccess)
|
||||
{
|
||||
@@ -1055,7 +1055,7 @@ PluginScriptableObjectChild::AnswerEnumerate(InfallibleTArray<PluginIdentifier>*
|
||||
if (mInvalidated) {
|
||||
NS_WARNING("Calling AnswerEnumerate with an invalidated object!");
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
|
||||
@@ -1063,14 +1063,14 @@ PluginScriptableObjectChild::AnswerEnumerate(InfallibleTArray<PluginIdentifier>*
|
||||
|
||||
if (!(mObject->_class && mObject->_class->enumerate)) {
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
NPIdentifier* ids;
|
||||
uint32_t idCount;
|
||||
if (!mObject->_class->enumerate(mObject, &ids, &idCount)) {
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
aProperties->SetCapacity(idCount);
|
||||
@@ -1081,10 +1081,10 @@ PluginScriptableObjectChild::AnswerEnumerate(InfallibleTArray<PluginIdentifier>*
|
||||
|
||||
PluginModuleChild::sBrowserFuncs.memfree(ids);
|
||||
*aSuccess = true;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
bool
|
||||
mozilla::ipc::IPCResult
|
||||
PluginScriptableObjectChild::AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
|
||||
Variant* aResult,
|
||||
bool* aSuccess)
|
||||
@@ -1096,7 +1096,7 @@ PluginScriptableObjectChild::AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
|
||||
NS_WARNING("Calling AnswerConstruct with an invalidated object!");
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
|
||||
@@ -1105,7 +1105,7 @@ PluginScriptableObjectChild::AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
|
||||
if (!(mObject->_class && mObject->_class->construct)) {
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
AutoTArray<NPVariant, 10> convertedArgs;
|
||||
@@ -1114,7 +1114,7 @@ PluginScriptableObjectChild::AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
|
||||
if (!convertedArgs.SetLength(argCount, mozilla::fallible)) {
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
for (uint32_t index = 0; index < argCount; index++) {
|
||||
@@ -1133,7 +1133,7 @@ PluginScriptableObjectChild::AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
|
||||
if (!success) {
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
Variant convertedResult;
|
||||
@@ -1145,32 +1145,32 @@ PluginScriptableObjectChild::AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
|
||||
if (!success) {
|
||||
*aResult = void_t();
|
||||
*aSuccess = false;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
*aResult = convertedResult;
|
||||
*aSuccess = true;
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
bool
|
||||
mozilla::ipc::IPCResult
|
||||
PluginScriptableObjectChild::RecvProtect()
|
||||
{
|
||||
NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
|
||||
NS_ASSERTION(mType == LocalObject, "Bad type!");
|
||||
|
||||
Protect();
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
bool
|
||||
mozilla::ipc::IPCResult
|
||||
PluginScriptableObjectChild::RecvUnprotect()
|
||||
{
|
||||
NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
|
||||
NS_ASSERTION(mType == LocalObject, "Bad type!");
|
||||
|
||||
Unprotect();
|
||||
return true;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user