Bug 518881: Fix unused-result warnings in dom/plugins. r=bsmedberg

This commit is contained in:
Chris Jones 2010-04-27 00:43:03 -05:00
Родитель 3853bf3560
Коммит 0e72c93b2b
4 изменённых файлов: 22 добавлений и 17 удалений

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

@ -3,6 +3,8 @@
#include "BrowserStreamParent.h"
#include "PluginInstanceParent.h"
#include "mozilla/unused.h"
// How much data are we willing to send across the wire
// in one chunk?
static const int32_t kSendDataChunk = 0x1000;
@ -84,7 +86,7 @@ BrowserStreamParent::NPP_DestroyStream(NPReason reason)
{
NS_ASSERTION(ALIVE == mState, "NPP_DestroyStream called twice?");
mState = DYING;
SendNPP_DestroyStream(reason);
unused << SendNPP_DestroyStream(reason);
}
bool
@ -96,8 +98,7 @@ BrowserStreamParent::RecvStreamDestroyed()
}
mState = DELETING;
Send__delete__(this);
return true;
return Send__delete__(this);
}
int32_t
@ -119,11 +120,10 @@ BrowserStreamParent::Write(int32_t offset,
if (len > kSendDataChunk)
len = kSendDataChunk;
SendWrite(offset,
nsCString(static_cast<char*>(buffer), len),
mStream->end);
return len;
return SendWrite(offset,
nsCString(static_cast<char*>(buffer), len),
mStream->end) ?
len : -1;
}
void
@ -134,7 +134,7 @@ BrowserStreamParent::StreamAsFile(const char* fname)
NS_ASSERTION(ALIVE == mState,
"Calling streamasfile after NPP_DestroyStream?");
CallNPP_StreamAsFile(nsCString(fname));
unused << CallNPP_StreamAsFile(nsCString(fname));
return;
}

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

@ -45,6 +45,7 @@
#include "StreamNotifyParent.h"
#include "npfunctions.h"
#include "nsAutoPtr.h"
#include "mozilla/unused.h"
#if defined(OS_WIN)
#include <windowsx.h>
@ -453,7 +454,8 @@ PluginInstanceParent::AnswerPStreamNotifyConstructor(PStreamNotifyParent* actor,
if (!streamDestroyed) {
static_cast<StreamNotifyParent*>(actor)->ClearDestructionFlag();
if (*result != NPERR_NO_ERROR)
PStreamNotifyParent::Send__delete__(actor, NPERR_GENERIC_ERROR);
return PStreamNotifyParent::Send__delete__(actor,
NPERR_GENERIC_ERROR);
}
return true;
@ -835,7 +837,7 @@ PluginInstanceParent::NPP_NewStream(NPMIMEType type, NPStream* stream,
return NPERR_GENERIC_ERROR;
if (NPERR_NO_ERROR != err)
PBrowserStreamParent::Send__delete__(bs);
unused << PBrowserStreamParent::Send__delete__(bs);
return err;
}
@ -862,8 +864,8 @@ PluginInstanceParent::NPP_DestroyStream(NPStream* stream, NPReason reason)
if (sp->mInstance != this)
NS_RUNTIMEABORT("Mismatched plugin data");
PPluginStreamParent::Call__delete__(sp, reason, false);
return NPERR_NO_ERROR;
return PPluginStreamParent::Call__delete__(sp, reason, false) ?
NPERR_NO_ERROR : NPERR_GENERIC_ERROR;
}
}
@ -956,7 +958,7 @@ PluginInstanceParent::NPP_URLNotify(const char* url, NPReason reason,
PStreamNotifyParent* streamNotify =
static_cast<PStreamNotifyParent*>(notifyData);
PStreamNotifyParent::Send__delete__(streamNotify, reason);
unused << PStreamNotifyParent::Send__delete__(streamNotify, reason);
}
bool

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

@ -42,6 +42,7 @@
#include "base/process_util.h"
#include "mozilla/unused.h"
#include "mozilla/ipc/SyncChannel.h"
#include "mozilla/plugins/PluginModuleParent.h"
#include "mozilla/plugins/BrowserStreamParent.h"
@ -390,7 +391,7 @@ PluginModuleParent::NPP_Destroy(NPP instance,
NPError retval = parentInstance->Destroy();
instance->pdata = nsnull;
(void) PluginInstanceParent::Call__delete__(parentInstance);
unused << PluginInstanceParent::Call__delete__(parentInstance);
return retval;
}

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

@ -39,6 +39,8 @@
#include "PluginScriptableObjectParent.h"
#include "PluginScriptableObjectUtils.h"
#include "mozilla/unused.h"
using namespace mozilla::plugins;
namespace {
@ -671,7 +673,7 @@ PluginScriptableObjectParent::Unprotect()
if (mType == LocalObject) {
if (--mProtectCount == 0) {
PluginScriptableObjectParent::Send__delete__(this);
unused << PluginScriptableObjectParent::Send__delete__(this);
}
}
}
@ -691,7 +693,7 @@ PluginScriptableObjectParent::DropNPObject()
instance->UnregisterNPObject(mObject);
mObject = nsnull;
(void) SendUnprotect();
unused << SendUnprotect();
}
bool