Bug 754582 - Fixed unused-result warnings in Windows-specific code r=benjamin

This commit is contained in:
Jacek Caban 2012-05-16 10:48:45 +02:00
parent 136e182794
commit d5f0f251b0
4 changed files with 13 additions and 13 deletions

View File

@ -1200,8 +1200,7 @@ PluginInstanceParent::NPP_HandleEvent(void* event)
} }
} }
if (DoublePassRenderingEvent() == npevent->event) { if (DoublePassRenderingEvent() == npevent->event) {
CallPaint(npremoteevent, &handled); return CallPaint(npremoteevent, &handled) && handled;
return handled;
} }
switch (npevent->event) { switch (npevent->event) {
@ -1209,7 +1208,9 @@ PluginInstanceParent::NPP_HandleEvent(void* event)
{ {
RECT rect; RECT rect;
SharedSurfaceBeforePaint(rect, npremoteevent); SharedSurfaceBeforePaint(rect, npremoteevent);
CallPaint(npremoteevent, &handled); if (!CallPaint(npremoteevent, &handled)) {
handled = false;
}
SharedSurfaceAfterPaint(npevent); SharedSurfaceAfterPaint(npevent);
return handled; return handled;
} }
@ -1237,10 +1238,7 @@ PluginInstanceParent::NPP_HandleEvent(void* event)
case WM_WINDOWPOSCHANGED: case WM_WINDOWPOSCHANGED:
{ {
// We send this in nsObjectFrame just before painting // We send this in nsObjectFrame just before painting
SendWindowPosChanged(npremoteevent); return SendWindowPosChanged(npremoteevent);
// nsObjectFrame doesn't care whether we handle this
// or not, just returning 1 for good hygiene
return 1;
} }
break; break;
} }
@ -1792,7 +1790,7 @@ PluginInstanceParent::PluginWindowHookProc(HWND hWnd,
switch (message) { switch (message) {
case WM_SETFOCUS: case WM_SETFOCUS:
// Let the child plugin window know it should take focus. // Let the child plugin window know it should take focus.
self->CallSetPluginFocus(); unused << self->CallSetPluginFocus();
break; break;
case WM_CLOSE: case WM_CLOSE:
@ -1821,7 +1819,7 @@ PluginInstanceParent::SubclassPluginWindow(HWND aWnd)
mPluginWndProc = mPluginWndProc =
(WNDPROC)::SetWindowLongPtrA(mPluginHWND, GWLP_WNDPROC, (WNDPROC)::SetWindowLongPtrA(mPluginHWND, GWLP_WNDPROC,
reinterpret_cast<LONG_PTR>(PluginWindowHookProc)); reinterpret_cast<LONG_PTR>(PluginWindowHookProc));
bool bRes = ::SetPropW(mPluginHWND, kPluginInstanceParentProperty, this); DebugOnly<bool> bRes = ::SetPropW(mPluginHWND, kPluginInstanceParentProperty, this);
NS_ASSERTION(mPluginWndProc, NS_ASSERTION(mPluginWndProc,
"PluginInstanceParent::SubclassPluginWindow failed to set subclass!"); "PluginInstanceParent::SubclassPluginWindow failed to set subclass!");
NS_ASSERTION(bRes, NS_ASSERTION(bRes,

View File

@ -792,7 +792,7 @@ PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error)
if (NS_SUCCEEDED(mozilla::widget::GetAudioSessionData(id, sessionName, if (NS_SUCCEEDED(mozilla::widget::GetAudioSessionData(id, sessionName,
iconPath))) iconPath)))
SendSetAudioSessionData(id, sessionName, iconPath); unused << SendSetAudioSessionData(id, sessionName, iconPath);
#endif #endif
return NS_OK; return NS_OK;
@ -1043,7 +1043,7 @@ void
PluginModuleParent::ProcessRemoteNativeEventsInRPCCall() PluginModuleParent::ProcessRemoteNativeEventsInRPCCall()
{ {
#if defined(OS_WIN) #if defined(OS_WIN)
SendProcessNativeEventsInRPCCall(); unused << SendProcessNativeEventsInRPCCall();
return; return;
#endif #endif
NS_NOTREACHED( NS_NOTREACHED(

View File

@ -25,7 +25,7 @@
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#ifdef XP_WIN #ifdef XP_WIN
#include "Windows.h" #include <windows.h>
#endif #endif
using namespace mozilla; using namespace mozilla;

View File

@ -66,6 +66,7 @@ using mozilla::plugins::PluginInstanceParent;
#include "nsRenderingContext.h" #include "nsRenderingContext.h"
#include "prmem.h" #include "prmem.h"
#include "WinUtils.h" #include "WinUtils.h"
#include "mozilla/unused.h"
#include "LayerManagerOGL.h" #include "LayerManagerOGL.h"
#include "BasicLayers.h" #include "BasicLayers.h"
@ -84,6 +85,7 @@ extern "C" {
#include "pixman.h" #include "pixman.h"
} }
using namespace mozilla;
using namespace mozilla::layers; using namespace mozilla::layers;
using namespace mozilla::widget; using namespace mozilla::widget;
@ -252,7 +254,7 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel)
PluginInstanceParent* instance = reinterpret_cast<PluginInstanceParent*>( PluginInstanceParent* instance = reinterpret_cast<PluginInstanceParent*>(
::GetPropW(mWnd, L"PluginInstanceParentProperty")); ::GetPropW(mWnd, L"PluginInstanceParentProperty"));
if (instance) { if (instance) {
instance->CallUpdateWindow(); unused << instance->CallUpdateWindow();
} else { } else {
// We should never get here since in-process plugins should have // We should never get here since in-process plugins should have
// subclassed our HWND and handled WM_PAINT, but in some cases that // subclassed our HWND and handled WM_PAINT, but in some cases that