Bug 734306: Fix bad conversion from nsresult to NPError. r=bas
authorJosh Aas <joshmoz@gmail.com>
Mon, 12 Mar 2012 10:39:54 -0400
changeset 88801 de4b5d7ba0e5ec95dbd0933784c6f0f202afbabb
parent 88800 790be8926d50d8869195e8c55c761f46b73607a1
child 88802 406113c400a91e801f7b9bd59cddc2125d4d76c7
child 88822 c7034c69d298ae278e45fa45882b842245ab2d44
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbas
bugs734306
milestone13.0a1
Bug 734306: Fix bad conversion from nsresult to NPError. r=bas
dom/plugins/base/nsNPAPIPluginInstance.cpp
dom/plugins/base/nsPluginInstanceOwner.cpp
--- a/dom/plugins/base/nsNPAPIPluginInstance.cpp
+++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp
@@ -1483,26 +1483,26 @@ nsNPAPIPluginInstance::URLRedirectRespon
 
 NPError
 nsNPAPIPluginInstance::InitAsyncSurface(NPSize *size, NPImageFormat format,
                                         void *initData, NPAsyncSurface *surface)
 {
   if (mOwner)
     return mOwner->InitAsyncSurface(size, format, initData, surface);
 
-  return NS_ERROR_FAILURE;
+  return NPERR_GENERIC_ERROR;
 }
 
 NPError
 nsNPAPIPluginInstance::FinalizeAsyncSurface(NPAsyncSurface *surface)
 {
   if (mOwner)
     return mOwner->FinalizeAsyncSurface(surface);
 
-  return NS_ERROR_FAILURE;
+  return NPERR_GENERIC_ERROR;
 }
 
 void
 nsNPAPIPluginInstance::SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed)
 {
   if (mOwner)
     mOwner->SetCurrentAsyncSurface(surface, changed);
 }
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -799,22 +799,22 @@ NPBool nsPluginInstanceOwner::ConvertPoi
   // we should implement this for all platforms
   return false;
 #endif
 }
 
 NPError nsPluginInstanceOwner::InitAsyncSurface(NPSize *size, NPImageFormat format,
                                                 void *initData, NPAsyncSurface *surface)
 {
-  return NPERR_GENERIC_ERROR;
+  return NPERR_INCOMPATIBLE_VERSION_ERROR;
 }
 
 NPError nsPluginInstanceOwner::FinalizeAsyncSurface(NPAsyncSurface *)
 {
-  return NPERR_GENERIC_ERROR;
+  return NPERR_INCOMPATIBLE_VERSION_ERROR;
 }
 
 void nsPluginInstanceOwner::SetCurrentAsyncSurface(NPAsyncSurface *, NPRect*)
 {
 }
 
 NS_IMETHODIMP nsPluginInstanceOwner::GetTagType(nsPluginTagType *result)
 {