Bug 784739 - Switch from NULL to nullptr in dom/plugins/ipc/; r=ehsan

This commit is contained in:
Birunthan Mohanathas
2013-10-23 16:34:46 -04:00
parent 1e93f27a06
commit 08cf444a2b
26 changed files with 196 additions and 194 deletions

View File

@@ -84,8 +84,8 @@ static bool gDelayFlashFocusReplyUntilEval = false;
// Used to fix GetWindowInfo problems with internal flash settings dialogs
static WindowsDllInterceptor sUser32Intercept;
typedef BOOL (WINAPI *GetWindowInfoPtr)(HWND hwnd, PWINDOWINFO pwi);
static GetWindowInfoPtr sGetWindowInfoPtrStub = NULL;
static HWND sBrowserHwnd = NULL;
static GetWindowInfoPtr sGetWindowInfoPtrStub = nullptr;
static HWND sBrowserHwnd = nullptr;
#endif
PluginModuleChild::PluginModuleChild()
@@ -102,8 +102,8 @@ PluginModuleChild::PluginModuleChild()
, mNestedLoopTimerObject(0)
#endif
#ifdef OS_WIN
, mNestedEventHook(NULL)
, mGlobalCallWndProcHook(NULL)
, mNestedEventHook(nullptr)
, mGlobalCallWndProcHook(nullptr)
#endif
{
NS_ASSERTION(!gInstance, "Something terribly wrong here!");
@@ -259,9 +259,9 @@ wrap_gtk_plug_dispose(GObject* object) {
// A toggle ref is added to prevent premature deletion of the object
// caused by Flash Player's extra unref, and to detect when there are
// unexpectedly no other references.
g_object_add_toggle_ref(object, undo_bogus_unref, NULL);
g_object_add_toggle_ref(object, undo_bogus_unref, nullptr);
(*real_gtk_plug_dispose)(object);
g_object_remove_toggle_ref(object, undo_bogus_unref, NULL);
g_object_remove_toggle_ref(object, undo_bogus_unref, nullptr);
}
static gboolean
@@ -354,7 +354,7 @@ static void
wrap_gtk_plug_embedded(GtkPlug* plug) {
GdkWindow* socket_window = gtk_plug_get_socket_window(plug);
if (socket_window) {
if (gtk_check_version(2,18,7) != NULL // older
if (gtk_check_version(2,18,7) != nullptr // older
&& g_object_get_data(G_OBJECT(socket_window),
"moz-existed-before-set-window")) {
// Add missing reference for
@@ -405,7 +405,7 @@ PluginModuleChild::DetectNestedEventLoop(gpointer data)
kBrowserEventIntervalMs,
PluginModuleChild::ProcessBrowserEvents,
data,
NULL);
nullptr);
// cancel the nested-loop detection timer
return FALSE;
}
@@ -435,7 +435,7 @@ PluginModuleChild::EnteredCxxStack()
kNestedLoopDetectorIntervalMs,
PluginModuleChild::DetectNestedEventLoop,
this,
NULL);
nullptr);
#ifdef DEBUG
mTopLoopDepth = g_main_depth();
@@ -456,7 +456,7 @@ PluginModuleChild::ExitedCxxStack()
void
PluginModuleChild::EnteredCxxStack()
{
NS_ABORT_IF_FALSE(mNestedLoopTimerObject == NULL,
NS_ABORT_IF_FALSE(mNestedLoopTimerObject == nullptr,
"previous timer not descheduled");
mNestedLoopTimerObject = new NestedLoopTimer(this);
QTimer::singleShot(kNestedLoopDetectorIntervalMs,
@@ -466,10 +466,10 @@ PluginModuleChild::EnteredCxxStack()
void
PluginModuleChild::ExitedCxxStack()
{
NS_ABORT_IF_FALSE(mNestedLoopTimerObject != NULL,
NS_ABORT_IF_FALSE(mNestedLoopTimerObject != nullptr,
"nested loop timeout not scheduled");
delete mNestedLoopTimerObject;
mNestedLoopTimerObject = NULL;
mNestedLoopTimerObject = nullptr;
}
#endif
@@ -712,7 +712,7 @@ const char*
PluginModuleChild::GetUserAgent()
{
if (mUserAgent.IsVoid() && !CallNPN_UserAgent(&mUserAgent))
return NULL;
return nullptr;
return NullableStringGet(mUserAgent);
}
@@ -743,7 +743,7 @@ PluginModuleChild::UnregisterActorForNPObject(NPObject* aObject)
NPObjectData* d = mObjectMap.GetEntry(aObject);
NS_ASSERTION(d, "NPObject not in object table");
if (d) {
d->actor = NULL;
d->actor = nullptr;
}
}
@@ -756,7 +756,7 @@ PluginModuleChild::GetActorForNPObject(NPObject* aObject)
NPObjectData* d = mObjectMap.GetEntry(aObject);
if (!d) {
NS_ERROR("Plugin using object not created with NPN_CreateObject?");
return NULL;
return nullptr;
}
return d->actor;
@@ -1000,8 +1000,8 @@ const NPNetscapeFuncs PluginModuleChild::sBrowserFuncs = {
mozilla::plugins::child::_unscheduletimer,
mozilla::plugins::child::_popupcontextmenu,
mozilla::plugins::child::_convertpoint,
NULL, // handleevent, unimplemented
NULL, // unfocusinstance, unimplemented
nullptr, // handleevent, unimplemented
nullptr, // unfocusinstance, unimplemented
mozilla::plugins::child::_urlredirectresponse,
mozilla::plugins::child::_initasyncsurface,
mozilla::plugins::child::_finalizeasyncsurface,
@@ -1041,7 +1041,7 @@ _geturlnotify(NPP aNPP,
PLUGIN_LOG_DEBUG_FUNCTION;
ENSURE_PLUGIN_THREAD(NPERR_INVALID_PARAM);
if (!aNPP) // NULL check for nspluginwrapper (bug 561690)
if (!aNPP) // nullptr check for nspluginwrapper (bug 561690)
return NPERR_INVALID_INSTANCE_ERROR;
nsCString url = NullableString(aRelativeURL);
@@ -1284,7 +1284,7 @@ _invalidaterect(NPP aNPP,
{
PLUGIN_LOG_DEBUG_FUNCTION;
ENSURE_PLUGIN_THREAD_VOID();
// NULL check for nspluginwrapper (bug 548434)
// nullptr check for nspluginwrapper (bug 548434)
if (aNPP) {
InstCast(aNPP)->InvalidateRect(aInvalidRect);
}
@@ -1546,7 +1546,7 @@ _setexception(NPObject* aNPObj,
ENSURE_PLUGIN_THREAD_VOID();
PluginModuleChild* self = PluginModuleChild::current();
PluginScriptableObjectChild* actor = NULL;
PluginScriptableObjectChild* actor = nullptr;
if (aNPObj) {
actor = self->GetActorForNPObject(aNPObj);
if (!actor) {
@@ -2086,7 +2086,7 @@ PluginModuleChild::NPN_CreateObject(NPP aNPP, NPClass* aClass)
PluginInstanceChild* i = InstCast(aNPP);
if (i->mDeletingHash) {
NS_ERROR("Plugin used NPP after NPP_Destroy");
return NULL;
return nullptr;
}
NPObject* newObject;
@@ -2136,7 +2136,7 @@ PluginModuleChild::NPN_ReleaseObject(NPObject* aNPObj)
return;
}
DeletingObjectEntry* doe = NULL;
DeletingObjectEntry* doe = nullptr;
if (d->instance->mDeletingHash) {
doe = d->instance->mDeletingHash->GetEntry(aNPObj);
if (!doe) {
@@ -2324,7 +2324,7 @@ PluginModuleChild::CallWindowProcHook(int nCode, WPARAM wParam, LPARAM lParam)
// Trap and reply to anything we recognize as the source of a
// potential send message deadlock.
if (nCode >= 0 &&
(InSendMessageEx(NULL)&(ISMEX_REPLIED|ISMEX_SEND)) == ISMEX_SEND) {
(InSendMessageEx(nullptr)&(ISMEX_REPLIED|ISMEX_SEND)) == ISMEX_SEND) {
CWPSTRUCT* pCwp = reinterpret_cast<CWPSTRUCT*>(lParam);
if (pCwp->message == WM_KILLFOCUS) {
// Fix for flash fullscreen window loosing focus. On single
@@ -2340,7 +2340,7 @@ PluginModuleChild::CallWindowProcHook(int nCode, WPARAM wParam, LPARAM lParam)
}
}
return CallNextHookEx(NULL, nCode, wParam, lParam);
return CallNextHookEx(nullptr, nCode, wParam, lParam);
}
LRESULT CALLBACK
@@ -2358,7 +2358,7 @@ PluginModuleChild::NestedInputEventHook(int nCode, WPARAM wParam, LPARAM lParam)
loop->set_os_modal_loop(true);
}
return CallNextHookEx(NULL, nCode, wParam, lParam);
return CallNextHookEx(nullptr, nCode, wParam, lParam);
}
void
@@ -2374,14 +2374,14 @@ PluginModuleChild::SetEventHooks()
// WH_MSGFILTER event hook for detecting modal loops in the child.
mNestedEventHook = SetWindowsHookEx(WH_MSGFILTER,
NestedInputEventHook,
NULL,
nullptr,
GetCurrentThreadId());
// WH_CALLWNDPROC event hook for trapping sync messages sent from
// parent that can cause deadlocks.
mGlobalCallWndProcHook = SetWindowsHookEx(WH_CALLWNDPROC,
CallWindowProcHook,
NULL,
nullptr,
GetCurrentThreadId());
}
@@ -2391,10 +2391,10 @@ PluginModuleChild::ResetEventHooks()
PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
if (mNestedEventHook)
UnhookWindowsHookEx(mNestedEventHook);
mNestedEventHook = NULL;
mNestedEventHook = nullptr;
if (mGlobalCallWndProcHook)
UnhookWindowsHookEx(mGlobalCallWndProcHook);
mGlobalCallWndProcHook = NULL;
mGlobalCallWndProcHook = nullptr;
}
#endif
@@ -2422,7 +2422,7 @@ PluginModuleChild::ProcessNativeEvents() {
bool
PluginModuleChild::AnswerGeckoGetProfile(nsCString* aProfile) {
char* profile = profiler_get_profile();
if (profile != NULL) {
if (profile != nullptr) {
*aProfile = nsCString(profile, strlen(profile));
free(profile);
} else {