Bug 1386200 - Don't use Chromium platform macros under dom/media/. r=cpearce draft
authorJan Beich <jbeich@FreeBSD.org>
Tue, 01 Aug 2017 11:02:54 +0000
changeset 702981 869e598b07ad05e1b829926024bbebbfcdae1c8b
parent 702980 36a4b6566d041adc44beb48d1c596da71f4f03c9
child 702982 7d33809cdcf02792e3c8e18acbaa72f94a8ae1f9
push id90652
push userbmo:jbeich@FreeBSD.org
push dateFri, 24 Nov 2017 04:38:18 +0000
reviewerscpearce
bugs1386200
milestone59.0a1
Bug 1386200 - Don't use Chromium platform macros under dom/media/. r=cpearce MozReview-Commit-ID: FyEvc5qdXEE
dom/media/gmp/GMPChild.cpp
dom/media/gmp/GMPProcessChild.cpp
--- a/dom/media/gmp/GMPChild.cpp
+++ b/dom/media/gmp/GMPChild.cpp
@@ -103,22 +103,20 @@ GetPluginFile(const nsAString& aPluginPa
               nsCOMPtr<nsIFile>& aLibDirectory,
               nsCOMPtr<nsIFile>& aLibFile)
 {
   nsAutoString baseName;
   GetFileBase(aPluginPath, aLibDirectory, aLibFile, baseName);
 
 #if defined(XP_MACOSX)
   nsAutoString binaryName = NS_LITERAL_STRING("lib") + baseName + NS_LITERAL_STRING(".dylib");
-#elif defined(OS_POSIX)
-  nsAutoString binaryName = NS_LITERAL_STRING("lib") + baseName + NS_LITERAL_STRING(".so");
 #elif defined(XP_WIN)
   nsAutoString binaryName =                            baseName + NS_LITERAL_STRING(".dll");
 #else
-#error not defined
+  nsAutoString binaryName = NS_LITERAL_STRING("lib") + baseName + NS_LITERAL_STRING(".so");
 #endif
   aLibFile->AppendRelativePath(binaryName);
   return true;
 }
 
 static bool
 GetPluginFile(const nsAString& aPluginPath,
               nsCOMPtr<nsIFile>& aLibFile)
--- a/dom/media/gmp/GMPProcessChild.cpp
+++ b/dom/media/gmp/GMPProcessChild.cpp
@@ -24,29 +24,27 @@ GMPProcessChild::~GMPProcessChild()
 {
 }
 
 bool
 GMPProcessChild::Init(int aArgc, char* aArgv[])
 {
   nsAutoString pluginFilename;
 
-#if defined(OS_POSIX)
+#if !defined(XP_WIN)
   // NB: need to be very careful in ensuring that the first arg
   // (after the binary name) here is indeed the plugin module path.
   // Keep in sync with dom/plugins/PluginModuleParent.
   std::vector<std::string> values = CommandLine::ForCurrentProcess()->argv();
   MOZ_ASSERT(values.size() >= 2, "not enough args");
   pluginFilename = NS_ConvertUTF8toUTF16(nsDependentCString(values[1].c_str()));
-#elif defined(OS_WIN)
+#else
   std::vector<std::wstring> values = CommandLine::ForCurrentProcess()->GetLooseValues();
   MOZ_ASSERT(values.size() >= 1, "not enough loose args");
   pluginFilename = nsDependentString(values[0].c_str());
-#else
-#error Not implemented
 #endif
 
   BackgroundHangMonitor::Startup();
 
   return mPlugin.Init(pluginFilename,
                       ParentPid(),
                       IOThreadChild::message_loop(),
                       IOThreadChild::channel());