Bug 729155: Fix warnings in plugin ipc code. r=bsmedberg
authorJosh Aas <joshmoz@gmail.com>
Tue, 21 Feb 2012 19:32:06 -0500
changeset 88875 c2365857ecb4759d74b6249081b6586b94bb1f3a
parent 88874 f0c3fefb520af5822b0a71c0b7d5894d38e55ebe
child 88876 b61b745f3f8ae506b6cdddab14a5de6af1565059
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs729155
milestone13.0a1
Bug 729155: Fix warnings in plugin ipc code. r=bsmedberg
dom/plugins/ipc/PluginInstanceChild.cpp
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/ipc/PluginMessageUtils.cpp
dom/plugins/ipc/PluginModuleParent.cpp
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -2537,23 +2537,23 @@ PluginInstanceChild::CreateOptSurface(vo
 bool
 PluginInstanceChild::MaybeCreatePlatformHelperSurface(void)
 {
     if (!mCurrentSurface) {
         NS_ERROR("Cannot create helper surface without mCurrentSurface");
         return false;
     }
 
+#ifdef MOZ_X11
 #ifdef MOZ_PLATFORM_MAEMO
     // On maemo plugins support non-default visual rendering
     bool supportNonDefaultVisual = true;
 #else
     bool supportNonDefaultVisual = false;
 #endif
-#ifdef MOZ_X11
     Screen* screen = DefaultScreenOfDisplay(mWsInfo.display);
     Visual* defaultVisual = DefaultVisualOfScreen(screen);
     Visual* visual = nsnull;
     Colormap colormap = 0;
     mDoAlphaExtraction = false;
     bool createHelperSurface = false;
 
     if (mCurrentSurface->GetType() == gfxASurface::SurfaceTypeXlib) {
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -124,30 +124,16 @@ PluginInstanceParent::~PluginInstancePar
 }
 
 bool
 PluginInstanceParent::Init()
 {
     return !!mScriptableObjects.Init();
 }
 
-namespace {
-
-PLDHashOperator
-ActorCollect(const void* aKey,
-             PluginScriptableObjectParent* aData,
-             void* aUserData)
-{
-    nsTArray<PluginScriptableObjectParent*>* objects =
-        reinterpret_cast<nsTArray<PluginScriptableObjectParent*>*>(aUserData);
-    return objects->AppendElement(aData) ? PL_DHASH_NEXT : PL_DHASH_STOP;
-}
-
-} // anonymous namespace
-
 void
 PluginInstanceParent::ActorDestroy(ActorDestroyReason why)
 {
 #if defined(OS_WIN)
     if (why == AbnormalShutdown) {
         // If the plugin process crashes, this is the only
         // chance we get to destroy resources.
         SharedSurfaceRelease();
--- a/dom/plugins/ipc/PluginMessageUtils.cpp
+++ b/dom/plugins/ipc/PluginMessageUtils.cpp
@@ -109,29 +109,31 @@ MediateRace(const RPCChannel::Message& p
     // reflows
     return RPCChannel::RRPParentWins;
 
   default:
     return RPCChannel::RRPChildWins;
   }
 }
 
+#if defined(OS_LINUX)
 static string
 ReplaceAll(const string& haystack, const string& needle, const string& with)
 {
   string munged = haystack;
   string::size_type i = 0;
 
   while (string::npos != (i = munged.find(needle, i))) {
     munged.replace(i, needle.length(), with);
     i += with.length();
   }
 
   return munged;
 }
+#endif
 
 string
 MungePluginDsoPath(const string& path)
 {
 #if defined(OS_LINUX)
   // https://bugzilla.mozilla.org/show_bug.cgi?id=519601
   return ReplaceAll(path, "netscape", "netsc@pe");
 #else
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -201,17 +201,17 @@ PluginModuleParent::TimeoutChanged(const
       // The timeout value used by the parent for children
       PRInt32 timeoutSecs = Preferences::GetInt(kChildTimeoutPref, 0);
       int32 timeoutMs = (timeoutSecs > 0) ? (1000 * timeoutSecs) :
                         SyncChannel::kNoTimeout;
       static_cast<PluginModuleParent*>(aModule)->SetReplyTimeoutMs(timeoutMs);
     } else if (!strcmp(aPref, kParentTimeoutPref)) {
       // The timeout value used by the child for its parent
       PRInt32 timeoutSecs = Preferences::GetInt(kParentTimeoutPref, 0);
-      static_cast<PluginModuleParent*>(aModule)->SendSetParentHangTimeout(timeoutSecs);
+      unused << static_cast<PluginModuleParent*>(aModule)->SendSetParentHangTimeout(timeoutSecs);
     }
     return 0;
 }
 
 void
 PluginModuleParent::CleanupFromTimeout()
 {
     if (!mShutdown)