зеркало из https://github.com/mozilla/gecko-dev.git
Bug 784739 - Switch from NULL to nullptr in dom/plugins/ipc/; r=ehsan
--HG-- extra : rebase_source : e04ab81d4686a4ab487ba51cb6a221d862760792
This commit is contained in:
Родитель
214bd6ec96
Коммит
ffa374dc41
|
@ -64,7 +64,7 @@ BrowserStreamChild::StreamConstructed(
|
|||
&mStream, seekable, stype);
|
||||
if (rv != NPERR_NO_ERROR) {
|
||||
mState = DELETING;
|
||||
mStreamNotify = NULL;
|
||||
mStreamNotify = nullptr;
|
||||
}
|
||||
else {
|
||||
mState = ALIVE;
|
||||
|
@ -243,7 +243,7 @@ BrowserStreamChild::Deliver()
|
|||
mNotifyPending = false;
|
||||
mStreamNotify->NPP_URLNotify(mStreamStatus);
|
||||
delete mStreamNotify;
|
||||
mStreamNotify = NULL;
|
||||
mStreamNotify = nullptr;
|
||||
}
|
||||
if (DYING == mState && DESTROYED == mDestroyPending
|
||||
&& !mStreamNotify && !mInstanceDying) {
|
||||
|
|
|
@ -61,7 +61,7 @@ BrowserStreamParent::AnswerNPN_RequestRead(const IPCByteRanges& ranges,
|
|||
rp[i].length = ranges[i].length;
|
||||
rp[i].next = &rp[i + 1];
|
||||
}
|
||||
rp[ranges.size() - 1].next = NULL;
|
||||
rp[ranges.size() - 1].next = nullptr;
|
||||
|
||||
*result = mNPP->mNPNIface->requestread(mStream, rp);
|
||||
return true;
|
||||
|
@ -102,7 +102,7 @@ BrowserStreamParent::RecvStreamDestroyed()
|
|||
return false;
|
||||
}
|
||||
|
||||
mStreamPeer = NULL;
|
||||
mStreamPeer = nullptr;
|
||||
|
||||
mState = DELETING;
|
||||
return Send__delete__(this);
|
||||
|
|
|
@ -22,9 +22,9 @@ ChildAsyncCall::ChildAsyncCall(PluginInstanceChild* instance,
|
|||
void
|
||||
ChildAsyncCall::Cancel()
|
||||
{
|
||||
mInstance = NULL;
|
||||
mFunc = NULL;
|
||||
mData = NULL;
|
||||
mInstance = nullptr;
|
||||
mFunc = nullptr;
|
||||
mData = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -18,12 +18,12 @@ const unsigned int MiniShmParent::kDefaultMiniShmSectionSize = 0x1000;
|
|||
|
||||
MiniShmParent::MiniShmParent()
|
||||
: mSectionSize(0),
|
||||
mParentEvent(NULL),
|
||||
mParentGuard(NULL),
|
||||
mChildEvent(NULL),
|
||||
mChildGuard(NULL),
|
||||
mRegWait(NULL),
|
||||
mFileMapping(NULL),
|
||||
mParentEvent(nullptr),
|
||||
mParentGuard(nullptr),
|
||||
mChildEvent(nullptr),
|
||||
mChildGuard(nullptr),
|
||||
mRegWait(nullptr),
|
||||
mFileMapping(nullptr),
|
||||
mView(nullptr),
|
||||
mIsConnected(false),
|
||||
mTimeout(INFINITE)
|
||||
|
@ -40,23 +40,23 @@ MiniShmParent::CleanUp()
|
|||
{
|
||||
if (mRegWait) {
|
||||
::UnregisterWaitEx(mRegWait, INVALID_HANDLE_VALUE);
|
||||
mRegWait = NULL;
|
||||
mRegWait = nullptr;
|
||||
}
|
||||
if (mParentEvent) {
|
||||
::CloseHandle(mParentEvent);
|
||||
mParentEvent = NULL;
|
||||
mParentEvent = nullptr;
|
||||
}
|
||||
if (mParentGuard) {
|
||||
::CloseHandle(mParentGuard);
|
||||
mParentGuard = NULL;
|
||||
mParentGuard = nullptr;
|
||||
}
|
||||
if (mChildEvent) {
|
||||
::CloseHandle(mChildEvent);
|
||||
mChildEvent = NULL;
|
||||
mChildEvent = nullptr;
|
||||
}
|
||||
if (mChildGuard) {
|
||||
::CloseHandle(mChildGuard);
|
||||
mChildGuard = NULL;
|
||||
mChildGuard = nullptr;
|
||||
}
|
||||
if (mView) {
|
||||
::UnmapViewOfFile(mView);
|
||||
|
@ -64,7 +64,7 @@ MiniShmParent::CleanUp()
|
|||
}
|
||||
if (mFileMapping) {
|
||||
::CloseHandle(mFileMapping);
|
||||
mFileMapping = NULL;
|
||||
mFileMapping = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,8 +65,8 @@ struct ParamTraits<mozilla::plugins::NPRemoteEvent>
|
|||
aMsg->WriteUnsignedChar(aParam.event.data.focus.hasFocus);
|
||||
break;
|
||||
case NPCocoaEventDrawRect:
|
||||
// We don't write out the context pointer, it would always be NULL
|
||||
// and is just filled in as such on the read.
|
||||
// We don't write out the context pointer, it would always be
|
||||
// nullptr and is just filled in as such on the read.
|
||||
aMsg->WriteDouble(aParam.event.data.draw.x);
|
||||
aMsg->WriteDouble(aParam.event.data.draw.y);
|
||||
aMsg->WriteDouble(aParam.event.data.draw.width);
|
||||
|
@ -153,7 +153,7 @@ struct ParamTraits<mozilla::plugins::NPRemoteEvent>
|
|||
}
|
||||
break;
|
||||
case NPCocoaEventDrawRect:
|
||||
aResult->event.data.draw.context = NULL;
|
||||
aResult->event.data.draw.context = nullptr;
|
||||
if (!aMsg->ReadDouble(aIter, &aResult->event.data.draw.x)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace mozilla {
|
|||
namespace plugins {
|
||||
|
||||
NestedLoopTimer::NestedLoopTimer(PluginModuleChild *pmc):
|
||||
QObject(), mModule(pmc), mQTimer(NULL)
|
||||
QObject(), mModule(pmc), mQTimer(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ NestedLoopTimer::~NestedLoopTimer()
|
|||
if (mQTimer) {
|
||||
mQTimer->stop();
|
||||
delete mQTimer;
|
||||
mQTimer = NULL;
|
||||
mQTimer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -79,10 +79,10 @@ PluginHangUIParent::PluginHangUIParent(PluginModuleParent* aModule,
|
|||
mMainThreadMessageLoop(MessageLoop::current()),
|
||||
mIsShowing(false),
|
||||
mLastUserResponse(0),
|
||||
mHangUIProcessHandle(NULL),
|
||||
mMainWindowHandle(NULL),
|
||||
mRegWait(NULL),
|
||||
mShowEvent(NULL),
|
||||
mHangUIProcessHandle(nullptr),
|
||||
mMainWindowHandle(nullptr),
|
||||
mRegWait(nullptr),
|
||||
mShowEvent(nullptr),
|
||||
mShowTicks(0),
|
||||
mResponseTicks(0)
|
||||
{
|
||||
|
@ -224,7 +224,7 @@ PluginHangUIParent::Init(const nsString& aPluginName)
|
|||
}
|
||||
commandLine.AppendLooseValue(ipcCookie);
|
||||
|
||||
ScopedHandle showEvent(::CreateEvent(NULL, FALSE, FALSE, NULL));
|
||||
ScopedHandle showEvent(::CreateEvent(nullptr, FALSE, FALSE, nullptr));
|
||||
if (!showEvent.IsValid()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ PluginHangUIParent::Init(const nsString& aPluginName)
|
|||
|
||||
MutexAutoLock lock(mMutex);
|
||||
STARTUPINFO startupInfo = { sizeof(STARTUPINFO) };
|
||||
PROCESS_INFORMATION processInfo = { NULL };
|
||||
PROCESS_INFORMATION processInfo = { nullptr };
|
||||
BOOL isProcessCreated = ::CreateProcess(exePath.value().c_str(),
|
||||
const_cast<wchar_t*>(commandLine.command_line_string().c_str()),
|
||||
nullptr,
|
||||
|
@ -261,7 +261,7 @@ PluginHangUIParent::Init(const nsString& aPluginName)
|
|||
// processes, which is not what we want.
|
||||
mIsShowing = true;
|
||||
}
|
||||
mShowEvent = NULL;
|
||||
mShowEvent = nullptr;
|
||||
return !(!isProcessCreated);
|
||||
}
|
||||
|
||||
|
@ -286,11 +286,11 @@ PluginHangUIParent::UnwatchHangUIChildProcess(bool aWait)
|
|||
{
|
||||
mMutex.AssertCurrentThreadOwns();
|
||||
if (mRegWait) {
|
||||
// If aWait is false then we want to pass a NULL (i.e. default constructor)
|
||||
// completionEvent
|
||||
// If aWait is false then we want to pass a nullptr (i.e. default
|
||||
// constructor) completionEvent
|
||||
ScopedHandle completionEvent;
|
||||
if (aWait) {
|
||||
completionEvent.Set(::CreateEvent(NULL, FALSE, FALSE, NULL));
|
||||
completionEvent.Set(::CreateEvent(nullptr, FALSE, FALSE, nullptr));
|
||||
if (!completionEvent.IsValid()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -301,7 +301,7 @@ PluginHangUIParent::UnwatchHangUIChildProcess(bool aWait)
|
|||
// callback is running but will be cleaned up once the callback returns.
|
||||
if (::UnregisterWaitEx(mRegWait, completionEvent) ||
|
||||
!aWait && ::GetLastError() == ERROR_IO_PENDING) {
|
||||
mRegWait = NULL;
|
||||
mRegWait = nullptr;
|
||||
if (aWait) {
|
||||
// We must temporarily unlock mMutex while waiting for the registered
|
||||
// wait callback to complete, or else we could deadlock.
|
||||
|
@ -374,7 +374,7 @@ PluginHangUIParent::RecvUserResponse(const unsigned int& aResponse)
|
|||
nsresult
|
||||
PluginHangUIParent::GetHangUIOwnerWindowHandle(NativeWindowHandle& windowHandle)
|
||||
{
|
||||
windowHandle = NULL;
|
||||
windowHandle = nullptr;
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIWindowMediator> winMediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID,
|
||||
|
|
|
@ -102,7 +102,7 @@ void
|
|||
PluginIdentifierChildString::Hash()
|
||||
{
|
||||
PluginModuleChild* module = static_cast<PluginModuleChild*>(Manager());
|
||||
NS_ASSERTION(module->mStringIdentifiers.Get(mString) == NULL, "Replacing Hash?");
|
||||
NS_ASSERTION(module->mStringIdentifiers.Get(mString) == nullptr, "Replacing Hash?");
|
||||
module->mStringIdentifiers.Put(mString, this);
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ void
|
|||
PluginIdentifierChildInt::Hash()
|
||||
{
|
||||
PluginModuleChild* module = static_cast<PluginModuleChild*>(Manager());
|
||||
NS_ASSERTION(module->mIntIdentifiers.Get(mInt) == NULL, "Replacing Hash?");
|
||||
NS_ASSERTION(module->mIntIdentifiers.Get(mInt) == nullptr, "Replacing Hash?");
|
||||
module->mIntIdentifiers.Put(mInt, this);
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
|
||||
protected:
|
||||
PluginIdentifierChild(bool aIsString)
|
||||
: mCanonicalIdentifier(NULL)
|
||||
: mCanonicalIdentifier(nullptr)
|
||||
, mHashed(false)
|
||||
, mTemporaryRefs(0)
|
||||
, mIsString(aIsString)
|
||||
|
@ -99,7 +99,7 @@ private:
|
|||
// In order to deal with temporary identifiers which appear on the stack,
|
||||
// identifiers use the following state invariants:
|
||||
//
|
||||
// * mCanonicalIdentifier is non-NULL: this is a duplicate identifier, no
|
||||
// * mCanonicalIdentifier is non-nullptr: this is a duplicate identifier, no
|
||||
// further information is necessary.
|
||||
// * mHashed is false: this identifier is a newborn, non-permanent identifier
|
||||
// * mHashed is true, mTemporaryRefs is 0: this identifier is permanent
|
||||
|
|
|
@ -50,7 +50,7 @@ PluginIdentifierParent::StackIdentifier::StackIdentifier
|
|||
|
||||
PluginIdentifierParent::StackIdentifier::StackIdentifier
|
||||
(NPObject* aObject, NPIdentifier aIdentifier)
|
||||
: mIdentifier(NULL)
|
||||
: mIdentifier(nullptr)
|
||||
{
|
||||
PluginInstanceParent* inst = GetInstance(aObject);
|
||||
mIdentifier = inst->Module()->GetIdentifierForNPIdentifier(inst->GetNPP(), aIdentifier);
|
||||
|
|
|
@ -68,8 +68,8 @@ typedef BOOL (WINAPI *User32TrackPopupMenu)(HMENU hMenu,
|
|||
HWND hWnd,
|
||||
CONST RECT *prcRect);
|
||||
static WindowsDllInterceptor sUser32Intercept;
|
||||
static HWND sWinlessPopupSurrogateHWND = NULL;
|
||||
static User32TrackPopupMenu sUser32TrackPopupMenuStub = NULL;
|
||||
static HWND sWinlessPopupSurrogateHWND = nullptr;
|
||||
static User32TrackPopupMenu sUser32TrackPopupMenuStub = nullptr;
|
||||
|
||||
using mozilla::gfx::SharedDIB;
|
||||
|
||||
|
@ -131,8 +131,8 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface)
|
|||
#endif
|
||||
, mLayersRendering(false)
|
||||
#ifdef XP_WIN
|
||||
, mCurrentSurfaceActor(NULL)
|
||||
, mBackSurfaceActor(NULL)
|
||||
, mCurrentSurfaceActor(nullptr)
|
||||
, mBackSurfaceActor(nullptr)
|
||||
#endif
|
||||
, mAccumulatedInvalidRect(0,0,0,0)
|
||||
, mIsTransparent(false)
|
||||
|
@ -152,8 +152,8 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface)
|
|||
mWindow.ws_info = &mWsInfo;
|
||||
memset(&mWsInfo, 0, sizeof(mWsInfo));
|
||||
#if (MOZ_WIDGET_GTK == 2)
|
||||
mWsInfo.display = NULL;
|
||||
mXtClient.top_widget = NULL;
|
||||
mWsInfo.display = nullptr;
|
||||
mXtClient.top_widget = nullptr;
|
||||
#else
|
||||
mWsInfo.display = DefaultXDisplay();
|
||||
#endif
|
||||
|
@ -197,7 +197,7 @@ NPError
|
|||
PluginInstanceChild::InternalGetNPObjectForValue(NPNVariable aValue,
|
||||
NPObject** aObject)
|
||||
{
|
||||
PluginScriptableObjectChild* actor = NULL;
|
||||
PluginScriptableObjectChild* actor = nullptr;
|
||||
NPError result = NPERR_NO_ERROR;
|
||||
|
||||
switch (aValue) {
|
||||
|
@ -675,7 +675,7 @@ PluginInstanceChild::AnswerNPP_GetValue_NPPVpluginNativeAccessibleAtkPlugId(
|
|||
|
||||
#if MOZ_ACCESSIBILITY_ATK
|
||||
|
||||
char* plugId = NULL;
|
||||
char* plugId = nullptr;
|
||||
NPError result = NPERR_GENERIC_ERROR;
|
||||
if (mPluginIface->getvalue) {
|
||||
result = mPluginIface->getvalue(GetNPP(),
|
||||
|
@ -1058,7 +1058,7 @@ void PluginInstanceChild::DeleteWindow()
|
|||
if (mXtClient.top_widget) {
|
||||
xt_client_unrealize(&mXtClient);
|
||||
xt_client_destroy(&mXtClient);
|
||||
mXtClient.top_widget = NULL;
|
||||
mXtClient.top_widget = nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1103,7 +1103,7 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
|
|||
}
|
||||
|
||||
#if (MOZ_WIDGET_GTK == 2)
|
||||
if (mXEmbed && gtk_check_version(2,18,7) != NULL) { // older
|
||||
if (mXEmbed && gtk_check_version(2,18,7) != nullptr) { // older
|
||||
if (aWindow.type == NPWindowTypeWindow) {
|
||||
GdkWindow* socket_window = gdk_window_lookup(static_cast<GdkNativeWindow>(aWindow.window));
|
||||
if (socket_window) {
|
||||
|
@ -1117,7 +1117,7 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
|
|||
}
|
||||
|
||||
if (aWindow.visualID != None
|
||||
&& gtk_check_version(2, 12, 10) != NULL) { // older
|
||||
&& gtk_check_version(2, 12, 10) != nullptr) { // older
|
||||
// Workaround for a bug in Gtk+ (prior to 2.12.10) where deleting
|
||||
// a foreign GdkColormap will also free the XColormap.
|
||||
// http://git.gnome.org/browse/gtk+/log/gdk/x11/gdkcolor-x11.c?id=GTK_2_12_10
|
||||
|
@ -1287,7 +1287,7 @@ PluginInstanceChild::RegisterWindowClass()
|
|||
wcex.lpfnWndProc = DummyWindowProc;
|
||||
wcex.cbClsExtra = 0;
|
||||
wcex.cbWndExtra = 0;
|
||||
wcex.hInstance = GetModuleHandle(NULL);
|
||||
wcex.hInstance = GetModuleHandle(nullptr);
|
||||
wcex.hIcon = 0;
|
||||
wcex.hCursor = 0;
|
||||
wcex.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_WINDOW + 1);
|
||||
|
@ -1314,7 +1314,7 @@ PluginInstanceChild::CreatePluginWindow()
|
|||
WS_EX_RIGHTSCROLLBAR,
|
||||
kWindowClassName, 0,
|
||||
WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0,
|
||||
0, 0, NULL, 0, GetModuleHandle(NULL), 0);
|
||||
0, 0, nullptr, 0, GetModuleHandle(nullptr), 0);
|
||||
if (!mPluginWindowHWND)
|
||||
return false;
|
||||
if (!SetProp(mPluginWindowHWND, kPluginInstanceChildProperty, this))
|
||||
|
@ -1373,7 +1373,7 @@ PluginInstanceChild::SizePluginWindow(int width,
|
|||
if (mPluginWindowHWND) {
|
||||
mPluginSize.x = width;
|
||||
mPluginSize.y = height;
|
||||
SetWindowPos(mPluginWindowHWND, NULL, 0, 0, width, height,
|
||||
SetWindowPos(mPluginWindowHWND, nullptr, 0, 0, width, height,
|
||||
SWP_NOZORDER | SWP_NOREPOSITION);
|
||||
}
|
||||
}
|
||||
|
@ -1446,7 +1446,7 @@ PluginInstanceChild::PluginWindowProcInternal(HWND hWnd,
|
|||
// Prevent lockups due to plugins making rpc calls when the parent
|
||||
// is making a synchronous SendMessage call to the child window. Add
|
||||
// more messages as needed.
|
||||
if ((InSendMessageEx(NULL)&(ISMEX_REPLIED|ISMEX_SEND)) == ISMEX_SEND) {
|
||||
if ((InSendMessageEx(nullptr)&(ISMEX_REPLIED|ISMEX_SEND)) == ISMEX_SEND) {
|
||||
switch(message) {
|
||||
case WM_KILLFOCUS:
|
||||
ReplyMessage(0);
|
||||
|
@ -1516,8 +1516,8 @@ typedef LONG_PTR
|
|||
(WINAPI *User32SetWindowLongPtrW)(HWND hWnd,
|
||||
int nIndex,
|
||||
LONG_PTR dwNewLong);
|
||||
static User32SetWindowLongPtrA sUser32SetWindowLongAHookStub = NULL;
|
||||
static User32SetWindowLongPtrW sUser32SetWindowLongWHookStub = NULL;
|
||||
static User32SetWindowLongPtrA sUser32SetWindowLongAHookStub = nullptr;
|
||||
static User32SetWindowLongPtrW sUser32SetWindowLongWHookStub = nullptr;
|
||||
#else
|
||||
typedef LONG
|
||||
(WINAPI *User32SetWindowLongA)(HWND hWnd,
|
||||
|
@ -1527,8 +1527,8 @@ typedef LONG
|
|||
(WINAPI *User32SetWindowLongW)(HWND hWnd,
|
||||
int nIndex,
|
||||
LONG dwNewLong);
|
||||
static User32SetWindowLongA sUser32SetWindowLongAHookStub = NULL;
|
||||
static User32SetWindowLongW sUser32SetWindowLongWHookStub = NULL;
|
||||
static User32SetWindowLongA sUser32SetWindowLongAHookStub = nullptr;
|
||||
static User32SetWindowLongW sUser32SetWindowLongWHookStub = nullptr;
|
||||
#endif
|
||||
|
||||
extern LRESULT CALLBACK
|
||||
|
@ -1694,7 +1694,7 @@ PluginInstanceChild::TrackPopupHookProc(HMENU hMenu,
|
|||
}
|
||||
|
||||
HWND surrogateHwnd = sWinlessPopupSurrogateHWND;
|
||||
sWinlessPopupSurrogateHWND = NULL;
|
||||
sWinlessPopupSurrogateHWND = nullptr;
|
||||
|
||||
// Popups that don't use TPM_RETURNCMD expect a final command message
|
||||
// when an item is selected and the context closes. Since we replace
|
||||
|
@ -1737,7 +1737,7 @@ PluginInstanceChild::CreateWinlessPopupSurrogate()
|
|||
if (mWinlessPopupSurrogateHWND)
|
||||
return;
|
||||
|
||||
HWND hwnd = NULL;
|
||||
HWND hwnd = nullptr;
|
||||
NPError result;
|
||||
if (!CallNPN_GetValue_NPNVnetscapeWindow(&hwnd, &result)) {
|
||||
NS_ERROR("CallNPN_GetValue_NPNVnetscapeWindow failed.");
|
||||
|
@ -1745,8 +1745,8 @@ PluginInstanceChild::CreateWinlessPopupSurrogate()
|
|||
}
|
||||
|
||||
mWinlessPopupSurrogateHWND =
|
||||
CreateWindowEx(WS_EX_NOPARENTNOTIFY, L"Static", NULL, WS_CHILD, 0, 0,
|
||||
0, 0, hwnd, 0, GetModuleHandle(NULL), 0);
|
||||
CreateWindowEx(WS_EX_NOPARENTNOTIFY, L"Static", nullptr, WS_CHILD,
|
||||
0, 0, 0, 0, hwnd, 0, GetModuleHandle(nullptr), 0);
|
||||
if (!mWinlessPopupSurrogateHWND) {
|
||||
NS_ERROR("CreateWindowEx failed for winless placeholder!");
|
||||
return;
|
||||
|
@ -1759,7 +1759,7 @@ PluginInstanceChild::DestroyWinlessPopupSurrogate()
|
|||
{
|
||||
if (mWinlessPopupSurrogateHWND)
|
||||
DestroyWindow(mWinlessPopupSurrogateHWND);
|
||||
mWinlessPopupSurrogateHWND = NULL;
|
||||
mWinlessPopupSurrogateHWND = nullptr;
|
||||
}
|
||||
|
||||
int16_t
|
||||
|
@ -1772,7 +1772,7 @@ PluginInstanceChild::WinlessHandleEvent(NPEvent& event)
|
|||
// special handling during delivery.
|
||||
int16_t handled;
|
||||
|
||||
HWND focusHwnd = NULL;
|
||||
HWND focusHwnd = nullptr;
|
||||
|
||||
// TrackPopupMenu will fail if the parent window is not associated with
|
||||
// our ui thread. So we hook TrackPopupMenu so we can hand in a surrogate
|
||||
|
@ -1792,7 +1792,7 @@ PluginInstanceChild::WinlessHandleEvent(NPEvent& event)
|
|||
|
||||
handled = mPluginIface->event(&mData, reinterpret_cast<void*>(&event));
|
||||
|
||||
sWinlessPopupSurrogateHWND = NULL;
|
||||
sWinlessPopupSurrogateHWND = nullptr;
|
||||
|
||||
if (IsWindow(focusHwnd)) {
|
||||
SetFocus(focusHwnd);
|
||||
|
@ -1832,7 +1832,8 @@ PluginInstanceChild::SharedSurfaceSetWindow(const NPRemoteWindow& aWindow)
|
|||
mWindow.type = aWindow.type;
|
||||
|
||||
mWindow.window = reinterpret_cast<void*>(mSharedSurfaceDib.GetHDC());
|
||||
::SetViewportOrgEx(mSharedSurfaceDib.GetHDC(), -aWindow.x, -aWindow.y, NULL);
|
||||
::SetViewportOrgEx(mSharedSurfaceDib.GetHDC(),
|
||||
-aWindow.x, -aWindow.y, nullptr);
|
||||
|
||||
if (mPluginIface->setwindow)
|
||||
mPluginIface->setwindow(&mData, &mWindow);
|
||||
|
@ -1855,7 +1856,7 @@ PluginInstanceChild::AlphaExtractCacheSetup()
|
|||
{
|
||||
AlphaExtractCacheRelease();
|
||||
|
||||
mAlphaExtract.hdc = ::CreateCompatibleDC(NULL);
|
||||
mAlphaExtract.hdc = ::CreateCompatibleDC(nullptr);
|
||||
|
||||
if (!mAlphaExtract.hdc)
|
||||
return false;
|
||||
|
@ -1874,7 +1875,7 @@ PluginInstanceChild::AlphaExtractCacheSetup()
|
|||
(BITMAPINFO*)&bmih,
|
||||
DIB_RGB_COLORS,
|
||||
(void**)&ppvBits,
|
||||
NULL,
|
||||
nullptr,
|
||||
(unsigned long)sizeof(BITMAPINFOHEADER));
|
||||
if (!mAlphaExtract.bmp)
|
||||
return false;
|
||||
|
@ -1892,8 +1893,8 @@ PluginInstanceChild::AlphaExtractCacheRelease()
|
|||
if (mAlphaExtract.hdc)
|
||||
::DeleteObject(mAlphaExtract.hdc);
|
||||
|
||||
mAlphaExtract.bmp = NULL;
|
||||
mAlphaExtract.hdc = NULL;
|
||||
mAlphaExtract.bmp = nullptr;
|
||||
mAlphaExtract.hdc = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2293,7 +2294,7 @@ PluginInstanceChild::AllocPPluginStreamChild(const nsCString& mimeType,
|
|||
NPError* result)
|
||||
{
|
||||
NS_RUNTIMEABORT("not callable");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -2314,7 +2315,7 @@ PluginInstanceChild::AllocPStreamNotifyChild(const nsCString& url,
|
|||
{
|
||||
AssertPluginThread();
|
||||
NS_RUNTIMEABORT("not reached");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2324,8 +2325,8 @@ StreamNotifyChild::ActorDestroy(ActorDestroyReason why)
|
|||
NS_ERROR("Pending NPP_URLNotify not called when closing an instance.");
|
||||
|
||||
// reclaim responsibility for deleting ourself
|
||||
mBrowserStream->mStreamNotify = NULL;
|
||||
mBrowserStream = NULL;
|
||||
mBrowserStream->mStreamNotify = nullptr;
|
||||
mBrowserStream = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2432,7 +2433,7 @@ PluginInstanceChild::NPN_NewStream(NPMIMEType aMIMEType, const char* aWindow,
|
|||
CallPPluginStreamConstructor(ps, nsDependentCString(aMIMEType),
|
||||
NullableString(aWindow), &result);
|
||||
if (NPERR_NO_ERROR != result) {
|
||||
*aStream = NULL;
|
||||
*aStream = nullptr;
|
||||
PPluginStreamChild::Call__delete__(ps, NPERR_GENERIC_ERROR, true);
|
||||
return result;
|
||||
}
|
||||
|
@ -2489,7 +2490,7 @@ PluginInstanceChild::NPN_InitAsyncSurface(NPSize *size, NPImageFormat format,
|
|||
{
|
||||
AssertPluginThread();
|
||||
|
||||
surface->bitmap.data = NULL;
|
||||
surface->bitmap.data = nullptr;
|
||||
|
||||
if (!IsAsyncDrawing()) {
|
||||
return NPERR_GENERIC_ERROR;
|
||||
|
@ -2576,7 +2577,7 @@ PluginInstanceChild::NPN_FinalizeAsyncSurface(NPAsyncSurface *surface)
|
|||
CrossProcessMutexAutoLock autoLock(*mRemoteImageDataMutex);
|
||||
RemoteImageData *data = mRemoteImageData;
|
||||
if (data->mBitmap.mData == bitmapData->mRemotePtr) {
|
||||
data->mBitmap.mData = NULL;
|
||||
data->mBitmap.mData = nullptr;
|
||||
data->mSize = gfxIntSize(0, 0);
|
||||
data->mWasUpdated = true;
|
||||
}
|
||||
|
@ -2591,7 +2592,7 @@ PluginInstanceChild::NPN_FinalizeAsyncSurface(NPAsyncSurface *surface)
|
|||
CrossProcessMutexAutoLock autoLock(*mRemoteImageDataMutex);
|
||||
RemoteImageData *data = mRemoteImageData;
|
||||
if (data->mTextureHandle == surface->sharedHandle) {
|
||||
data->mTextureHandle = NULL;
|
||||
data->mTextureHandle = nullptr;
|
||||
data->mSize = gfxIntSize(0, 0);
|
||||
data->mWasUpdated = true;
|
||||
}
|
||||
|
@ -2617,7 +2618,7 @@ PluginInstanceChild::NPN_SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect
|
|||
|
||||
if (!surface) {
|
||||
CrossProcessMutexAutoLock autoLock(*mRemoteImageDataMutex);
|
||||
data->mBitmap.mData = NULL;
|
||||
data->mBitmap.mData = nullptr;
|
||||
data->mSize = gfxIntSize(0, 0);
|
||||
data->mWasUpdated = true;
|
||||
} else {
|
||||
|
@ -2672,7 +2673,7 @@ PluginInstanceChild::DoAsyncRedraw()
|
|||
{
|
||||
{
|
||||
MutexAutoLock autoLock(mAsyncInvalidateMutex);
|
||||
mAsyncInvalidateTask = NULL;
|
||||
mAsyncInvalidateTask = nullptr;
|
||||
}
|
||||
|
||||
SendRedrawPlugin();
|
||||
|
@ -2725,7 +2726,7 @@ PluginInstanceChild::DoAsyncSetWindow(const gfxSurfaceType& aSurfaceType,
|
|||
mCurrentAsyncSetWindowTask = nullptr;
|
||||
}
|
||||
|
||||
mWindow.window = NULL;
|
||||
mWindow.window = nullptr;
|
||||
if (mWindow.width != aWindow.width || mWindow.height != aWindow.height ||
|
||||
mWindow.clipRect.top != aWindow.clipRect.top ||
|
||||
mWindow.clipRect.left != aWindow.clipRect.left ||
|
||||
|
@ -3023,7 +3024,7 @@ PluginInstanceChild::UpdateWindowAttributes(bool aForceSetWindow)
|
|||
}
|
||||
#endif // MOZ_X11
|
||||
#ifdef XP_WIN
|
||||
HDC dc = NULL;
|
||||
HDC dc = nullptr;
|
||||
|
||||
if (curSurface) {
|
||||
if (!SharedDIBSurface::IsSharedDIBSurface(curSurface))
|
||||
|
@ -3142,8 +3143,8 @@ PluginInstanceChild::PaintRectToPlatformSurface(const nsIntRect& aRect,
|
|||
uintptr_t(&rect)
|
||||
};
|
||||
|
||||
::SetViewportOrgEx((HDC) mWindow.window, -mWindow.x, -mWindow.y, NULL);
|
||||
::SelectClipRgn((HDC) mWindow.window, NULL);
|
||||
::SetViewportOrgEx((HDC) mWindow.window, -mWindow.x, -mWindow.y, nullptr);
|
||||
::SelectClipRgn((HDC) mWindow.window, nullptr);
|
||||
::IntersectClipRect((HDC) mWindow.window, rect.left, rect.top, rect.right, rect.bottom);
|
||||
mPluginIface->event(&mData, reinterpret_cast<void*>(&paintEvent));
|
||||
#else
|
||||
|
@ -3494,7 +3495,7 @@ PluginInstanceChild::ShowPluginFrame()
|
|||
if (SharedDIBSurface::IsSharedDIBSurface(mCurrentSurface)) {
|
||||
SharedDIBSurface* s = static_cast<SharedDIBSurface*>(mCurrentSurface.get());
|
||||
if (!mCurrentSurfaceActor) {
|
||||
base::SharedMemoryHandle handle = NULL;
|
||||
base::SharedMemoryHandle handle = nullptr;
|
||||
s->ShareToProcess(PluginModuleChild::current()->OtherProcess(), &handle);
|
||||
|
||||
mCurrentSurfaceActor =
|
||||
|
@ -3846,7 +3847,7 @@ PluginInstanceChild::ClearCurrentSurface()
|
|||
#ifdef XP_WIN
|
||||
if (mCurrentSurfaceActor) {
|
||||
PPluginSurfaceChild::Send__delete__(mCurrentSurfaceActor);
|
||||
mCurrentSurfaceActor = NULL;
|
||||
mCurrentSurfaceActor = nullptr;
|
||||
}
|
||||
#endif
|
||||
mHelperSurface = nullptr;
|
||||
|
@ -3872,11 +3873,11 @@ PluginInstanceChild::ClearAllSurfaces()
|
|||
#ifdef XP_WIN
|
||||
if (mCurrentSurfaceActor) {
|
||||
PPluginSurfaceChild::Send__delete__(mCurrentSurfaceActor);
|
||||
mCurrentSurfaceActor = NULL;
|
||||
mCurrentSurfaceActor = nullptr;
|
||||
}
|
||||
if (mBackSurfaceActor) {
|
||||
PPluginSurfaceChild::Send__delete__(mBackSurfaceActor);
|
||||
mBackSurfaceActor = NULL;
|
||||
mBackSurfaceActor = nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -3961,8 +3962,8 @@ PluginInstanceChild::AnswerNPP_Destroy(NPError* aResult)
|
|||
mDeletingHash = new nsTHashtable<DeletingObjectEntry>;
|
||||
PluginModuleChild::current()->FindNPObjectsForInstance(this);
|
||||
|
||||
mDeletingHash->EnumerateEntries(InvalidateObject, NULL);
|
||||
mDeletingHash->EnumerateEntries(DeleteObject, NULL);
|
||||
mDeletingHash->EnumerateEntries(InvalidateObject, nullptr);
|
||||
mDeletingHash->EnumerateEntries(DeleteObject, nullptr);
|
||||
|
||||
// Null out our cached actors as they should have been killed in the
|
||||
// PluginInstanceDestroyed call above.
|
||||
|
|
|
@ -69,8 +69,8 @@ PluginInstanceParent::PluginInstanceParent(PluginModuleParent* parent,
|
|||
, mWindowType(NPWindowTypeWindow)
|
||||
, mDrawingModel(kDefaultDrawingModel)
|
||||
#if defined(OS_WIN)
|
||||
, mPluginHWND(NULL)
|
||||
, mPluginWndProc(NULL)
|
||||
, mPluginHWND(nullptr)
|
||||
, mPluginWndProc(nullptr)
|
||||
, mNestedEventState(false)
|
||||
#endif // defined(XP_WIN)
|
||||
#if defined(XP_MACOSX)
|
||||
|
@ -84,7 +84,7 @@ PluginInstanceParent::PluginInstanceParent(PluginModuleParent* parent,
|
|||
PluginInstanceParent::~PluginInstanceParent()
|
||||
{
|
||||
if (mNPP)
|
||||
mNPP->pdata = NULL;
|
||||
mNPP->pdata = nullptr;
|
||||
|
||||
#if defined(OS_WIN)
|
||||
NS_ASSERTION(!(mPluginHWND || mPluginWndProc),
|
||||
|
@ -127,7 +127,7 @@ PluginInstanceParent::ActorDestroy(ActorDestroyReason why)
|
|||
// longer be valid. The X surface may be destroyed, or the shared
|
||||
// memory backing this surface may no longer be valid.
|
||||
if (mFrontSurface) {
|
||||
mFrontSurface = NULL;
|
||||
mFrontSurface = nullptr;
|
||||
if (mImageContainer) {
|
||||
mImageContainer->SetCurrentImage(nullptr);
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ PluginInstanceParent::AllocPBrowserStreamParent(const nsCString& url,
|
|||
uint16_t *stype)
|
||||
{
|
||||
NS_RUNTIMEABORT("Not reachable");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -427,7 +427,7 @@ PluginInstanceParent::AnswerNPN_SetValue_NPPVpluginDrawingModel(
|
|||
mImageContainer->SetCompositionNotifySink(nullptr);
|
||||
}
|
||||
DeallocShmem(mRemoteImageDataShmem);
|
||||
mRemoteImageDataMutex = NULL;
|
||||
mRemoteImageDataMutex = nullptr;
|
||||
}
|
||||
} else {
|
||||
*result = NPERR_GENERIC_ERROR;
|
||||
|
@ -685,7 +685,7 @@ nsresult
|
|||
PluginInstanceParent::GetImageContainer(ImageContainer** aContainer)
|
||||
{
|
||||
#ifdef XP_MACOSX
|
||||
MacIOSurface* ioSurface = NULL;
|
||||
MacIOSurface* ioSurface = nullptr;
|
||||
|
||||
if (mFrontIOSurface) {
|
||||
ioSurface = mFrontIOSurface;
|
||||
|
@ -1586,7 +1586,7 @@ PluginInstanceParent::AllocPPluginSurfaceParent(const WindowsSharedMemoryHandle&
|
|||
return new PluginSurfaceParent(handle, size, transparent);
|
||||
#else
|
||||
NS_ERROR("This shouldn't be called!");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1725,7 +1725,7 @@ PluginInstanceParent::AnswerNPN_InitAsyncSurface(const gfxIntSize& size,
|
|||
CD3D10_TEXTURE2D_DESC desc(DXGI_FORMAT_B8G8R8A8_UNORM, size.width, size.height, 1, 1);
|
||||
desc.MiscFlags = D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX;
|
||||
desc.BindFlags = D3D10_BIND_RENDER_TARGET | D3D10_BIND_SHADER_RESOURCE;
|
||||
if (FAILED(device->CreateTexture2D(&desc, NULL, getter_AddRefs(texture)))) {
|
||||
if (FAILED(device->CreateTexture2D(&desc, nullptr, getter_AddRefs(texture)))) {
|
||||
*result = false;
|
||||
return true;
|
||||
}
|
||||
|
@ -1872,8 +1872,8 @@ PluginInstanceParent::UnsubclassPluginWindow()
|
|||
|
||||
::RemovePropW(mPluginHWND, kPluginInstanceParentProperty);
|
||||
|
||||
mPluginWndProc = NULL;
|
||||
mPluginHWND = NULL;
|
||||
mPluginWndProc = nullptr;
|
||||
mPluginHWND = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ inline void AssertPluginThread()
|
|||
void DeferNPObjectLastRelease(const NPNetscapeFuncs* f, NPObject* o);
|
||||
void DeferNPVariantLastRelease(const NPNetscapeFuncs* f, NPVariant* v);
|
||||
|
||||
// in NPAPI, char* == NULL is sometimes meaningful. the following is
|
||||
// in NPAPI, char* == nullptr is sometimes meaningful. the following is
|
||||
// helper code for dealing with nullable nsCString's
|
||||
inline nsCString
|
||||
NullableString(const char* aString)
|
||||
|
@ -249,7 +249,7 @@ inline const char*
|
|||
NullableStringGet(const nsCString& str)
|
||||
{
|
||||
if (str.IsVoid())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return str.get();
|
||||
}
|
||||
|
@ -499,12 +499,12 @@ struct ParamTraits<NPNSString*>
|
|||
typedef NPNSString* paramType;
|
||||
|
||||
// Empty string writes a length of 0 and no buffer.
|
||||
// We don't write a NULL terminating character in buffers.
|
||||
// We don't write a nullptr terminating character in buffers.
|
||||
static void Write(Message* aMsg, const paramType& aParam)
|
||||
{
|
||||
CFStringRef cfString = (CFStringRef)aParam;
|
||||
|
||||
// Write true if we have a string, false represents NULL.
|
||||
// Write true if we have a string, false represents nullptr.
|
||||
aMsg->WriteBool(!!cfString);
|
||||
if (!cfString) {
|
||||
return;
|
||||
|
@ -534,7 +534,7 @@ struct ParamTraits<NPNSString*>
|
|||
return false;
|
||||
}
|
||||
if (!haveString) {
|
||||
*aResult = NULL;
|
||||
*aResult = nullptr;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -609,7 +609,7 @@ struct ParamTraits<NSCursorInfo>
|
|||
return false;
|
||||
}
|
||||
|
||||
uint8_t* data = NULL;
|
||||
uint8_t* data = nullptr;
|
||||
if (dataLength != 0) {
|
||||
if (!aMsg->ReadBytes(aIter, (const char**)&data, dataLength) || !data) {
|
||||
return false;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -384,14 +384,14 @@ private:
|
|||
{
|
||||
NPObjectData(const NPObject* key)
|
||||
: nsPtrHashKey<NPObject>(key)
|
||||
, instance(NULL)
|
||||
, actor(NULL)
|
||||
, instance(nullptr)
|
||||
, actor(nullptr)
|
||||
{ }
|
||||
|
||||
// never NULL
|
||||
// never nullptr
|
||||
PluginInstanceChild* instance;
|
||||
|
||||
// sometimes NULL (no actor associated with an NPObject)
|
||||
// sometimes nullptr (no actor associated with an NPObject)
|
||||
PluginScriptableObjectChild* actor;
|
||||
};
|
||||
/**
|
||||
|
|
|
@ -122,8 +122,8 @@ PluginModuleParent::PluginModuleParent(const char* aFilePath)
|
|||
, mShutdown(false)
|
||||
, mClearSiteDataSupported(false)
|
||||
, mGetSitesWithDataSupported(false)
|
||||
, mNPNIface(NULL)
|
||||
, mPlugin(NULL)
|
||||
, mNPNIface(nullptr)
|
||||
, mPlugin(nullptr)
|
||||
, mTaskFactory(MOZ_THIS_IN_INITIALIZER_LIST())
|
||||
#ifdef XP_WIN
|
||||
, mPluginCpuUsageOnHang()
|
||||
|
@ -754,7 +754,7 @@ PluginModuleParent::AllocPPluginIdentifierParent(const nsCString& aString,
|
|||
{
|
||||
if (aTemporary) {
|
||||
NS_ERROR("Plugins don't create temporary identifiers.");
|
||||
return NULL; // should abort the plugin
|
||||
return nullptr; // should abort the plugin
|
||||
}
|
||||
|
||||
NPIdentifier npident = aString.IsVoid() ?
|
||||
|
@ -786,7 +786,7 @@ PluginModuleParent::AllocPPluginInstanceParent(const nsCString& aMimeType,
|
|||
NPError* rv)
|
||||
{
|
||||
NS_ERROR("Not reachable!");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -804,9 +804,9 @@ PluginModuleParent::SetPluginFuncs(NPPluginFuncs* aFuncs)
|
|||
aFuncs->javaClass = nullptr;
|
||||
|
||||
// Gecko should always call these functions through a PluginLibrary object.
|
||||
aFuncs->newp = NULL;
|
||||
aFuncs->clearsitedata = NULL;
|
||||
aFuncs->getsiteswithdata = NULL;
|
||||
aFuncs->newp = nullptr;
|
||||
aFuncs->clearsitedata = nullptr;
|
||||
aFuncs->getsiteswithdata = nullptr;
|
||||
|
||||
aFuncs->destroy = NPP_Destroy;
|
||||
aFuncs->setwindow = NPP_SetWindow;
|
||||
|
@ -820,9 +820,9 @@ PluginModuleParent::SetPluginFuncs(NPPluginFuncs* aFuncs)
|
|||
aFuncs->urlnotify = NPP_URLNotify;
|
||||
aFuncs->getvalue = NPP_GetValue;
|
||||
aFuncs->setvalue = NPP_SetValue;
|
||||
aFuncs->gotfocus = NULL;
|
||||
aFuncs->lostfocus = NULL;
|
||||
aFuncs->urlredirectnotify = NULL;
|
||||
aFuncs->gotfocus = nullptr;
|
||||
aFuncs->lostfocus = nullptr;
|
||||
aFuncs->urlredirectnotify = nullptr;
|
||||
|
||||
// Provide 'NPP_URLRedirectNotify', 'NPP_ClearSiteData', and
|
||||
// 'NPP_GetSitesWithData' functionality if it is supported by the plugin.
|
||||
|
@ -1062,9 +1062,9 @@ PluginModuleParent::InstCast(NPP instance)
|
|||
static_cast<PluginInstanceParent*>(instance->pdata);
|
||||
|
||||
// If the plugin crashed and the PluginInstanceParent was deleted,
|
||||
// instance->pdata will be NULL.
|
||||
// instance->pdata will be nullptr.
|
||||
if (!ip)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (instance != ip->mNPP) {
|
||||
NS_RUNTIMEABORT("Corrupted plugin data.");
|
||||
|
@ -1078,7 +1078,7 @@ PluginModuleParent::StreamCast(NPP instance,
|
|||
{
|
||||
PluginInstanceParent* ip = InstCast(instance);
|
||||
if (!ip)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
BrowserStreamParent* sp =
|
||||
static_cast<BrowserStreamParent*>(static_cast<AStream*>(s->pdata));
|
||||
|
@ -1279,7 +1279,7 @@ PluginModuleParent::NP_GetEntryPoints(NPPluginFuncs* pFuncs, NPError* error)
|
|||
|
||||
// We need to have the child process update its function table
|
||||
// here by actually calling NP_GetEntryPoints since the parent's
|
||||
// function table can reflect NULL entries in the child's table.
|
||||
// function table can reflect nullptr entries in the child's table.
|
||||
if (!CallNP_GetEntryPoints(error)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -1456,7 +1456,7 @@ PluginModuleParent::AnswerProcessSomeEvents()
|
|||
|
||||
int i = 0;
|
||||
for (; i < kMaxChancesToProcessEvents; ++i)
|
||||
if (!g_main_context_iteration(NULL, FALSE))
|
||||
if (!g_main_context_iteration(nullptr, FALSE))
|
||||
break;
|
||||
|
||||
PLUGIN_LOG_DEBUG(("... quitting mini nested loop; processed %i tasks", i));
|
||||
|
@ -1616,7 +1616,7 @@ PluginModuleParent::RecvNPN_SetException(PPluginScriptableObjectParent* aActor,
|
|||
{
|
||||
PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
|
||||
|
||||
NPObject* aNPObj = NULL;
|
||||
NPObject* aNPObj = nullptr;
|
||||
if (aActor) {
|
||||
aNPObj = static_cast<PluginScriptableObjectParent*>(aActor)->GetObject(true);
|
||||
if (!aNPObj) {
|
||||
|
|
|
@ -81,7 +81,7 @@ PluginProcessChild::Init()
|
|||
#ifdef XP_WIN
|
||||
// Drag-and-drop needs OleInitialize to be called, and Silverlight depends
|
||||
// on the host calling CoInitialize (which is called by OleInitialize).
|
||||
::OleInitialize(NULL);
|
||||
::OleInitialize(nullptr);
|
||||
#endif
|
||||
|
||||
// Certain plugins, such as flash, steal the unhandled exception filter
|
||||
|
|
|
@ -586,7 +586,7 @@ PluginScriptableObjectChild::NPObjectDestroyed()
|
|||
NS_ASSERTION(LocalObject == mType,
|
||||
"ScriptableDeallocate should have handled this for proxies");
|
||||
mInvalidated = true;
|
||||
mObject = NULL;
|
||||
mObject = nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -21,7 +21,7 @@ class PPluginIdentifierChild;
|
|||
struct ChildNPObject : NPObject
|
||||
{
|
||||
ChildNPObject()
|
||||
: NPObject(), parent(NULL), invalidated(false)
|
||||
: NPObject(), parent(nullptr), invalidated(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(ChildNPObject);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class PPluginIdentifierParent;
|
|||
struct ParentNPObject : NPObject
|
||||
{
|
||||
ParentNPObject()
|
||||
: NPObject(), parent(NULL), invalidated(false) { }
|
||||
: NPObject(), parent(nullptr), invalidated(false) { }
|
||||
|
||||
// |parent| is always valid as long as the actor is alive. Once the actor is
|
||||
// destroyed this will be set to null.
|
||||
|
|
|
@ -23,7 +23,7 @@ PluginStreamParent::PluginStreamParent(PluginInstanceParent* npp,
|
|||
if (*result == NPERR_NO_ERROR)
|
||||
mStream->pdata = static_cast<AStream*>(this);
|
||||
else
|
||||
mStream = NULL;
|
||||
mStream = nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -22,8 +22,8 @@ class StreamNotifyChild : public PStreamNotifyChild
|
|||
public:
|
||||
StreamNotifyChild(const nsCString& aURL)
|
||||
: mURL(aURL)
|
||||
, mClosure(NULL)
|
||||
, mBrowserStream(NULL)
|
||||
, mClosure(nullptr)
|
||||
, mBrowserStream(nullptr)
|
||||
{ }
|
||||
|
||||
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
||||
|
|
|
@ -17,7 +17,7 @@ class StreamNotifyParent : public PStreamNotifyParent
|
|||
friend class PluginInstanceParent;
|
||||
|
||||
StreamNotifyParent()
|
||||
: mDestructionFlag(NULL)
|
||||
: mDestructionFlag(nullptr)
|
||||
{ }
|
||||
~StreamNotifyParent() {
|
||||
if (mDestructionFlag)
|
||||
|
@ -31,7 +31,7 @@ public:
|
|||
mDestructionFlag = flag;
|
||||
}
|
||||
void ClearDestructionFlag() {
|
||||
mDestructionFlag = NULL;
|
||||
mDestructionFlag = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -224,7 +224,7 @@ protected:
|
|||
mWriteHeader(nullptr),
|
||||
mReadHeader(nullptr),
|
||||
mPayloadMaxLen(0),
|
||||
mGuard(NULL),
|
||||
mGuard(nullptr),
|
||||
mTimeout(INFINITE)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -13,12 +13,12 @@ namespace mozilla {
|
|||
namespace plugins {
|
||||
|
||||
MiniShmChild::MiniShmChild()
|
||||
: mParentEvent(NULL),
|
||||
mParentGuard(NULL),
|
||||
mChildEvent(NULL),
|
||||
mChildGuard(NULL),
|
||||
mFileMapping(NULL),
|
||||
mRegWait(NULL),
|
||||
: mParentEvent(nullptr),
|
||||
mParentGuard(nullptr),
|
||||
mChildEvent(nullptr),
|
||||
mChildGuard(nullptr),
|
||||
mFileMapping(nullptr),
|
||||
mRegWait(nullptr),
|
||||
mView(nullptr),
|
||||
mTimeout(INFINITE)
|
||||
{}
|
||||
|
@ -61,7 +61,7 @@ MiniShmChild::Init(MiniShmObserver* aObserver, const std::wstring& aCookie,
|
|||
return NS_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
std::wistringstream iss(aCookie);
|
||||
HANDLE mapHandle = NULL;
|
||||
HANDLE mapHandle = nullptr;
|
||||
iss >> mapHandle;
|
||||
if (!iss) {
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
|
@ -114,7 +114,7 @@ MiniShmChild::Init(MiniShmObserver* aObserver, const std::wstring& aCookie,
|
|||
rv = GetWritePtrInternal(initCompleteStruct);
|
||||
if (NS_FAILED(rv)) {
|
||||
::UnregisterWaitEx(mRegWait, INVALID_HANDLE_VALUE);
|
||||
mRegWait = NULL;
|
||||
mRegWait = nullptr;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -133,15 +133,15 @@ MiniShmChild::Init(MiniShmObserver* aObserver, const std::wstring& aCookie,
|
|||
rv = Send();
|
||||
if (NS_FAILED(rv)) {
|
||||
initCompleteStruct->mSucceeded = false;
|
||||
mFileMapping = NULL;
|
||||
mFileMapping = nullptr;
|
||||
view.Set(mView);
|
||||
mView = nullptr;
|
||||
mParentEvent = NULL;
|
||||
mParentGuard = NULL;
|
||||
mChildEvent = NULL;
|
||||
mChildGuard = NULL;
|
||||
mParentEvent = nullptr;
|
||||
mParentGuard = nullptr;
|
||||
mChildEvent = nullptr;
|
||||
mChildGuard = nullptr;
|
||||
::UnregisterWaitEx(mRegWait, INVALID_HANDLE_VALUE);
|
||||
mRegWait = NULL;
|
||||
mRegWait = nullptr;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,11 +40,11 @@ const int PluginHangUIChild::kExpectedMinimumArgc = 10;
|
|||
|
||||
PluginHangUIChild::PluginHangUIChild()
|
||||
: mResponseBits(0),
|
||||
mParentWindow(NULL),
|
||||
mDlgHandle(NULL),
|
||||
mMainThread(NULL),
|
||||
mParentProcess(NULL),
|
||||
mRegWaitProcess(NULL),
|
||||
mParentWindow(nullptr),
|
||||
mDlgHandle(nullptr),
|
||||
mMainThread(nullptr),
|
||||
mParentProcess(nullptr),
|
||||
mRegWaitProcess(nullptr),
|
||||
mIPCTimeoutMs(0)
|
||||
{
|
||||
}
|
||||
|
@ -225,7 +225,8 @@ PluginHangUIChild::ResizeButtons()
|
|||
// deltaX accumulates the size changes so that each button's x coordinate
|
||||
// can compensate for the width increases
|
||||
deltaX += idealSize.cx - itr->size.cx;
|
||||
hwp = DeferWindowPos(hwp, itr->hwnd, NULL, itr->pos.x - deltaX, itr->pos.y,
|
||||
hwp = DeferWindowPos(hwp, itr->hwnd, nullptr,
|
||||
itr->pos.x - deltaX, itr->pos.y,
|
||||
idealSize.cx, itr->size.cy,
|
||||
SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
if (!hwp) {
|
||||
|
@ -256,7 +257,7 @@ PluginHangUIChild::HangUIDlgProc(HWND aDlgHandle, UINT aMsgCode, WPARAM aWParam,
|
|||
SetDlgItemText(aDlgHandle, IDC_CONTINUE, mWaitBtnText);
|
||||
SetDlgItemText(aDlgHandle, IDC_STOP, mKillBtnText);
|
||||
ResizeButtons();
|
||||
HANDLE icon = LoadImage(NULL, IDI_QUESTION, IMAGE_ICON, 0, 0,
|
||||
HANDLE icon = LoadImage(nullptr, IDI_QUESTION, IMAGE_ICON, 0, 0,
|
||||
LR_DEFAULTSIZE | LR_SHARED);
|
||||
if (icon) {
|
||||
SendDlgItemMessage(aDlgHandle, IDC_DLGICON, STM_SETICON, (WPARAM)icon, 0);
|
||||
|
@ -336,11 +337,11 @@ PluginHangUIChild::RecvShow()
|
|||
bool
|
||||
PluginHangUIChild::Show()
|
||||
{
|
||||
INT_PTR dlgResult = DialogBox(GetModuleHandle(NULL),
|
||||
INT_PTR dlgResult = DialogBox(GetModuleHandle(nullptr),
|
||||
MAKEINTRESOURCE(IDD_HANGUIDLG),
|
||||
NULL,
|
||||
nullptr,
|
||||
&SHangUIDlgProc);
|
||||
mDlgHandle = NULL;
|
||||
mDlgHandle = nullptr;
|
||||
assert(dlgResult != -1);
|
||||
bool result = false;
|
||||
if (dlgResult != -1) {
|
||||
|
@ -389,7 +390,7 @@ PluginHangUIChild::SetMainThread()
|
|||
{
|
||||
if (mMainThread) {
|
||||
CloseHandle(mMainThread);
|
||||
mMainThread = NULL;
|
||||
mMainThread = nullptr;
|
||||
}
|
||||
mMainThread = OpenThread(THREAD_SET_CONTEXT,
|
||||
FALSE,
|
||||
|
|
Загрузка…
Ссылка в новой задаче