Bug 841477 - Enable FAIL_ON_WARNINGS on MSVC in dom/plugins. r=benjamin

This commit is contained in:
Masatoshi Kimura 2013-02-28 07:44:52 +09:00
parent 4812b598c5
commit 94a859f84d
7 changed files with 8 additions and 11 deletions

View File

@ -73,9 +73,7 @@ else
# android_npapi.h extends the NPNVariable and NPPVariable enums
# using #defines, which results in Wswitch warnings in gcc-4.6.
# Therefore, enable FAIL_ON_WARNINGS only on non-Android platforms.
ifndef _MSC_VER
FAIL_ON_WARNINGS := 1
endif # !_MSC_VER
endif
ifeq ($(OS_ARCH),WINNT)

View File

@ -2643,7 +2643,10 @@ nsPluginHost::ReadPluginInfo()
if (NS_FAILED(rv))
return rv;
int32_t flen = int64_t(fileSize);
if (fileSize > INT32_MAX) {
return NS_ERROR_FAILURE;
}
int32_t flen = int32_t(fileSize);
if (flen == 0) {
NS_WARNING("Plugins Registry Empty!");
return NS_OK; // ERROR CONDITION

View File

@ -514,7 +514,7 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request,
// it's possible for the server to not send a Content-Length.
// we should still work in this case.
if (NS_FAILED(rv) || length == -1) {
if (NS_FAILED(rv) || length < 0 || length > UINT32_MAX) {
// check out if this is file channel
nsCOMPtr<nsIFileChannel> fileChannel = do_QueryInterface(channel);
if (fileChannel) {
@ -525,7 +525,7 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request,
mLength = 0;
}
else {
mLength = length;
mLength = uint32_t(length);
}
nsAutoCString aContentType; // XXX but we already got the type above!

View File

@ -30,7 +30,7 @@ BrowserStreamChild::BrowserStreamChild(PluginInstanceChild* instance,
, mURL(url)
, mHeaders(headers)
, mStreamNotify(notifyData)
, mDeliveryTracker(this)
, ALLOW_THIS_IN_INITIALIZER_LIST(mDeliveryTracker(this))
{
PLUGIN_LOG_DEBUG(("%s (%s, %i, %i, %p, %s, %s)", FULLFUNCTION,
url.get(), length, lastmodified, (void*) notifyData,

View File

@ -10,9 +10,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = dom
ifndef _MSC_VER
FAIL_ON_WARNINGS := 1
endif # !_MSC_VER
EXPORTS_NAMESPACES = mozilla

View File

@ -2659,8 +2659,6 @@ PluginInstanceChild::NPN_SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect
#ifdef XP_WIN
case NPDrawingModelAsyncWindowsDXGISurface:
{
AsyncBitmapData *bitmapData;
CrossProcessMutexAutoLock autoLock(*mRemoteImageDataMutex);
data->mType = RemoteImageData::DXGI_TEXTURE_HANDLE;
data->mSize = gfxIntSize(surface->size.width, surface->size.height);

View File

@ -116,7 +116,7 @@ PluginModuleParent::PluginModuleParent(const char* aFilePath)
, mGetSitesWithDataSupported(false)
, mNPNIface(NULL)
, mPlugin(NULL)
, mTaskFactory(this)
, ALLOW_THIS_IN_INITIALIZER_LIST(mTaskFactory(this))
#ifdef XP_WIN
, mPluginCpuUsageOnHang()
, mHangUIParent(nullptr)