--- a/dom/ipc/ContentProcessChild.cpp
+++ b/dom/ipc/ContentProcessChild.cpp
@@ -71,59 +71,59 @@ ContentProcessChild::Init(MessageLoop* a
Open(aChannel, aIOLoop);
sSingleton = this;
return true;
}
PIFrameEmbeddingChild*
-ContentProcessChild::PIFrameEmbeddingConstructor(const MagicWindowHandle& hwnd)
+ContentProcessChild::AllocPIFrameEmbedding(const MagicWindowHandle& hwnd)
{
PIFrameEmbeddingChild* iframe = new TabChild(hwnd);
if (iframe && mIFrames.AppendElement(iframe)) {
return iframe;
}
delete iframe;
return nsnull;
}
bool
-ContentProcessChild::PIFrameEmbeddingDestructor(PIFrameEmbeddingChild* iframe)
+ContentProcessChild::DeallocPIFrameEmbedding(PIFrameEmbeddingChild* iframe)
{
mIFrames.RemoveElement(iframe);
return true;
}
PTestShellChild*
-ContentProcessChild::PTestShellConstructor()
+ContentProcessChild::AllocPTestShell()
{
PTestShellChild* testshell = new TestShellChild();
if (testshell && mTestShells.AppendElement(testshell)) {
return testshell;
}
delete testshell;
return nsnull;
}
bool
-ContentProcessChild::PTestShellDestructor(PTestShellChild* shell)
+ContentProcessChild::DeallocPTestShell(PTestShellChild* shell)
{
mTestShells.RemoveElement(shell);
return true;
}
PNeckoChild*
-ContentProcessChild::PNeckoConstructor()
+ContentProcessChild::AllocPNecko()
{
return new NeckoChild();
}
bool
-ContentProcessChild::PNeckoDestructor(PNeckoChild* necko)
+ContentProcessChild::DeallocPNecko(PNeckoChild* necko)
{
delete necko;
return true;
}
void
ContentProcessChild::Quit()
{
--- a/dom/ipc/ContentProcessChild.h
+++ b/dom/ipc/ContentProcessChild.h
@@ -55,25 +55,25 @@ public:
bool Init(MessageLoop* aIOLoop, IPC::Channel* aChannel);
static ContentProcessChild* GetSingleton() {
NS_ASSERTION(sSingleton, "not initialized");
return sSingleton;
}
- virtual PIFrameEmbeddingChild* PIFrameEmbeddingConstructor(
+ virtual PIFrameEmbeddingChild* AllocPIFrameEmbedding(
const MagicWindowHandle& hwnd);
- virtual bool PIFrameEmbeddingDestructor(PIFrameEmbeddingChild*);
+ virtual bool DeallocPIFrameEmbedding(PIFrameEmbeddingChild*);
- virtual PTestShellChild* PTestShellConstructor();
- virtual bool PTestShellDestructor(PTestShellChild*);
+ virtual PTestShellChild* AllocPTestShell();
+ virtual bool DeallocPTestShell(PTestShellChild*);
- virtual PNeckoChild* PNeckoConstructor();
- virtual bool PNeckoDestructor(PNeckoChild*);
+ virtual PNeckoChild* AllocPNecko();
+ virtual bool DeallocPNecko(PNeckoChild*);
void Quit();
virtual bool RecvQuit();
private:
static ContentProcessChild* sSingleton;
nsTArray<nsAutoPtr<PIFrameEmbeddingChild> > mIFrames;
--- a/dom/ipc/ContentProcessParent.cpp
+++ b/dom/ipc/ContentProcessParent.cpp
@@ -138,49 +138,49 @@ ContentProcessParent::OnWaitableEventSig
// The child process has died! Sadly we're on the wrong thread to do much.
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
MonitorAutoEnter mon(mMonitor);
mSubprocess = nsnull;
mon.Notify();
}
PIFrameEmbeddingParent*
-ContentProcessParent::PIFrameEmbeddingConstructor(
+ContentProcessParent::AllocPIFrameEmbedding(
const MagicWindowHandle& parentWidget)
{
return new TabParent();
}
bool
-ContentProcessParent::PIFrameEmbeddingDestructor(PIFrameEmbeddingParent* frame)
+ContentProcessParent::DeallocPIFrameEmbedding(PIFrameEmbeddingParent* frame)
{
delete frame;
return true;
}
PTestShellParent*
-ContentProcessParent::PTestShellConstructor()
+ContentProcessParent::AllocPTestShell()
{
return new TestShellParent();
}
bool
-ContentProcessParent::PTestShellDestructor(PTestShellParent* shell)
+ContentProcessParent::DeallocPTestShell(PTestShellParent* shell)
{
delete shell;
return true;
}
PNeckoParent*
-ContentProcessParent::PNeckoConstructor()
+ContentProcessParent::AllocPNecko()
{
return new NeckoParent();
}
bool
-ContentProcessParent::PNeckoDestructor(PNeckoParent* necko)
+ContentProcessParent::DeallocPNecko(PNeckoParent* necko)
{
delete necko;
return true;
}
} // namespace dom
} // namespace mozilla
--- a/dom/ipc/ContentProcessParent.h
+++ b/dom/ipc/ContentProcessParent.h
@@ -86,25 +86,25 @@ private:
// Hide the raw constructor methods since we don't want client code
// using them.
using PContentProcessParent::SendPIFrameEmbeddingConstructor;
using PContentProcessParent::SendPTestShellConstructor;
ContentProcessParent();
virtual ~ContentProcessParent();
- virtual PIFrameEmbeddingParent* PIFrameEmbeddingConstructor(
+ virtual PIFrameEmbeddingParent* AllocPIFrameEmbedding(
const MagicWindowHandle& parentWidget);
- virtual bool PIFrameEmbeddingDestructor(PIFrameEmbeddingParent* frame);
+ virtual bool DeallocPIFrameEmbedding(PIFrameEmbeddingParent* frame);
- virtual PTestShellParent* PTestShellConstructor();
- virtual bool PTestShellDestructor(PTestShellParent* shell);
+ virtual PTestShellParent* AllocPTestShell();
+ virtual bool DeallocPTestShell(PTestShellParent* shell);
- virtual PNeckoParent* PNeckoConstructor();
- virtual bool PNeckoDestructor(PNeckoParent* necko);
+ virtual PNeckoParent* AllocPNecko();
+ virtual bool DeallocPNecko(PNeckoParent* necko);
mozilla::Monitor mMonitor;
GeckoChildProcessHost* mSubprocess;
};
} // namespace dom
} // namespace mozilla
--- a/dom/plugins/PluginInstanceChild.cpp
+++ b/dom/plugins/PluginInstanceChild.cpp
@@ -417,82 +417,82 @@ PluginInstanceChild::PluginWindowProc(HW
RemoveProp(hWnd, kPluginInstanceChildProperty);
return res;
}
#endif // OS_WIN
PPluginScriptableObjectChild*
-PluginInstanceChild::PPluginScriptableObjectConstructor()
+PluginInstanceChild::AllocPPluginScriptableObject()
{
nsAutoPtr<PluginScriptableObjectChild>* object =
mScriptableObjects.AppendElement();
NS_ENSURE_TRUE(object, nsnull);
*object = new PluginScriptableObjectChild();
NS_ENSURE_TRUE(*object, nsnull);
return object->get();
}
bool
-PluginInstanceChild::PPluginScriptableObjectDestructor(PPluginScriptableObjectChild* aObject)
+PluginInstanceChild::DeallocPPluginScriptableObject(PPluginScriptableObjectChild* aObject)
{
PluginScriptableObjectChild* object =
reinterpret_cast<PluginScriptableObjectChild*>(aObject);
PRUint32 count = mScriptableObjects.Length();
for (PRUint32 index = 0; index < count; index++) {
if (mScriptableObjects[index] == object) {
mScriptableObjects.RemoveElementAt(index);
break;
}
}
return true;
}
PBrowserStreamChild*
-PluginInstanceChild::PBrowserStreamConstructor(const nsCString& url,
- const uint32_t& length,
- const uint32_t& lastmodified,
- const PStreamNotifyChild* notifyData,
- const nsCString& headers,
- const nsCString& mimeType,
- const bool& seekable,
- NPError* rv,
- uint16_t *stype)
+PluginInstanceChild::AllocPBrowserStream(const nsCString& url,
+ const uint32_t& length,
+ const uint32_t& lastmodified,
+ const PStreamNotifyChild* notifyData,
+ const nsCString& headers,
+ const nsCString& mimeType,
+ const bool& seekable,
+ NPError* rv,
+ uint16_t *stype)
{
return new BrowserStreamChild(this, url, length, lastmodified, headers,
mimeType, seekable, rv, stype);
}
bool
PluginInstanceChild::AnswerPBrowserStreamDestructor(PBrowserStreamChild* stream,
const NPError& reason,
const bool& artificial)
{
if (!artificial)
static_cast<BrowserStreamChild*>(stream)->NPP_DestroyStream(reason);
return true;
}
bool
-PluginInstanceChild::PBrowserStreamDestructor(PBrowserStreamChild* stream,
- const NPError& reason,
- const bool& artificial)
+PluginInstanceChild::DeallocPBrowserStream(PBrowserStreamChild* stream,
+ const NPError& reason,
+ const bool& artificial)
{
delete stream;
return true;
}
PPluginStreamChild*
-PluginInstanceChild::PPluginStreamConstructor(const nsCString& mimeType,
- const nsCString& target,
- NPError* result)
+PluginInstanceChild::AllocPPluginStream(const nsCString& mimeType,
+ const nsCString& target,
+ NPError* result)
{
NS_RUNTIMEABORT("not callable");
return NULL;
}
bool
PluginInstanceChild::AnswerPPluginStreamDestructor(PPluginStreamChild* stream,
const NPReason& reason,
@@ -500,39 +500,39 @@ PluginInstanceChild::AnswerPPluginStream
{
if (!artificial) {
static_cast<PluginStreamChild*>(stream)->NPP_DestroyStream(reason);
}
return true;
}
bool
-PluginInstanceChild::PPluginStreamDestructor(PPluginStreamChild* stream,
- const NPError& reason,
- const bool& artificial)
+PluginInstanceChild::DeallocPPluginStream(PPluginStreamChild* stream,
+ const NPError& reason,
+ const bool& artificial)
{
delete stream;
return true;
}
PStreamNotifyChild*
-PluginInstanceChild::PStreamNotifyConstructor(const nsCString& url,
- const nsCString& target,
- const bool& post,
- const nsCString& buffer,
- const bool& file,
- NPError* result)
+PluginInstanceChild::AllocPStreamNotify(const nsCString& url,
+ const nsCString& target,
+ const bool& post,
+ const nsCString& buffer,
+ const bool& file,
+ NPError* result)
{
NS_RUNTIMEABORT("not reached");
return NULL;
}
bool
-PluginInstanceChild::PStreamNotifyDestructor(PStreamNotifyChild* notifyData,
- const NPReason& reason)
+PluginInstanceChild::DeallocPStreamNotify(PStreamNotifyChild* notifyData,
+ const NPReason& reason)
{
StreamNotifyChild* sn = static_cast<StreamNotifyChild*>(notifyData);
mPluginIface->urlnotify(&mData, sn->mURL.get(), reason, sn->mClosure);
delete sn;
return true;
}
--- a/dom/plugins/PluginInstanceChild.h
+++ b/dom/plugins/PluginInstanceChild.h
@@ -73,66 +73,66 @@ protected:
virtual bool
AnswerNPP_GetValue_NPPVpluginScriptableNPObject(PPluginScriptableObjectChild** value,
NPError* result);
virtual bool
AnswerNPP_HandleEvent(const NPEvent& event, int16_t* handled);
virtual PPluginScriptableObjectChild*
- PPluginScriptableObjectConstructor();
+ AllocPPluginScriptableObject();
virtual bool
- PPluginScriptableObjectDestructor(PPluginScriptableObjectChild* aObject);
+ DeallocPPluginScriptableObject(PPluginScriptableObjectChild* aObject);
virtual PBrowserStreamChild*
- PBrowserStreamConstructor(const nsCString& url,
- const uint32_t& length,
- const uint32_t& lastmodified,
- const PStreamNotifyChild* notifyData,
- const nsCString& headers,
- const nsCString& mimeType,
- const bool& seekable,
- NPError* rv,
- uint16_t *stype);
+ AllocPBrowserStream(const nsCString& url,
+ const uint32_t& length,
+ const uint32_t& lastmodified,
+ const PStreamNotifyChild* notifyData,
+ const nsCString& headers,
+ const nsCString& mimeType,
+ const bool& seekable,
+ NPError* rv,
+ uint16_t *stype);
virtual bool
AnswerPBrowserStreamDestructor(PBrowserStreamChild* stream,
const NPError& reason,
const bool& artificial);
virtual bool
- PBrowserStreamDestructor(PBrowserStreamChild* stream,
- const NPError& reason,
- const bool& artificial);
+ DeallocPBrowserStream(PBrowserStreamChild* stream,
+ const NPError& reason,
+ const bool& artificial);
virtual PPluginStreamChild*
- PPluginStreamConstructor(const nsCString& mimeType,
- const nsCString& target,
- NPError* result);
+ AllocPPluginStream(const nsCString& mimeType,
+ const nsCString& target,
+ NPError* result);
virtual bool
AnswerPPluginStreamDestructor(PPluginStreamChild* stream,
const NPReason& reason,
const bool& artificial);
virtual bool
- PPluginStreamDestructor(PPluginStreamChild* stream,
- const NPReason& reason,
- const bool& artificial);
+ DeallocPPluginStream(PPluginStreamChild* stream,
+ const NPReason& reason,
+ const bool& artificial);
virtual PStreamNotifyChild*
- PStreamNotifyConstructor(const nsCString& url, const nsCString& target,
- const bool& post, const nsCString& buffer,
- const bool& file,
- NPError* result);
+ AllocPStreamNotify(const nsCString& url, const nsCString& target,
+ const bool& post, const nsCString& buffer,
+ const bool& file,
+ NPError* result);
virtual bool
- PStreamNotifyDestructor(PStreamNotifyChild* notifyData,
- const NPReason& reason);
+ DeallocPStreamNotify(PStreamNotifyChild* notifyData,
+ const NPReason& reason);
public:
PluginInstanceChild(const NPPluginFuncs* aPluginIface) :
mPluginIface(aPluginIface)
#if defined(OS_LINUX)
, mPlug(0)
#elif defined(OS_WIN)
, mPluginWindowHWND(0)
--- a/dom/plugins/PluginInstanceParent.cpp
+++ b/dom/plugins/PluginInstanceParent.cpp
@@ -40,25 +40,25 @@
#include "BrowserStreamParent.h"
#include "PluginStreamParent.h"
#include "StreamNotifyParent.h"
namespace mozilla {
namespace plugins {
PBrowserStreamParent*
-PluginInstanceParent::PBrowserStreamConstructor(const nsCString& url,
- const uint32_t& length,
- const uint32_t& lastmodified,
- const PStreamNotifyParent* notifyData,
- const nsCString& headers,
- const nsCString& mimeType,
- const bool& seekable,
- NPError* rv,
- uint16_t *stype)
+PluginInstanceParent::AllocPBrowserStream(const nsCString& url,
+ const uint32_t& length,
+ const uint32_t& lastmodified,
+ const PStreamNotifyParent* notifyData,
+ const nsCString& headers,
+ const nsCString& mimeType,
+ const bool& seekable,
+ NPError* rv,
+ uint16_t *stype)
{
NS_RUNTIMEABORT("Not reachable");
return NULL;
}
bool
PluginInstanceParent::AnswerPBrowserStreamDestructor(PBrowserStreamParent* stream,
const NPError& reason,
@@ -66,36 +66,36 @@ PluginInstanceParent::AnswerPBrowserStre
{
if (!artificial) {
static_cast<BrowserStreamParent*>(stream)->NPN_DestroyStream(reason);
}
return true;
}
bool
-PluginInstanceParent::PBrowserStreamDestructor(PBrowserStreamParent* stream,
- const NPError& reason,
- const bool& artificial)
+PluginInstanceParent::DeallocPBrowserStream(PBrowserStreamParent* stream,
+ const NPError& reason,
+ const bool& artificial)
{
delete stream;
return true;
}
PPluginStreamParent*
-PluginInstanceParent::PPluginStreamConstructor(const nsCString& mimeType,
- const nsCString& target,
- NPError* result)
+PluginInstanceParent::AllocPPluginStream(const nsCString& mimeType,
+ const nsCString& target,
+ NPError* result)
{
return new PluginStreamParent(this, mimeType, target, result);
}
bool
-PluginInstanceParent::PPluginStreamDestructor(PPluginStreamParent* stream,
- const NPError& reason,
- const bool& artificial)
+PluginInstanceParent::DeallocPPluginStream(PPluginStreamParent* stream,
+ const NPError& reason,
+ const bool& artificial)
{
if (!artificial) {
static_cast<PluginStreamParent*>(stream)->NPN_DestroyStream(reason);
}
delete stream;
return true;
}
@@ -171,22 +171,22 @@ PluginInstanceParent::AnswerNPN_PostURL(
NPError* result)
{
*result = mNPNIface->posturl(mNPP, url.get(), target.get(),
buffer.Length(), buffer.get(), file);
return true;
}
PStreamNotifyParent*
-PluginInstanceParent::PStreamNotifyConstructor(const nsCString& url,
- const nsCString& target,
- const bool& post,
- const nsCString& buffer,
- const bool& file,
- NPError* result)
+PluginInstanceParent::AllocPStreamNotify(const nsCString& url,
+ const nsCString& target,
+ const bool& post,
+ const nsCString& buffer,
+ const bool& file,
+ NPError* result)
{
StreamNotifyParent* notifyData = new StreamNotifyParent();
if (!post) {
*result = mNPNIface->geturlnotify(mNPP,
NullableStringGet(url),
NullableStringGet(target),
notifyData);
@@ -198,18 +198,18 @@ PluginInstanceParent::PStreamNotifyConst
buffer.Length(), buffer.get(),
file, notifyData);
}
// TODO: what if this method fails?
return notifyData;
}
bool
-PluginInstanceParent::PStreamNotifyDestructor(PStreamNotifyParent* notifyData,
- const NPReason& reason)
+PluginInstanceParent::DeallocPStreamNotify(PStreamNotifyParent* notifyData,
+ const NPReason& reason)
{
delete notifyData;
return true;
}
NPError
PluginInstanceParent::NPP_SetWindow(NPWindow* aWindow)
{
@@ -308,22 +308,22 @@ PluginInstanceParent::NPP_DestroyStream(
NS_RUNTIMEABORT("Mismatched plugin data");
CallPPluginStreamDestructor(sp, reason, false);
return NPERR_NO_ERROR;
}
}
PPluginScriptableObjectParent*
-PluginInstanceParent::PPluginScriptableObjectConstructor()
+PluginInstanceParent::AllocPPluginScriptableObject()
{
return new PluginScriptableObjectParent();
}
bool
-PluginInstanceParent::PPluginScriptableObjectDestructor(PPluginScriptableObjectParent* aObject)
+PluginInstanceParent::DeallocPPluginScriptableObject(PPluginScriptableObjectParent* aObject)
{
delete aObject;
return true;
}
} // namespace plugins
} // namespace mozilla
--- a/dom/plugins/PluginInstanceParent.h
+++ b/dom/plugins/PluginInstanceParent.h
@@ -66,51 +66,51 @@ public:
{
}
virtual ~PluginInstanceParent()
{
}
virtual PPluginScriptableObjectParent*
- PPluginScriptableObjectConstructor();
+ AllocPPluginScriptableObject();
virtual bool
- PPluginScriptableObjectDestructor(PPluginScriptableObjectParent* aObject);
+ DeallocPPluginScriptableObject(PPluginScriptableObjectParent* aObject);
virtual PBrowserStreamParent*
- PBrowserStreamConstructor(const nsCString& url,
- const uint32_t& length,
- const uint32_t& lastmodified,
- const PStreamNotifyParent* notifyData,
- const nsCString& headers,
- const nsCString& mimeType,
- const bool& seekable,
- NPError* rv,
- uint16_t *stype);
+ AllocPBrowserStream(const nsCString& url,
+ const uint32_t& length,
+ const uint32_t& lastmodified,
+ const PStreamNotifyParent* notifyData,
+ const nsCString& headers,
+ const nsCString& mimeType,
+ const bool& seekable,
+ NPError* rv,
+ uint16_t *stype);
virtual bool
AnswerPBrowserStreamDestructor(PBrowserStreamParent* stream,
const NPError& reason,
const bool& artificial);
virtual bool
- PBrowserStreamDestructor(PBrowserStreamParent* stream,
- const NPError& reason,
- const bool& artificial);
+ DeallocPBrowserStream(PBrowserStreamParent* stream,
+ const NPError& reason,
+ const bool& artificial);
virtual PPluginStreamParent*
- PPluginStreamConstructor(const nsCString& mimeType,
- const nsCString& target,
- NPError* result);
+ AllocPPluginStream(const nsCString& mimeType,
+ const nsCString& target,
+ NPError* result);
virtual bool
- PPluginStreamDestructor(PPluginStreamParent* stream,
- const NPError& reason,
- const bool& artificial);
+ DeallocPPluginStream(PPluginStreamParent* stream,
+ const NPError& reason,
+ const bool& artificial);
virtual bool
AnswerNPN_GetValue_NPNVjavascriptEnabledBool(bool* value, NPError* result);
virtual bool
AnswerNPN_GetValue_NPNVisOfflineBool(bool* value, NPError* result);
virtual bool
AnswerNPN_GetValue_NPNVWindowNPObject(
PPluginScriptableObjectParent** value,
@@ -127,24 +127,24 @@ public:
NPError *result);
virtual bool
AnswerNPN_PostURL(const nsCString& url, const nsCString& target,
const nsCString& buffer, const bool& file,
NPError* result);
virtual PStreamNotifyParent*
- PStreamNotifyConstructor(const nsCString& url, const nsCString& target,
- const bool& post, const nsCString& buffer,
- const bool& file,
- NPError* result);
+ AllocPStreamNotify(const nsCString& url, const nsCString& target,
+ const bool& post, const nsCString& buffer,
+ const bool& file,
+ NPError* result);
virtual bool
- PStreamNotifyDestructor(PStreamNotifyParent* notifyData,
- const NPReason& reason);
+ DeallocPStreamNotify(PStreamNotifyParent* notifyData,
+ const NPReason& reason);
NPError NPP_SetWindow(NPWindow* aWindow);
NPError NPP_GetValue(NPPVariable variable, void *ret_value);
NPError NPP_SetValue(NPNVariable variable, void *value)
{
_MOZ_LOG(__FUNCTION__);
return 1;
--- a/dom/plugins/PluginModuleChild.cpp
+++ b/dom/plugins/PluginModuleChild.cpp
@@ -981,21 +981,21 @@ PluginModuleChild::AnswerNP_Initialize(N
*_retval = mInitializeFunc(&sBrowserFuncs);
return true;
#else
# error Please implement me for your platform
#endif
}
PPluginInstanceChild*
-PluginModuleChild::PPluginInstanceConstructor(const nsCString& aMimeType,
- const uint16_t& aMode,
- const nsTArray<nsCString>& aNames,
- const nsTArray<nsCString>& aValues,
- NPError* rv)
+PluginModuleChild::AllocPPluginInstance(const nsCString& aMimeType,
+ const uint16_t& aMode,
+ const nsTArray<nsCString>& aNames,
+ const nsTArray<nsCString>& aValues,
+ NPError* rv)
{
_MOZ_LOG(__FUNCTION__);
nsAutoPtr<PluginInstanceChild> childInstance(
new PluginInstanceChild(&mFunctions));
if (!childInstance->Initialize()) {
*rv = NPERR_GENERIC_ERROR;
return 0;
@@ -1049,18 +1049,18 @@ PluginModuleChild::AnswerPPluginInstance
return false;
}
printf ("[PluginModuleChild] %s: returning %hd\n", __FUNCTION__, *rv);
return true;
}
bool
-PluginModuleChild::PPluginInstanceDestructor(PPluginInstanceChild* actor,
- NPError* rv)
+PluginModuleChild::DeallocPPluginInstance(PPluginInstanceChild* actor,
+ NPError* rv)
{
_MOZ_LOG(__FUNCTION__);
PluginInstanceChild* inst = static_cast<PluginInstanceChild*>(actor);
*rv = mFunctions.destroy(inst->GetNPP(), 0);
delete actor;
inst->GetNPP()->ndata = 0;
--- a/dom/plugins/PluginModuleChild.h
+++ b/dom/plugins/PluginModuleChild.h
@@ -97,25 +97,25 @@ class PluginScriptableObjectChild;
class PluginModuleChild : public PPluginModuleChild
{
protected:
// Implement the PPluginModuleChild interface
virtual bool AnswerNP_Initialize(NPError* rv);
virtual PPluginInstanceChild*
- PPluginInstanceConstructor(const nsCString& aMimeType,
- const uint16_t& aMode,
- const nsTArray<nsCString>& aNames,
- const nsTArray<nsCString>& aValues,
- NPError* rv);
+ AllocPPluginInstance(const nsCString& aMimeType,
+ const uint16_t& aMode,
+ const nsTArray<nsCString>& aNames,
+ const nsTArray<nsCString>& aValues,
+ NPError* rv);
virtual bool
- PPluginInstanceDestructor(PPluginInstanceChild* aActor,
- NPError* rv);
+ DeallocPPluginInstance(PPluginInstanceChild* aActor,
+ NPError* rv);
virtual bool
AnswerPPluginInstanceConstructor(PPluginInstanceChild* aActor,
const nsCString& aMimeType,
const uint16_t& aMode,
const nsTArray<nsCString>& aNames,
const nsTArray<nsCString>& aValues,
NPError* rv);
--- a/dom/plugins/PluginModuleParent.cpp
+++ b/dom/plugins/PluginModuleParent.cpp
@@ -81,29 +81,29 @@ PluginModuleParent::PluginModuleParent(c
PluginModuleParent::~PluginModuleParent()
{
_MOZ_LOG(" (closing Shim ...)");
delete mShim;
}
PPluginInstanceParent*
-PluginModuleParent::PPluginInstanceConstructor(const nsCString& aMimeType,
- const uint16_t& aMode,
- const nsTArray<nsCString>& aNames,
- const nsTArray<nsCString>& aValues,
- NPError* rv)
+PluginModuleParent::AllocPPluginInstance(const nsCString& aMimeType,
+ const uint16_t& aMode,
+ const nsTArray<nsCString>& aNames,
+ const nsTArray<nsCString>& aValues,
+ NPError* rv)
{
NS_ERROR("Not reachable!");
return NULL;
}
bool
-PluginModuleParent::PPluginInstanceDestructor(PPluginInstanceParent* aActor,
- NPError* _retval)
+PluginModuleParent::DeallocPPluginInstance(PPluginInstanceParent* aActor,
+ NPError* _retval)
{
_MOZ_LOG(__FUNCTION__);
delete aActor;
return true;
}
void
PluginModuleParent::SetPluginFuncs(NPPluginFuncs* aFuncs)
--- a/dom/plugins/PluginModuleParent.h
+++ b/dom/plugins/PluginModuleParent.h
@@ -79,25 +79,25 @@ namespace plugins {
*/
class PluginModuleParent : public PPluginModuleParent
{
private:
typedef mozilla::SharedLibrary SharedLibrary;
protected:
PPluginInstanceParent*
- PPluginInstanceConstructor(const nsCString& aMimeType,
- const uint16_t& aMode,
- const nsTArray<nsCString>& aNames,
- const nsTArray<nsCString>& aValues,
- NPError* rv);
+ AllocPPluginInstance(const nsCString& aMimeType,
+ const uint16_t& aMode,
+ const nsTArray<nsCString>& aNames,
+ const nsTArray<nsCString>& aValues,
+ NPError* rv);
virtual bool
- PPluginInstanceDestructor(PPluginInstanceParent* aActor,
- NPError* _retval);
+ DeallocPPluginInstance(PPluginInstanceParent* aActor,
+ NPError* _retval);
public:
PluginModuleParent(const char* aFilePath);
virtual ~PluginModuleParent();
/**
* LoadModule
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -834,16 +834,23 @@ class GenerateProtocolHeader(Visitor):
# the ID is used by the IPC layer only
md._cxx.id = 'Msg_%s'% (md.decl.progname)
md._cxx.nsid = '%s::%s'% (self.pname, md._cxx.id)
if md.decl.type.hasReply():
md._cxx.replyid = 'Reply_%s'% (md.decl.progname)
md._cxx.nsreplyid = '%s::%s'% (self.pname, md._cxx.replyid)
+ # the names of the factory ctor/dtor the manager (if it exists)
+ # will implement
+ cdtype = md.decl.type.constructedType()
+ if cdtype is not None:
+ md._cxx.alloc = 'Alloc'+ cdtype.name()
+ md._cxx.dealloc = 'Dealloc'+ cdtype.name()
+
def visitTransitionStmt(self, ts):
ts.state.decl._cxxname = 'State_%s__ID'% (ts.state.decl.progname)
def generateMsgClass(md, clsname, params, typedefInjector):
cls = cxx.Class(name=clsname,
inherits=[ cxx.Inherit('IPC::Message') ])
@@ -1219,16 +1226,24 @@ class GenerateProtocolActorHeader(Visito
# message handlers the subclass has to impl
for md in p.messageDecls:
if md.decl.type.isCtor() or md.decl.type.isDtor():
objtype = cxx.Type(
_actorName(md.decl.type.constructedType().name(),
self.myside),
ptr=1)
meth = deepcopy(md._cxx.method)
+
+ if md.decl.type.isCtor():
+ meth.name = md._cxx.alloc
+ elif md.decl.type.isDtor():
+ meth.name = md._cxx.dealloc
+ else:
+ assert 0
+
for param in meth.params:
if param.type.actor:
param.type.name = _actorName(param.type.name,
self.myside)
meth.pure = True
actordecl = cxx.Decl(objtype, '__a')
if md.decl.type.isCtor():
@@ -1553,17 +1568,16 @@ class GenerateProtocolActorHeader(Visito
cxx.ExprSelect(msgptr, '->', 'Log'),
[ cxx.ExprLiteral.String(
'['+ self.clsname +'] '+ note),
cxx.ExprVar('stderr') ])))
block.addstmt(logif)
block.addstmt(cxx.CppDirective('endif', '// ifdef DEBUG'))
block.addstmt(cxx.Whitespace.NL)
-
if self.sendsMessage(md):
pfx = None
if md.decl.type.isRpc():
pfx = 'Call'
else:
pfx = 'Send'
mdecl = deepcopy(md._cxx.method)
@@ -1601,17 +1615,17 @@ class GenerateProtocolActorHeader(Visito
# and internally passes through to the second
# SendActorCtor(Actor*, ...) method
#
# the second relies on the user to pass in a valid
# concrete Actor* instantiation
#
# here |impl| is the first ctor interface above
- callctor = cxx.ExprCall(cxx.ExprVar(md._cxx.method.name),
+ callctor = cxx.ExprCall(cxx.ExprVar(md._cxx.alloc),
[ cxx.ExprVar(p.name) for
p in md._cxx.method.params ])
impl.addstmt(cxx.StmtReturn(
cxx.ExprCall(cxx.ExprVar(mdecl.name),
([ callctor ] +
[ cxx.ExprVar(p.name) for
p in md._cxx.method.params ]))))
self.cls.addstmt(impl)
@@ -2000,17 +2014,17 @@ class GenerateProtocolActorHeader(Visito
# racy dtor messages
if md.decl.type.isDtor():
impl.addstmt(cxx.StmtExpr(
cxx.ExprCall(cxx.ExprVar('Unregister'), [ objid ])))
impl.addstmt(cxx.StmtExpr(
cxx.ExprAssn(objid, cxx.ExprLiteral.ZERO)))
calldtor = cxx.ExprCall(
- cxx.ExprVar(md._cxx.method.name),
+ cxx.ExprVar(md._cxx.dealloc),
([ 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.ExprPrefixUnop(calldtor, '!'))
failif.addifstmt(cxx.StmtReturn(valueerrcode))
impl.addstmt(failif)
impl.addstmt(cxx.StmtReturn(okcode))
@@ -2157,17 +2171,17 @@ class GenerateProtocolActorHeader(Visito
block.addstmt(cxx.Whitespace.NL)
block.addstmt(cxx.StmtDecl(cxx.Decl(objtype, '__a')))
# call the concrete class's "factory" method to
# instantiate a concrete actor
block.addstmt(cxx.StmtExpr(cxx.ExprAssn(
objvar,
cxx.ExprCall(
- cxx.ExprVar(md._cxx.method.name),
+ cxx.ExprVar(md._cxx.alloc),
([ cxx.ExprVar(p.name) for
p in md._cxx.params ]
+ [ cxx.ExprAddrOf(cxx.ExprVar(r.name)) for
r in md._cxx.returns ])))))
errhandle = cxx.StmtIf(cxx.ExprPrefixUnop(objvar, '!'))
errhandle.ifb.addstmt(cxx.StmtReturn(cxx.ExprVar('MsgValueError')))
block.addstmt(errhandle)
@@ -2221,17 +2235,17 @@ class GenerateProtocolActorHeader(Visito
if md.decl.type.isDtor():
block.addstmt(cxx.StmtExpr(
cxx.ExprCall(cxx.ExprVar('Unregister'), [ routevar ])))
block.addstmt(cxx.StmtExpr(
cxx.ExprAssn(cxx.ExprSelect(objvar, '->', 'mId'),
cxx.ExprLiteral.ZERO)))
calldtor = cxx.ExprCall(
- cxx.ExprVar(md._cxx.method.name),
+ cxx.ExprVar(md._cxx.dealloc),
([ objvar ]
+ [ 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.ExprPrefixUnop(calldtor, '!'))
failif.ifb.addstmt(cxx.StmtReturn(cxx.ExprVar('MsgValueError')))
block.addstmt(failif)
--- a/ipc/testshell/TestShellChild.cpp
+++ b/ipc/testshell/TestShellChild.cpp
@@ -52,24 +52,24 @@ TestShellChild::RecvExecuteCommand(const
NS_WARNING("Commands sent after quit command issued!");
return false;
}
return mXPCShell->EvaluateString(aCommand);
}
PTestShellCommandChild*
-TestShellChild::PTestShellCommandConstructor(const nsString& aCommand)
+TestShellChild::AllocPTestShellCommand(const nsString& aCommand)
{
return new PTestShellCommandChild();
}
bool
-TestShellChild::PTestShellCommandDestructor(PTestShellCommandChild* aCommand,
- const nsString& aResponse)
+TestShellChild::DeallocPTestShellCommand(PTestShellCommandChild* aCommand,
+ const nsString& aResponse)
{
delete aCommand;
return true;
}
bool
TestShellChild::RecvPTestShellCommandConstructor(PTestShellCommandChild* aActor,
const nsString& aCommand)
--- a/ipc/testshell/TestShellChild.h
+++ b/ipc/testshell/TestShellChild.h
@@ -52,25 +52,25 @@ class TestShellChild : public PTestShell
{
public:
TestShellChild();
bool
RecvExecuteCommand(const nsString& aCommand);
PTestShellCommandChild*
- PTestShellCommandConstructor(const nsString& aCommand);
+ AllocPTestShellCommand(const nsString& aCommand);
bool
RecvPTestShellCommandConstructor(PTestShellCommandChild* aActor,
const nsString& aCommand);
bool
- PTestShellCommandDestructor(PTestShellCommandChild* aCommand,
- const nsString& aResponse);
+ DeallocPTestShellCommand(PTestShellCommandChild* aCommand,
+ const nsString& aResponse);
void SetXPCShell(XPCShellEnvironment* aXPCShell) {
mXPCShell = aXPCShell;
}
private:
nsAutoPtr<XPCShellEnvironment> mXPCShell;
};
--- a/ipc/testshell/TestShellParent.cpp
+++ b/ipc/testshell/TestShellParent.cpp
@@ -38,24 +38,24 @@
#include "nsAutoPtr.h"
using mozilla::ipc::TestShellParent;
using mozilla::ipc::TestShellCommandParent;
using mozilla::ipc::PTestShellCommandParent;
PTestShellCommandParent*
-TestShellParent::PTestShellCommandConstructor(const nsString& aCommand)
+TestShellParent::AllocPTestShellCommand(const nsString& aCommand)
{
return new TestShellCommandParent();
}
bool
-TestShellParent::PTestShellCommandDestructor(PTestShellCommandParent* aActor,
- const nsString& aResponse)
+TestShellParent::DeallocPTestShellCommand(PTestShellCommandParent* aActor,
+ const nsString& aResponse)
{
delete aActor;
return true;
}
bool
TestShellParent::RecvPTestShellCommandDestructor(PTestShellCommandParent* aActor,
const nsString& aResponse)
--- a/ipc/testshell/TestShellParent.h
+++ b/ipc/testshell/TestShellParent.h
@@ -63,21 +63,21 @@ private:
JSContext* mCx;
nsAutoJSValHolder mCallback;
};
class TestShellParent : public PTestShellParent
{
public:
PTestShellCommandParent*
- PTestShellCommandConstructor(const nsString& aCommand);
+ AllocPTestShellCommand(const nsString& aCommand);
bool
- PTestShellCommandDestructor(PTestShellCommandParent* aActor,
- const nsString& aResponse);
+ DeallocPTestShellCommand(PTestShellCommandParent* aActor,
+ const nsString& aResponse);
bool
RecvPTestShellCommandDestructor(PTestShellCommandParent* aActor,
const nsString& aResponse);
};
} /* namespace ipc */
} /* namespace mozilla */
--- a/netwerk/ipc/NeckoChild.cpp
+++ b/netwerk/ipc/NeckoChild.cpp
@@ -63,22 +63,22 @@ void NeckoChild::InitNeckoChild()
mozilla::dom::ContentProcessChild::GetSingleton();
NS_ASSERTION(cpc, "Content Protocol is NULL!");
gNeckoChild = cpc->SendPNeckoConstructor();
NS_ASSERTION(gNeckoChild, "PNecko Protocol init failed!");
}
}
PHttpChannelChild*
-NeckoChild::PHttpChannelConstructor()
+NeckoChild::AllocPHttpChannel()
{
return new HttpChannelChild();
}
bool
-NeckoChild::PHttpChannelDestructor(PHttpChannelChild* channel)
+NeckoChild::DeallocPHttpChannel(PHttpChannelChild* channel)
{
delete channel;
return true;
}
}} // mozilla::net
--- a/netwerk/ipc/NeckoChild.h
+++ b/netwerk/ipc/NeckoChild.h
@@ -53,18 +53,18 @@ class NeckoChild :
public PNeckoChild
{
public:
NeckoChild();
virtual ~NeckoChild();
static void InitNeckoChild();
- virtual PHttpChannelChild* PHttpChannelConstructor();
- virtual bool PHttpChannelDestructor(PHttpChannelChild*);
+ virtual PHttpChannelChild* AllocPHttpChannel();
+ virtual bool DeallocPHttpChannel(PHttpChannelChild*);
protected:
};
/**
* Reference to the PNecko Child protocol.
* Null if this is not a content process.
*/
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -49,23 +49,23 @@ NeckoParent::NeckoParent()
{
}
NeckoParent::~NeckoParent()
{
}
PHttpChannelParent*
-NeckoParent::PHttpChannelConstructor()
+NeckoParent::AllocPHttpChannel()
{
return new HttpChannelParent();
}
bool
-NeckoParent::PHttpChannelDestructor(PHttpChannelParent* channel)
+NeckoParent::DeallocPHttpChannel(PHttpChannelParent* channel)
{
delete channel;
return true;
}
}} // mozilla::net
--- a/netwerk/ipc/NeckoParent.h
+++ b/netwerk/ipc/NeckoParent.h
@@ -51,16 +51,16 @@ namespace net {
class NeckoParent :
public PNeckoParent
{
public:
NeckoParent();
virtual ~NeckoParent();
protected:
- virtual PHttpChannelParent* PHttpChannelConstructor();
- virtual bool PHttpChannelDestructor(PHttpChannelParent*);
+ virtual PHttpChannelParent* AllocPHttpChannel();
+ virtual bool DeallocPHttpChannel(PHttpChannelParent*);
};
} // namespace net
} // namespace mozilla
#endif // mozilla_net_NeckoParent_h