зеркало из https://github.com/mozilla/gecko-dev.git
switch message handler nsresult return types to bool. appears to break test plugin, will be temporary
This commit is contained in:
Родитель
151058edaa
Коммит
ad7cc03628
|
@ -86,11 +86,11 @@ ContentProcessChild::PIFrameEmbeddingConstructor(const MagicWindowHandle& hwnd)
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
ContentProcessChild::PIFrameEmbeddingDestructor(PIFrameEmbeddingChild* iframe)
|
||||
{
|
||||
mIFrames.RemoveElement(iframe);
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
PTestShellChild*
|
||||
|
@ -104,11 +104,11 @@ ContentProcessChild::PTestShellConstructor()
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
ContentProcessChild::PTestShellDestructor(PTestShellChild* shell)
|
||||
{
|
||||
mTestShells.RemoveElement(shell);
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
PNeckoChild*
|
||||
|
@ -117,11 +117,11 @@ ContentProcessChild::PNeckoConstructor()
|
|||
return new NeckoChild();
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
ContentProcessChild::PNeckoDestructor(PNeckoChild* necko)
|
||||
{
|
||||
delete necko;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -138,7 +138,7 @@ QuitIOLoop()
|
|||
MessageLoop::current()->Quit();
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
ContentProcessChild::RecvQuit()
|
||||
{
|
||||
mQuit = PR_TRUE;
|
||||
|
@ -148,7 +148,7 @@ ContentProcessChild::RecvQuit()
|
|||
XRE_GetIOMessageLoop()->PostTask(FROM_HERE,
|
||||
NewRunnableFunction(&QuitIOLoop));
|
||||
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -62,16 +62,16 @@ public:
|
|||
|
||||
virtual PIFrameEmbeddingChild* PIFrameEmbeddingConstructor(
|
||||
const MagicWindowHandle& hwnd);
|
||||
virtual nsresult PIFrameEmbeddingDestructor(PIFrameEmbeddingChild*);
|
||||
virtual bool PIFrameEmbeddingDestructor(PIFrameEmbeddingChild*);
|
||||
|
||||
virtual PTestShellChild* PTestShellConstructor();
|
||||
virtual nsresult PTestShellDestructor(PTestShellChild*);
|
||||
virtual bool PTestShellDestructor(PTestShellChild*);
|
||||
|
||||
virtual PNeckoChild* PNeckoConstructor();
|
||||
virtual nsresult PNeckoDestructor(PNeckoChild*);
|
||||
virtual bool PNeckoDestructor(PNeckoChild*);
|
||||
|
||||
void Quit();
|
||||
virtual nsresult RecvQuit();
|
||||
virtual bool RecvQuit();
|
||||
|
||||
private:
|
||||
static ContentProcessChild* sSingleton;
|
||||
|
|
|
@ -149,11 +149,11 @@ ContentProcessParent::PIFrameEmbeddingConstructor(
|
|||
return new TabParent();
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
ContentProcessParent::PIFrameEmbeddingDestructor(PIFrameEmbeddingParent* frame)
|
||||
{
|
||||
delete frame;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
PTestShellParent*
|
||||
|
@ -162,11 +162,11 @@ ContentProcessParent::PTestShellConstructor()
|
|||
return new TestShellParent();
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
ContentProcessParent::PTestShellDestructor(PTestShellParent* shell)
|
||||
{
|
||||
delete shell;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
PNeckoParent*
|
||||
|
@ -175,11 +175,11 @@ ContentProcessParent::PNeckoConstructor()
|
|||
return new NeckoParent();
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
ContentProcessParent::PNeckoDestructor(PNeckoParent* necko)
|
||||
{
|
||||
delete necko;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -93,13 +93,13 @@ private:
|
|||
|
||||
virtual PIFrameEmbeddingParent* PIFrameEmbeddingConstructor(
|
||||
const MagicWindowHandle& parentWidget);
|
||||
virtual nsresult PIFrameEmbeddingDestructor(PIFrameEmbeddingParent* frame);
|
||||
virtual bool PIFrameEmbeddingDestructor(PIFrameEmbeddingParent* frame);
|
||||
|
||||
virtual PTestShellParent* PTestShellConstructor();
|
||||
virtual nsresult PTestShellDestructor(PTestShellParent* shell);
|
||||
virtual bool PTestShellDestructor(PTestShellParent* shell);
|
||||
|
||||
virtual PNeckoParent* PNeckoConstructor();
|
||||
virtual nsresult PNeckoDestructor(PNeckoParent* necko);
|
||||
virtual bool PNeckoDestructor(PNeckoParent* necko);
|
||||
|
||||
mozilla::Monitor mMonitor;
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ TabChild::~TabChild()
|
|||
// TODObsmedberg: destroy the window!
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
TabChild::RecvloadURL(const nsCString& uri)
|
||||
{
|
||||
printf("loading %s, %d\n", uri.get(), NS_IsMainThread());
|
||||
|
@ -101,7 +101,7 @@ TabChild::RecvloadURL(const nsCString& uri)
|
|||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
TabChild::Recvmove(const PRUint32& x,
|
||||
const PRUint32& y,
|
||||
const PRUint32& width,
|
||||
|
@ -112,5 +112,5 @@ TabChild::Recvmove(const PRUint32& x,
|
|||
|
||||
nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(mWebNav);
|
||||
baseWin->SetPositionAndSize(x, y, width, height, PR_TRUE);
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -52,11 +52,11 @@ public:
|
|||
TabChild(const MagicWindowHandle& parentWidget);
|
||||
virtual ~TabChild();
|
||||
|
||||
virtual nsresult RecvloadURL(const nsCString& uri);
|
||||
virtual nsresult Recvmove(const PRUint32& x,
|
||||
const PRUint32& y,
|
||||
const PRUint32& width,
|
||||
const PRUint32& height);
|
||||
virtual bool RecvloadURL(const nsCString& uri);
|
||||
virtual bool Recvmove(const PRUint32& x,
|
||||
const PRUint32& y,
|
||||
const PRUint32& width,
|
||||
const PRUint32& height);
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIWebNavigation> mWebNav;
|
||||
|
|
|
@ -71,29 +71,29 @@ BrowserStreamChild::BrowserStreamChild(PluginInstanceChild* instance,
|
|||
mClosed = true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
BrowserStreamChild::AnswerNPP_WriteReady(const int32_t& newlength,
|
||||
int32_t *size)
|
||||
{
|
||||
if (mClosed) {
|
||||
*size = 0;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
mStream.end = newlength;
|
||||
|
||||
*size = mInstance->mPluginIface->writeready(&mInstance->mData, &mStream);
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
BrowserStreamChild::AnswerNPP_Write(const int32_t& offset,
|
||||
const Buffer& data,
|
||||
int32_t* consumed)
|
||||
{
|
||||
if (mClosed) {
|
||||
*consumed = -1;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
*consumed = mInstance->mPluginIface->write(&mInstance->mData, &mStream,
|
||||
|
@ -102,18 +102,18 @@ BrowserStreamChild::AnswerNPP_Write(const int32_t& offset,
|
|||
if (*consumed < 0)
|
||||
mClosed = true;
|
||||
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
BrowserStreamChild::AnswerNPP_StreamAsFile(const nsCString& fname)
|
||||
{
|
||||
if (mClosed)
|
||||
return NS_OK;
|
||||
return true;
|
||||
|
||||
mInstance->mPluginIface->asfile(&mInstance->mData, &mStream,
|
||||
fname.get());
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
} /* namespace plugins */
|
||||
|
|
|
@ -59,13 +59,13 @@ public:
|
|||
uint16_t* stype);
|
||||
virtual ~BrowserStreamChild() { }
|
||||
|
||||
virtual nsresult AnswerNPP_WriteReady(const int32_t& newlength,
|
||||
virtual bool AnswerNPP_WriteReady(const int32_t& newlength,
|
||||
int32_t *size);
|
||||
virtual nsresult AnswerNPP_Write(const int32_t& offset,
|
||||
virtual bool AnswerNPP_Write(const int32_t& offset,
|
||||
const Buffer& data,
|
||||
int32_t* consumed);
|
||||
|
||||
virtual nsresult AnswerNPP_StreamAsFile(const nsCString& fname);
|
||||
virtual bool AnswerNPP_StreamAsFile(const nsCString& fname);
|
||||
|
||||
void EnsureCorrectInstance(PluginInstanceChild* i)
|
||||
{
|
||||
|
|
|
@ -14,12 +14,12 @@ BrowserStreamParent::BrowserStreamParent(PluginInstanceParent* npp,
|
|||
mStream->pdata = this;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
BrowserStreamParent::AnswerNPN_RequestRead(const IPCByteRanges& ranges,
|
||||
NPError* result)
|
||||
{
|
||||
if (!mStream)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
return false;
|
||||
|
||||
if (ranges.size() > PR_INT32_MAX) {
|
||||
// TODO: abort all processing!
|
||||
|
@ -34,7 +34,7 @@ BrowserStreamParent::AnswerNPN_RequestRead(const IPCByteRanges& ranges,
|
|||
}
|
||||
rp[ranges.size()].next = NULL;
|
||||
|
||||
return mNPP->mNPNIface->requestread(mStream, rp);
|
||||
return NPERR_NO_ERROR == mNPP->mNPNIface->requestread(mStream, rp);
|
||||
}
|
||||
|
||||
int32_t
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
NPStream* stream);
|
||||
virtual ~BrowserStreamParent() { }
|
||||
|
||||
virtual nsresult AnswerNPN_RequestRead(const IPCByteRanges& ranges,
|
||||
virtual bool AnswerNPN_RequestRead(const IPCByteRanges& ranges,
|
||||
NPError* result);
|
||||
|
||||
int32_t WriteReady();
|
||||
|
|
|
@ -158,7 +158,7 @@ PluginInstanceChild::NPN_GetValue(NPNVariable aVar,
|
|||
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceChild::AnswerNPP_GetValue_NPPVpluginScriptableNPObject(
|
||||
PPluginScriptableObjectChild** value,
|
||||
NPError* result)
|
||||
|
@ -168,22 +168,22 @@ PluginInstanceChild::AnswerNPP_GetValue_NPPVpluginScriptableNPObject(
|
|||
*result = mPluginIface->getvalue(GetNPP(), NPPVpluginScriptableNPObject,
|
||||
&object);
|
||||
if (*result != NPERR_NO_ERROR) {
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
PluginScriptableObjectChild* actor = CreateActorForNPObject(object);
|
||||
if (!actor) {
|
||||
PluginModuleChild::sBrowserFuncs.releaseobject(object);
|
||||
*result = NPERR_GENERIC_ERROR;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
PluginModuleChild::sBrowserFuncs.releaseobject(object);
|
||||
*value = actor;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceChild::AnswerNPP_SetWindow(const NPWindow& aWindow,
|
||||
NPError* rv)
|
||||
{
|
||||
|
@ -248,7 +248,7 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPWindow& aWindow,
|
|||
# error Implement me for your OS
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -418,7 +418,7 @@ PluginInstanceChild::PPluginScriptableObjectConstructor()
|
|||
return object->get();
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceChild::PPluginScriptableObjectDestructor(PPluginScriptableObjectChild* aObject)
|
||||
{
|
||||
PluginScriptableObjectChild* object =
|
||||
|
@ -431,7 +431,7 @@ PluginInstanceChild::PPluginScriptableObjectDestructor(PPluginScriptableObjectCh
|
|||
break;
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
PBrowserStreamChild*
|
||||
|
@ -449,13 +449,13 @@ PluginInstanceChild::PBrowserStreamConstructor(const nsCString& url,
|
|||
mimeType, seekable, rv, stype);
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceChild::PBrowserStreamDestructor(PBrowserStreamChild* stream,
|
||||
const NPError& reason,
|
||||
const bool& artificial)
|
||||
{
|
||||
delete stream;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
PStreamNotifyChild*
|
||||
|
@ -470,7 +470,7 @@ PluginInstanceChild::PStreamNotifyConstructor(const nsCString& url,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceChild::PStreamNotifyDestructor(PStreamNotifyChild* notifyData,
|
||||
const NPReason& reason)
|
||||
{
|
||||
|
@ -478,7 +478,7 @@ PluginInstanceChild::PStreamNotifyDestructor(PStreamNotifyChild* notifyData,
|
|||
mPluginIface->urlnotify(&mData, sn->mURL.get(), reason, sn->mClosure);
|
||||
delete sn;
|
||||
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
PluginScriptableObjectChild*
|
||||
|
|
|
@ -67,16 +67,16 @@ class PluginInstanceChild : public PPluginInstanceChild
|
|||
protected:
|
||||
friend class BrowserStreamChild;
|
||||
|
||||
virtual nsresult AnswerNPP_SetWindow(const NPWindow& window, NPError* rv);
|
||||
virtual bool AnswerNPP_SetWindow(const NPWindow& window, NPError* rv);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerNPP_GetValue_NPPVpluginScriptableNPObject(PPluginScriptableObjectChild** value,
|
||||
NPError* result);
|
||||
|
||||
virtual PPluginScriptableObjectChild*
|
||||
PPluginScriptableObjectConstructor();
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
PPluginScriptableObjectDestructor(PPluginScriptableObjectChild* aObject);
|
||||
|
||||
virtual PBrowserStreamChild*
|
||||
|
@ -90,7 +90,7 @@ protected:
|
|||
NPError* rv,
|
||||
uint16_t *stype);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
PBrowserStreamDestructor(PBrowserStreamChild* stream,
|
||||
const NPError& reason,
|
||||
const bool& artificial);
|
||||
|
@ -101,7 +101,7 @@ protected:
|
|||
const bool& file,
|
||||
NPError* result);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
PStreamNotifyDestructor(PStreamNotifyChild* notifyData,
|
||||
const NPReason& reason);
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ PluginInstanceParent::PBrowserStreamConstructor(const nsCString& url,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceParent::AnswerPBrowserStreamDestructor(PBrowserStreamParent* stream,
|
||||
const NPError& reason,
|
||||
const bool& artificial)
|
||||
|
@ -66,19 +66,19 @@ PluginInstanceParent::AnswerPBrowserStreamDestructor(PBrowserStreamParent* strea
|
|||
if (!artificial) {
|
||||
static_cast<BrowserStreamParent*>(stream)->NPN_DestroyStream(reason);
|
||||
}
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceParent::PBrowserStreamDestructor(PBrowserStreamParent* stream,
|
||||
const NPError& reason,
|
||||
const bool& artificial)
|
||||
{
|
||||
delete stream;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceParent::AnswerNPN_GetValue_NPNVjavascriptEnabledBool(
|
||||
bool* value,
|
||||
NPError* result)
|
||||
|
@ -86,20 +86,20 @@ PluginInstanceParent::AnswerNPN_GetValue_NPNVjavascriptEnabledBool(
|
|||
NPBool v;
|
||||
*result = mNPNIface->getvalue(mNPP, NPNVjavascriptEnabledBool, &v);
|
||||
*value = v;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceParent::AnswerNPN_GetValue_NPNVisOfflineBool(bool* value,
|
||||
NPError* result)
|
||||
{
|
||||
NPBool v;
|
||||
*result = mNPNIface->getvalue(mNPP, NPNVisOfflineBool, &v);
|
||||
*value = v;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceParent::AnswerNPN_GetValue_NPNVWindowNPObject(
|
||||
PPluginScriptableObjectParent** value,
|
||||
NPError* result)
|
||||
|
@ -107,10 +107,10 @@ PluginInstanceParent::AnswerNPN_GetValue_NPNVWindowNPObject(
|
|||
// TODO NPRuntime
|
||||
*value = NULL;
|
||||
*result = NPERR_GENERIC_ERROR;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceParent::AnswerNPN_GetValue_NPNVPluginElementNPObject(
|
||||
PPluginScriptableObjectParent** value,
|
||||
NPError* result)
|
||||
|
@ -118,29 +118,29 @@ PluginInstanceParent::AnswerNPN_GetValue_NPNVPluginElementNPObject(
|
|||
// TODO NPRuntime
|
||||
*value = NULL;
|
||||
*result = NPERR_GENERIC_ERROR;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceParent::AnswerNPN_GetValue_NPNVprivateModeBool(bool* value,
|
||||
NPError* result)
|
||||
{
|
||||
NPBool v;
|
||||
*result = mNPNIface->getvalue(mNPP, NPNVprivateModeBool, &v);
|
||||
*value = v;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceParent::AnswerNPN_GetURL(const nsCString& url,
|
||||
const nsCString& target,
|
||||
NPError* result)
|
||||
{
|
||||
*result = mNPNIface->geturl(mNPP, url.get(), target.get());
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceParent::AnswerNPN_PostURL(const nsCString& url,
|
||||
const nsCString& target,
|
||||
const nsCString& buffer,
|
||||
|
@ -149,7 +149,7 @@ PluginInstanceParent::AnswerNPN_PostURL(const nsCString& url,
|
|||
{
|
||||
*result = mNPNIface->posturl(mNPP, url.get(), target.get(),
|
||||
buffer.Length(), buffer.get(), file);
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
PStreamNotifyParent*
|
||||
|
@ -175,12 +175,12 @@ PluginInstanceParent::PStreamNotifyConstructor(const nsCString& url,
|
|||
return notifyData;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceParent::PStreamNotifyDestructor(PStreamNotifyParent* notifyData,
|
||||
const NPReason& reason)
|
||||
{
|
||||
delete notifyData;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
NPError
|
||||
|
@ -258,11 +258,11 @@ PluginInstanceParent::PPluginScriptableObjectConstructor()
|
|||
return new PluginScriptableObjectParent();
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginInstanceParent::PPluginScriptableObjectDestructor(PPluginScriptableObjectParent* aObject)
|
||||
{
|
||||
delete aObject;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace plugins
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
virtual PPluginScriptableObjectParent*
|
||||
PPluginScriptableObjectConstructor();
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
PPluginScriptableObjectDestructor(PPluginScriptableObjectParent* aObject);
|
||||
|
||||
virtual PBrowserStreamParent*
|
||||
|
@ -86,36 +86,36 @@ public:
|
|||
NPError* rv,
|
||||
uint16_t *stype);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerPBrowserStreamDestructor(PBrowserStreamParent* stream,
|
||||
const NPError& reason,
|
||||
const bool& artificial);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
PBrowserStreamDestructor(PBrowserStreamParent* stream,
|
||||
const NPError& reason,
|
||||
const bool& artificial);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerNPN_GetValue_NPNVjavascriptEnabledBool(bool* value, NPError* result);
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerNPN_GetValue_NPNVisOfflineBool(bool* value, NPError* result);
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerNPN_GetValue_NPNVWindowNPObject(
|
||||
PPluginScriptableObjectParent** value,
|
||||
NPError* result);
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerNPN_GetValue_NPNVPluginElementNPObject(
|
||||
PPluginScriptableObjectParent** value,
|
||||
NPError* result);
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerNPN_GetValue_NPNVprivateModeBool(bool* value, NPError* result);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerNPN_GetURL(const nsCString& url, const nsCString& target,
|
||||
NPError *result);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerNPN_PostURL(const nsCString& url, const nsCString& target,
|
||||
const nsCString& buffer, const bool& file,
|
||||
NPError* result);
|
||||
|
@ -126,7 +126,7 @@ public:
|
|||
const bool& file,
|
||||
NPError* result);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
PStreamNotifyDestructor(PStreamNotifyParent* notifyData,
|
||||
const NPReason& reason);
|
||||
|
||||
|
|
|
@ -933,24 +933,26 @@ _pluginthreadasynccall(NPP aNPP,
|
|||
|
||||
#endif /* NP_VERSION_MINOR > 19 */
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginModuleChild::AnswerNP_Initialize(NPError* _retval)
|
||||
{
|
||||
_MOZ_LOG(__FUNCTION__);
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
*_retval = mInitializeFunc(&sBrowserFuncs, &mFunctions);
|
||||
return NS_OK;
|
||||
return true;
|
||||
|
||||
#elif defined(OS_WIN)
|
||||
nsresult rv = mGetEntryPointsFunc(&mFunctions);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
NS_ASSERTION(HIBYTE(mFunctions.version) >= NP_VERSION_MAJOR,
|
||||
"callback version is less than NP version");
|
||||
|
||||
*_retval = mInitializeFunc(&sBrowserFuncs);
|
||||
return NS_OK;
|
||||
return true;
|
||||
#else
|
||||
# error Please implement me for your platform
|
||||
#endif
|
||||
|
@ -974,7 +976,7 @@ PluginModuleChild::PPluginInstanceConstructor(const nsCString& aMimeType,
|
|||
return childInstance.forget();
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginModuleChild::AnswerPPluginInstanceConstructor(PPluginInstanceChild* aActor,
|
||||
const nsCString& aMimeType,
|
||||
const uint16_t& aMode,
|
||||
|
@ -1021,10 +1023,10 @@ PluginModuleChild::AnswerPPluginInstanceConstructor(PPluginInstanceChild* aActor
|
|||
}
|
||||
|
||||
printf ("[PluginModuleChild] %s: returning %hd\n", __FUNCTION__, *rv);
|
||||
return NS_OK;;
|
||||
return true;;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginModuleChild::PPluginInstanceDestructor(PPluginInstanceChild* actor,
|
||||
NPError* rv)
|
||||
{
|
||||
|
@ -1035,5 +1037,5 @@ PluginModuleChild::PPluginInstanceDestructor(PPluginInstanceChild* actor,
|
|||
delete actor;
|
||||
inst->GetNPP()->ndata = 0;
|
||||
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ class PluginModuleChild : public PPluginModuleChild
|
|||
{
|
||||
protected:
|
||||
// Implement the PPluginModuleChild interface
|
||||
virtual nsresult AnswerNP_Initialize(NPError* rv);
|
||||
virtual bool AnswerNP_Initialize(NPError* rv);
|
||||
|
||||
virtual PPluginInstanceChild*
|
||||
PPluginInstanceConstructor(const nsCString& aMimeType,
|
||||
|
@ -109,11 +109,11 @@ protected:
|
|||
const nsTArray<nsCString>& aValues,
|
||||
NPError* rv);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
PPluginInstanceDestructor(PPluginInstanceChild* aActor,
|
||||
NPError* rv);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerPPluginInstanceConstructor(PPluginInstanceChild* aActor,
|
||||
const nsCString& aMimeType,
|
||||
const uint16_t& aMode,
|
||||
|
|
|
@ -96,13 +96,13 @@ PluginModuleParent::PPluginInstanceConstructor(const nsCString& aMimeType,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginModuleParent::PPluginInstanceDestructor(PPluginInstanceParent* aActor,
|
||||
NPError* _retval)
|
||||
{
|
||||
_MOZ_LOG(__FUNCTION__);
|
||||
delete aActor;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -323,7 +323,7 @@ PluginModuleParent::NPP_SetValue(NPP instance, NPNVariable variable,
|
|||
return InstCast(instance)->NPP_SetValue(variable, value);
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginModuleParent::RecvNPN_GetStringIdentifier(const nsCString& aString,
|
||||
NPRemoteIdentifier* aId)
|
||||
{
|
||||
|
@ -336,10 +336,10 @@ PluginModuleParent::RecvNPN_GetStringIdentifier(const nsCString& aString,
|
|||
NS_ENSURE_TRUE(newEntry, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
*aId = (NPRemoteIdentifier)ident;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginModuleParent::RecvNPN_GetIntIdentifier(const int32_t& aInt,
|
||||
NPRemoteIdentifier* aId)
|
||||
{
|
||||
|
@ -350,10 +350,10 @@ PluginModuleParent::RecvNPN_GetIntIdentifier(const int32_t& aInt,
|
|||
NS_ENSURE_TRUE(newEntry, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
*aId = (NPRemoteIdentifier)ident;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginModuleParent::RecvNPN_UTF8FromIdentifier(const NPRemoteIdentifier& aId,
|
||||
nsCString* aString)
|
||||
{
|
||||
|
@ -364,10 +364,10 @@ PluginModuleParent::RecvNPN_UTF8FromIdentifier(const NPRemoteIdentifier& aId,
|
|||
NS_ENSURE_STATE(val);
|
||||
|
||||
aString->Assign(val);
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginModuleParent::RecvNPN_IntFromIdentifier(const NPRemoteIdentifier& aId,
|
||||
int32_t* aInt)
|
||||
{
|
||||
|
@ -375,10 +375,10 @@ PluginModuleParent::RecvNPN_IntFromIdentifier(const NPRemoteIdentifier& aId,
|
|||
NS_ENSURE_ARG(ident);
|
||||
|
||||
*aInt = _intfromidentifier(ident);
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginModuleParent::RecvNPN_IdentifierIsString(const NPRemoteIdentifier& aId,
|
||||
bool* aIsString)
|
||||
{
|
||||
|
@ -386,10 +386,10 @@ PluginModuleParent::RecvNPN_IdentifierIsString(const NPRemoteIdentifier& aId,
|
|||
NS_ENSURE_ARG(ident);
|
||||
|
||||
*aIsString = _identifierisstring(ident);
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginModuleParent::RecvNPN_GetStringIdentifiers(const nsTArray<nsCString>& aNames,
|
||||
nsTArray<NPRemoteIdentifier>* aIds)
|
||||
{
|
||||
|
@ -428,7 +428,7 @@ PluginModuleParent::RecvNPN_GetStringIdentifiers(const nsTArray<nsCString>& aNam
|
|||
aIds->AppendElement((NPRemoteIdentifier)id);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
PluginInstanceParent*
|
||||
|
|
|
@ -91,7 +91,7 @@ protected:
|
|||
const nsTArray<nsCString>& aValues,
|
||||
NPError* rv);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
PPluginInstanceDestructor(PPluginInstanceParent* aActor,
|
||||
NPError* _retval);
|
||||
|
||||
|
@ -111,22 +111,22 @@ public:
|
|||
PRLibrary* aLibrary);
|
||||
|
||||
// NPRemoteIdentifier funcs
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
RecvNPN_GetStringIdentifier(const nsCString& aString,
|
||||
NPRemoteIdentifier* aId);
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
RecvNPN_GetIntIdentifier(const int32_t& aInt,
|
||||
NPRemoteIdentifier* aId);
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
RecvNPN_UTF8FromIdentifier(const NPRemoteIdentifier& aId,
|
||||
nsCString* aString);
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
RecvNPN_IntFromIdentifier(const NPRemoteIdentifier& aId,
|
||||
int32_t* aInt);
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
RecvNPN_IdentifierIsString(const NPRemoteIdentifier& aId,
|
||||
bool* aIsString);
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
RecvNPN_GetStringIdentifiers(const nsTArray<nsCString>& aNames,
|
||||
nsTArray<NPRemoteIdentifier>* aIds);
|
||||
|
||||
|
|
|
@ -125,6 +125,9 @@ ConvertToVariant(const NPRemoteVariant& aRemoteVariant,
|
|||
OBJECT_TO_NPVARIANT(object, aVariant);
|
||||
return true;
|
||||
}
|
||||
|
||||
default:
|
||||
break; // break to NOTREACHED
|
||||
}
|
||||
|
||||
NS_NOTREACHED("Shouldn't get here!");
|
||||
|
@ -208,19 +211,19 @@ PluginScriptableObjectChild::Initialize(PluginInstanceChild* aInstance,
|
|||
mObject = PluginModuleChild::sBrowserFuncs.retainobject(aObject);
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginScriptableObjectChild::AnswerInvalidate()
|
||||
{
|
||||
NS_ENSURE_STATE(NS_IsMainThread());
|
||||
if (mObject) {
|
||||
PluginModuleChild::sBrowserFuncs.releaseobject(mObject);
|
||||
mObject = nsnull;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginScriptableObjectChild::AnswerHasMethod(const NPRemoteIdentifier& aId,
|
||||
bool* aHasMethod)
|
||||
{
|
||||
|
@ -229,14 +232,14 @@ PluginScriptableObjectChild::AnswerHasMethod(const NPRemoteIdentifier& aId,
|
|||
|
||||
if (!(mObject->_class && mObject->_class->hasMethod)) {
|
||||
*aHasMethod = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
*aHasMethod = mObject->_class->hasMethod(mObject, (NPIdentifier)aId);
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginScriptableObjectChild::AnswerInvoke(const NPRemoteIdentifier& aId,
|
||||
const nsTArray<NPRemoteVariant>& aArgs,
|
||||
NPRemoteVariant* aResult,
|
||||
|
@ -247,7 +250,7 @@ PluginScriptableObjectChild::AnswerInvoke(const NPRemoteIdentifier& aId,
|
|||
|
||||
if (!(mObject->_class && mObject->_class->invoke)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsAutoTArray<NPVariant, 10> convertedArgs;
|
||||
|
@ -255,13 +258,13 @@ PluginScriptableObjectChild::AnswerInvoke(const NPRemoteIdentifier& aId,
|
|||
|
||||
if (!convertedArgs.SetLength(argCount)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
for (PRUint32 index = 0; index < argCount; index++) {
|
||||
if (!ConvertToVariant(aArgs[index], convertedArgs[index])) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -271,21 +274,21 @@ PluginScriptableObjectChild::AnswerInvoke(const NPRemoteIdentifier& aId,
|
|||
&result);
|
||||
if (!success) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
NPRemoteVariant convertedResult;
|
||||
if (!ConvertToRemoteVariant(result, convertedResult, mInstance)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
*aSuccess = true;
|
||||
*aResult = convertedResult;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginScriptableObjectChild::AnswerInvokeDefault(const nsTArray<NPRemoteVariant>& aArgs,
|
||||
NPRemoteVariant* aResult,
|
||||
bool* aSuccess)
|
||||
|
@ -295,7 +298,7 @@ PluginScriptableObjectChild::AnswerInvokeDefault(const nsTArray<NPRemoteVariant>
|
|||
|
||||
if (!(mObject->_class && mObject->_class->invokeDefault)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsAutoTArray<NPVariant, 10> convertedArgs;
|
||||
|
@ -303,13 +306,13 @@ PluginScriptableObjectChild::AnswerInvokeDefault(const nsTArray<NPRemoteVariant>
|
|||
|
||||
if (!convertedArgs.SetLength(argCount)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
for (PRUint32 index = 0; index < argCount; index++) {
|
||||
if (!ConvertToVariant(aArgs[index], convertedArgs[index])) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -319,21 +322,21 @@ PluginScriptableObjectChild::AnswerInvokeDefault(const nsTArray<NPRemoteVariant>
|
|||
argCount, &result);
|
||||
if (!success) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
NPRemoteVariant convertedResult;
|
||||
if (!ConvertToRemoteVariant(result, convertedResult, mInstance)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
*aSuccess = true;
|
||||
*aResult = convertedResult;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginScriptableObjectChild::AnswerHasProperty(const NPRemoteIdentifier& aId,
|
||||
bool* aHasProperty)
|
||||
{
|
||||
|
@ -342,14 +345,14 @@ PluginScriptableObjectChild::AnswerHasProperty(const NPRemoteIdentifier& aId,
|
|||
|
||||
if (!(mObject->_class && mObject->_class->hasProperty)) {
|
||||
*aHasProperty = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
*aHasProperty = mObject->_class->hasProperty(mObject, (NPIdentifier)aId);
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginScriptableObjectChild::AnswerGetProperty(const NPRemoteIdentifier& aId,
|
||||
NPRemoteVariant* aResult,
|
||||
bool* aSuccess)
|
||||
|
@ -359,23 +362,23 @@ PluginScriptableObjectChild::AnswerGetProperty(const NPRemoteIdentifier& aId,
|
|||
|
||||
if (!(mObject->_class && mObject->_class->getProperty)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
NPVariant result;
|
||||
if (!mObject->_class->getProperty(mObject, (NPIdentifier)aId, &result)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
NPRemoteVariant converted;
|
||||
if ((*aSuccess = ConvertToRemoteVariant(result, converted, mInstance))) {
|
||||
*aResult = converted;
|
||||
}
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginScriptableObjectChild::AnswerSetProperty(const NPRemoteIdentifier& aId,
|
||||
const NPRemoteVariant& aValue,
|
||||
bool* aSuccess)
|
||||
|
@ -385,21 +388,21 @@ PluginScriptableObjectChild::AnswerSetProperty(const NPRemoteIdentifier& aId,
|
|||
|
||||
if (!(mObject->_class && mObject->_class->setProperty)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
NPVariant converted;
|
||||
if (!ConvertToVariant(aValue, converted)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
*aSuccess = mObject->_class->setProperty(mObject, (NPIdentifier)aId,
|
||||
&converted);
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginScriptableObjectChild::AnswerRemoveProperty(const NPRemoteIdentifier& aId,
|
||||
bool* aSuccess)
|
||||
{
|
||||
|
@ -408,14 +411,14 @@ PluginScriptableObjectChild::AnswerRemoveProperty(const NPRemoteIdentifier& aId,
|
|||
|
||||
if (!(mObject->_class && mObject->_class->removeProperty)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
*aSuccess = mObject->_class->removeProperty(mObject, (NPIdentifier)aId);
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginScriptableObjectChild::AnswerEnumerate(nsTArray<NPRemoteIdentifier>* aProperties,
|
||||
bool* aSuccess)
|
||||
{
|
||||
|
@ -424,20 +427,20 @@ PluginScriptableObjectChild::AnswerEnumerate(nsTArray<NPRemoteIdentifier>* aProp
|
|||
|
||||
if (!(mObject->_class && mObject->_class->enumerate)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
NPIdentifier* ids;
|
||||
uint32_t idCount;
|
||||
if (!mObject->_class->enumerate(mObject, &ids, &idCount)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!aProperties->SetCapacity(idCount)) {
|
||||
PluginModuleChild::sBrowserFuncs.memfree(ids);
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
for (uint32_t index = 0; index < idCount; index++) {
|
||||
|
@ -450,10 +453,10 @@ PluginScriptableObjectChild::AnswerEnumerate(nsTArray<NPRemoteIdentifier>* aProp
|
|||
|
||||
PluginModuleChild::sBrowserFuncs.memfree(ids);
|
||||
*aSuccess = true;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PluginScriptableObjectChild::AnswerConstruct(const nsTArray<NPRemoteVariant>& aArgs,
|
||||
NPRemoteVariant* aResult,
|
||||
bool* aSuccess)
|
||||
|
@ -463,7 +466,7 @@ PluginScriptableObjectChild::AnswerConstruct(const nsTArray<NPRemoteVariant>& aA
|
|||
|
||||
if (!(mObject->_class && mObject->_class->construct)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsAutoTArray<NPVariant, 10> convertedArgs;
|
||||
|
@ -471,13 +474,13 @@ PluginScriptableObjectChild::AnswerConstruct(const nsTArray<NPRemoteVariant>& aA
|
|||
|
||||
if (!convertedArgs.SetLength(argCount)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
for (PRUint32 index = 0; index < argCount; index++) {
|
||||
if (!ConvertToVariant(aArgs[index], convertedArgs[index])) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -486,16 +489,16 @@ PluginScriptableObjectChild::AnswerConstruct(const nsTArray<NPRemoteVariant>& aA
|
|||
argCount, &result);
|
||||
if (!success) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
NPRemoteVariant convertedResult;
|
||||
if (!ConvertToRemoteVariant(result, convertedResult, mInstance)) {
|
||||
*aSuccess = false;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
*aSuccess = true;
|
||||
*aResult = convertedResult;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -54,47 +54,47 @@ public:
|
|||
PluginScriptableObjectChild();
|
||||
virtual ~PluginScriptableObjectChild();
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerInvalidate();
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerHasMethod(const NPRemoteIdentifier& aId,
|
||||
bool* aHasMethod);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerInvoke(const NPRemoteIdentifier& aId,
|
||||
const nsTArray<NPRemoteVariant>& aArgs,
|
||||
NPRemoteVariant* aResult,
|
||||
bool* aSuccess);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerInvokeDefault(const nsTArray<NPRemoteVariant>& aArgs,
|
||||
NPRemoteVariant* aResult,
|
||||
bool* aSuccess);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerHasProperty(const NPRemoteIdentifier& aId,
|
||||
bool* aHasProperty);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerGetProperty(const NPRemoteIdentifier& aId,
|
||||
NPRemoteVariant* aResult,
|
||||
bool* aSuccess);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerSetProperty(const NPRemoteIdentifier& aId,
|
||||
const NPRemoteVariant& aValue,
|
||||
bool* aSuccess);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerRemoveProperty(const NPRemoteIdentifier& aId,
|
||||
bool* aSuccess);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerEnumerate(nsTArray<NPRemoteIdentifier>* aProperties,
|
||||
bool* aSuccess);
|
||||
|
||||
virtual nsresult
|
||||
virtual bool
|
||||
AnswerConstruct(const nsTArray<NPRemoteVariant>& aArgs,
|
||||
NPRemoteVariant* aResult,
|
||||
bool* aSuccess);
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
#if 1
|
||||
#if defined(XP_WIN) && defined(DEBUG_bent)
|
||||
MessageBox(NULL, L"Hi", L"Hi", MB_OK);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -392,8 +392,14 @@ class GenerateProtocolHeader(Visitor):
|
|||
|
||||
opeqswitch.addstmt(caselabel)
|
||||
opeqswitch.addstmt(cxx.StmtExpr(
|
||||
cxx.ExprAssn(cxx.ExprDeref(callptrmeth),
|
||||
cxx.ExprCast(rhsvar, clstyperef, const=1))))
|
||||
cxx.ExprAssn(
|
||||
cxx.ExprDeref(callptrmeth),
|
||||
cxx.ExprCall(
|
||||
cxx.ExprSelect(
|
||||
cxx.ExprCast(rhsvar, clstyperef, const=1),
|
||||
'.',
|
||||
gettypen)))))
|
||||
|
||||
opeqswitch.addstmt(cxx.StmtBreak())
|
||||
|
||||
optype = cxx.MethodDefn(
|
||||
|
@ -808,7 +814,7 @@ class GenerateProtocolHeader(Visitor):
|
|||
method = cxx.MethodDecl(
|
||||
name=md.decl.progname,
|
||||
params=[ ],
|
||||
ret=cxx.Type('nsresult'),
|
||||
ret=cxx.Type('bool'),
|
||||
virtual=1)
|
||||
for param in md._cxx.params:
|
||||
pcopy = deepcopy(param)
|
||||
|
@ -1984,8 +1990,7 @@ class GenerateProtocolActorHeader(Visitor):
|
|||
([ objvar ]
|
||||
+ [ cxx.ExprVar(p.name) for p in md._cxx.params ]
|
||||
+ [ cxx.ExprVar(r.name) for r in md._cxx.returns ]))
|
||||
failif = cxx.StmtIf(cxx.ExprCall(
|
||||
cxx.ExprVar('NS_FAILED'), [ calldtor ]))
|
||||
failif = cxx.StmtIf(cxx.ExprPrefixUnop(calldtor, '!'))
|
||||
failif.addifstmt(cxx.StmtReturn(valueerrcode))
|
||||
impl.addstmt(failif)
|
||||
|
||||
|
@ -2181,8 +2186,7 @@ class GenerateProtocolActorHeader(Visitor):
|
|||
callimpl.args += [ cxx.ExprVar(p.name) for p in md._cxx.params ]
|
||||
callimpl.args += [ cxx.ExprAddrOf(cxx.ExprVar(r.name))
|
||||
for r in md._cxx.returns ]
|
||||
errhandle = cxx.StmtIf(cxx.ExprCall(
|
||||
cxx.ExprVar('NS_FAILED'), [ callimpl ]))
|
||||
errhandle = cxx.StmtIf(cxx.ExprPrefixUnop(callimpl, '!'))
|
||||
errhandle.ifb.addstmt(cxx.StmtReturn(
|
||||
cxx.ExprVar('MsgValueError')))
|
||||
block.addstmt(errhandle)
|
||||
|
@ -2196,8 +2200,7 @@ class GenerateProtocolActorHeader(Visitor):
|
|||
+ [ cxx.ExprVar(p.name) for p in md._cxx.params ]
|
||||
+ [ cxx.ExprAddrOf(cxx.ExprVar(r.name)) for
|
||||
r in md._cxx.returns ]))
|
||||
failif = cxx.StmtIf(cxx.ExprCall(
|
||||
cxx.ExprVar('NS_FAILED'), [ calldtor ]))
|
||||
failif = cxx.StmtIf(cxx.ExprPrefixUnop(calldtor, '!'))
|
||||
failif.ifb.addstmt(cxx.StmtReturn(cxx.ExprVar('MsgValueError')))
|
||||
block.addstmt(failif)
|
||||
block.addstmt(cxx.StmtExpr(
|
||||
|
|
|
@ -51,38 +51,38 @@ TestChild::~TestChild()
|
|||
#if 1
|
||||
//-----------------------------------------------------------------------------
|
||||
// "Hello world" example
|
||||
nsresult TestChild::RecvHello()
|
||||
bool TestChild::RecvHello()
|
||||
{
|
||||
puts("[TestChild] Hello, ");
|
||||
SendWorld();
|
||||
return NS_OK;
|
||||
puts("[TestChild] Hello, ");
|
||||
SendWorld();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#elif 0
|
||||
//-----------------------------------------------------------------------------
|
||||
// Example solution to exercise
|
||||
nsresult TestChild::RecvPing()
|
||||
bool TestChild::RecvPing()
|
||||
{
|
||||
return SendPong(42);
|
||||
return SendPong(42);
|
||||
}
|
||||
|
||||
nsresult TestChild::RecvPong(const int& status)
|
||||
bool TestChild::RecvPong(const int& status)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
return false;
|
||||
}
|
||||
|
||||
nsresult TestChild::RecvTellValue(
|
||||
bool TestChild::RecvTellValue(
|
||||
const String& key,
|
||||
const String& val)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
return false;
|
||||
}
|
||||
|
||||
nsresult TestChild::RecvTellValues(
|
||||
bool TestChild::RecvTellValues(
|
||||
const StringArray& keys,
|
||||
const StringArray& vals)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -51,18 +51,18 @@ protected:
|
|||
#if 1
|
||||
//-----------------------------------------------------------------------------
|
||||
// "Hello world" example
|
||||
virtual nsresult RecvHello();
|
||||
virtual bool RecvHello();
|
||||
|
||||
|
||||
#elif 0
|
||||
//-----------------------------------------------------------------------------
|
||||
// Example solution to exercise
|
||||
virtual nsresult RecvPing();
|
||||
virtual nsresult RecvPong(const int& status);
|
||||
virtual nsresult RecvTellValue(
|
||||
virtual bool RecvPing();
|
||||
virtual bool RecvPong(const int& status);
|
||||
virtual bool RecvTellValue(
|
||||
const String& key,
|
||||
const String& val);
|
||||
virtual nsresult RecvTellValues(
|
||||
virtual bool RecvTellValues(
|
||||
const StringArray& keys,
|
||||
const StringArray& vals);
|
||||
#endif
|
||||
|
|
|
@ -53,11 +53,11 @@ void
|
|||
TestParent::DoStuff()
|
||||
{
|
||||
#if 1
|
||||
puts("[TestParent] in DoStuff()");
|
||||
SendHello();
|
||||
puts("[TestParent] in DoStuff()");
|
||||
SendHello();
|
||||
#elif 0
|
||||
puts("[TestParent] pinging child ...");
|
||||
SendPing();
|
||||
puts("[TestParent] pinging child ...");
|
||||
SendPing();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -65,43 +65,43 @@ TestParent::DoStuff()
|
|||
#if 1
|
||||
//-----------------------------------------------------------------------------
|
||||
// "Hello world" exampl
|
||||
nsresult TestParent::RecvWorld()
|
||||
bool TestParent::RecvWorld()
|
||||
{
|
||||
puts("[TestParent] world!");
|
||||
return NS_OK;
|
||||
puts("[TestParent] world!");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#elif 0
|
||||
//-----------------------------------------------------------------------------
|
||||
// Example solution to exercise
|
||||
nsresult TestParent::RecvPing()
|
||||
bool TestParent::RecvPing()
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
return false;
|
||||
}
|
||||
|
||||
nsresult TestParent::RecvPong(const int& status)
|
||||
bool TestParent::RecvPong(const int& status)
|
||||
{
|
||||
printf("[TestParent] child replied to ping with status code %d\n", status);
|
||||
return NS_OK;
|
||||
printf("[TestParent] child replied to ping with status code %d\n", status);
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult TestParent::RecvGetValue(const String& key)
|
||||
bool TestParent::RecvGetValue(const String& key)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
return false;
|
||||
}
|
||||
|
||||
nsresult TestParent::RecvGetValues(const StringArray& keys)
|
||||
bool TestParent::RecvGetValues(const StringArray& keys)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
return false;
|
||||
}
|
||||
|
||||
nsresult TestParent::RecvSetValue(
|
||||
bool TestParent::RecvSetValue(
|
||||
const String& key,
|
||||
const String& val,
|
||||
bool* ok)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -50,17 +50,17 @@ protected:
|
|||
#if 1
|
||||
//-----------------------------------------------------------------------------
|
||||
// "Hello world" example
|
||||
virtual nsresult RecvWorld();
|
||||
virtual bool RecvWorld();
|
||||
|
||||
|
||||
#elif 0
|
||||
//-----------------------------------------------------------------------------
|
||||
// Example solution to exercise
|
||||
virtual nsresult RecvPing();
|
||||
virtual nsresult RecvPong(const int& status);
|
||||
virtual nsresult RecvGetValue(const String& key);
|
||||
virtual nsresult RecvGetValues(const StringArray& keys);
|
||||
virtual nsresult RecvSetValue(
|
||||
virtual bool RecvPing();
|
||||
virtual bool RecvPong(const int& status);
|
||||
virtual bool RecvGetValue(const String& key);
|
||||
virtual bool RecvGetValues(const StringArray& keys);
|
||||
virtual bool RecvSetValue(
|
||||
const String& key,
|
||||
const String& val,
|
||||
bool* ok);
|
||||
|
|
|
@ -45,15 +45,15 @@ TestShellChild::TestShellChild()
|
|||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
TestShellChild::RecvExecuteCommand(const nsString& aCommand)
|
||||
{
|
||||
if (mXPCShell->IsQuitting()) {
|
||||
NS_WARNING("Commands sent after quit command issued!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
return false;
|
||||
}
|
||||
|
||||
return mXPCShell->EvaluateString(aCommand) ? NS_OK : NS_ERROR_FAILURE;
|
||||
return mXPCShell->EvaluateString(aCommand);
|
||||
}
|
||||
|
||||
PTestShellCommandChild*
|
||||
|
@ -62,33 +62,27 @@ TestShellChild::PTestShellCommandConstructor(const nsString& aCommand)
|
|||
return new PTestShellCommandChild();
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
TestShellChild::PTestShellCommandDestructor(PTestShellCommandChild* aCommand,
|
||||
const nsString& aResponse)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCommand);
|
||||
delete aCommand;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
TestShellChild::RecvPTestShellCommandConstructor(PTestShellCommandChild* aActor,
|
||||
const nsString& aCommand)
|
||||
{
|
||||
NS_ASSERTION(aActor, "Shouldn't be null!");
|
||||
|
||||
if (mXPCShell->IsQuitting()) {
|
||||
NS_WARNING("Commands sent after quit command issued!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
return false;
|
||||
}
|
||||
|
||||
nsString response;
|
||||
if (!mXPCShell->EvaluateString(aCommand, &response)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
return false;
|
||||
}
|
||||
|
||||
nsresult rv = SendPTestShellCommandDestructor(aActor, response);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return NS_OK;
|
||||
return SendPTestShellCommandDestructor(aActor, response);
|
||||
}
|
||||
|
|
|
@ -53,17 +53,17 @@ class TestShellChild : public PTestShellChild
|
|||
public:
|
||||
TestShellChild();
|
||||
|
||||
nsresult
|
||||
bool
|
||||
RecvExecuteCommand(const nsString& aCommand);
|
||||
|
||||
PTestShellCommandChild*
|
||||
PTestShellCommandConstructor(const nsString& aCommand);
|
||||
|
||||
nsresult
|
||||
bool
|
||||
RecvPTestShellCommandConstructor(PTestShellCommandChild* aActor,
|
||||
const nsString& aCommand);
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PTestShellCommandDestructor(PTestShellCommandChild* aCommand,
|
||||
const nsString& aResponse);
|
||||
|
||||
|
|
|
@ -48,28 +48,25 @@ TestShellParent::PTestShellCommandConstructor(const nsString& aCommand)
|
|||
return new TestShellCommandParent();
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
TestShellParent::PTestShellCommandDestructor(PTestShellCommandParent* aActor,
|
||||
const nsString& aResponse)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aActor);
|
||||
delete aActor;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
TestShellParent::RecvPTestShellCommandDestructor(PTestShellCommandParent* aActor,
|
||||
const nsString& aResponse)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aActor);
|
||||
|
||||
TestShellCommandParent* command =
|
||||
reinterpret_cast<TestShellCommandParent*>(aActor);
|
||||
|
||||
JSBool ok = command->RunCallback(aResponse);
|
||||
command->ReleaseCallback();
|
||||
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
JSBool
|
||||
|
|
|
@ -70,11 +70,11 @@ public:
|
|||
PTestShellCommandParent*
|
||||
PTestShellCommandConstructor(const nsString& aCommand);
|
||||
|
||||
nsresult
|
||||
bool
|
||||
PTestShellCommandDestructor(PTestShellCommandParent* aActor,
|
||||
const nsString& aResponse);
|
||||
|
||||
nsresult
|
||||
bool
|
||||
RecvPTestShellCommandDestructor(PTestShellCommandParent* aActor,
|
||||
const nsString& aResponse);
|
||||
};
|
||||
|
|
|
@ -73,11 +73,11 @@ NeckoChild::PHttpChannelConstructor()
|
|||
return new HttpChannelChild();
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
NeckoChild::PHttpChannelDestructor(PHttpChannelChild* channel)
|
||||
{
|
||||
delete channel;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
}} // mozilla::net
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
static void InitNeckoChild();
|
||||
|
||||
virtual PHttpChannelChild* PHttpChannelConstructor();
|
||||
virtual nsresult PHttpChannelDestructor(PHttpChannelChild*);
|
||||
virtual bool PHttpChannelDestructor(PHttpChannelChild*);
|
||||
|
||||
protected:
|
||||
};
|
||||
|
|
|
@ -59,11 +59,11 @@ NeckoParent::PHttpChannelConstructor()
|
|||
return new HttpChannelParent();
|
||||
}
|
||||
|
||||
nsresult
|
||||
bool
|
||||
NeckoParent::PHttpChannelDestructor(PHttpChannelParent* channel)
|
||||
{
|
||||
delete channel;
|
||||
return NS_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
|
||||
protected:
|
||||
virtual PHttpChannelParent* PHttpChannelConstructor();
|
||||
virtual nsresult PHttpChannelDestructor(PHttpChannelParent*);
|
||||
virtual bool PHttpChannelDestructor(PHttpChannelParent*);
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
|
|
|
@ -54,9 +54,10 @@ HttpChannelParent::~HttpChannelParent()
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
nsresult HttpChannelParent::RecvasyncOpen(const nsCString& uri)
|
||||
bool HttpChannelParent::RecvasyncOpen(const nsCString& uri)
|
||||
{
|
||||
puts("[HttpChannelParent] got asyncOpen msg");
|
||||
return true;
|
||||
}
|
||||
|
||||
}} // mozilla::net
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
virtual ~HttpChannelParent();
|
||||
|
||||
protected:
|
||||
virtual nsresult RecvasyncOpen(const nsCString& uri);
|
||||
virtual bool RecvasyncOpen(const nsCString& uri);
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
|
|
Загрузка…
Ссылка в новой задаче