Bug 1385115 - Unbreak build on Tier3 after bug 1382883. r=cpearce
authorJan Beich <jbeich@FreeBSD.org>
Fri, 28 Jul 2017 11:48:56 +0000
changeset 420891 9408284f094afd5e07eb4acea49cbff29474c8ee
parent 420890 0a02ac4abd5e7a921191bb0e1576cf9bf800c7ff
child 420892 d7e7ebb85f9e7978403774bd86bd04f3a6f1827e
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1385115, 1382883
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1385115 - Unbreak build on Tier3 after bug 1382883. r=cpearce MozReview-Commit-ID: ISTOw1qfxiy
dom/media/gmp/ChromiumCDMAdapter.cpp
dom/media/gmp/ChromiumCDMAdapter.h
dom/media/gmp/GMPChild.cpp
media/gmp-clearkey/0.1/gmp-clearkey.cpp
--- a/dom/media/gmp/ChromiumCDMAdapter.cpp
+++ b/dom/media/gmp/ChromiumCDMAdapter.cpp
@@ -10,17 +10,17 @@
 #include "gmp-api/gmp-entrypoints.h"
 #include "gmp-api/gmp-decryption.h"
 #include "gmp-api/gmp-video-codec.h"
 #include "gmp-api/gmp-platform.h"
 #include "WidevineUtils.h"
 #include "GMPLog.h"
 #include "mozilla/Move.h"
 
-#if defined(XP_MACOSX) || defined(XP_LINUX)
+#ifndef XP_WIN
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
 #endif
 
 // Declared in WidevineAdapter.cpp.
 extern const GMPPlatformAPI* sPlatform;
@@ -193,17 +193,17 @@ HostFile::HostFile(const nsCString& aPat
                               NULL,
                               OPEN_EXISTING,
                               0,
                               NULL);
   mFile = (handle == INVALID_HANDLE_VALUE) ? cdm::kInvalidPlatformFile : handle;
 }
 #endif
 
-#if defined(XP_MACOSX) || defined(XP_LINUX)
+#ifndef XP_WIN
 HostFile::HostFile(const nsCString& aPath)
   : mPath(aPath)
 {
   // Note: open() returns -1 on failure; i.e. kInvalidPlatformFile.
   mFile = open(aPath.get(), O_RDONLY);
 }
 #endif
 
--- a/dom/media/gmp/ChromiumCDMAdapter.h
+++ b/dom/media/gmp/ChromiumCDMAdapter.h
@@ -12,17 +12,17 @@
 #include "nsTArray.h"
 #include "content_decryption_module_ext.h"
 #include "nsString.h"
 
 struct GMPPlatformAPI;
 
 namespace mozilla {
 
-#if defined(OS_WIN)
+#if defined(XP_WIN)
 typedef nsString HostFileString;
 #else
 typedef nsCString HostFileString;
 #endif
 
 class HostFile
 {
 public:
--- a/dom/media/gmp/GMPChild.cpp
+++ b/dom/media/gmp/GMPChild.cpp
@@ -340,25 +340,25 @@ GMPChild::GetUTF8LibPath(nsACString& aOu
   nsAutoString path;
   libFile->GetPath(path);
   aOutLibPath = NS_ConvertUTF16toUTF8(path);
 
   return true;
 #endif
 }
 
-#if defined(XP_MACOSX)
+#if defined(XP_WIN)
+#define FIREFOX_FILE NS_LITERAL_STRING("firefox.exe")
+#define XUL_LIB_FILE NS_LITERAL_STRING("xul.dll")
+#elif defined(XP_MACOSX)
 #define FIREFOX_FILE NS_LITERAL_STRING("firefox")
 #define XUL_LIB_FILE NS_LITERAL_STRING("XUL")
-#elif defined(XP_LINUX)
+#else
 #define FIREFOX_FILE NS_LITERAL_STRING("firefox")
 #define XUL_LIB_FILE NS_LITERAL_STRING("libxul.so")
-#elif defined(OS_WIN)
-#define FIREFOX_FILE NS_LITERAL_STRING("firefox.exe")
-#define XUL_LIB_FILE NS_LITERAL_STRING("xul.dll")
 #endif
 
 #if defined(XP_MACOSX)
 static bool
 GetFirefoxAppPath(nsCOMPtr<nsIFile> aPluginContainerPath,
                   nsCOMPtr<nsIFile>& aOutFirefoxAppPath)
 {
   // aPluginContainerPath will end with something like:
@@ -407,29 +407,29 @@ GMPChild::MakeCDMHostVerificationPaths()
   } else {
     // Without successfully determining plugin-container's path, we can't
     // determine libxul's or Firefox's. So give up.
     return paths;
   }
 
   // Firefox application binary path.
   nsCOMPtr<nsIFile> appDir;
-#if defined(XP_WIN) || defined(XP_LINUX)
-  // Note: re-using 'path' var here, as on Windows/Linux we assume Firefox
-  // executable is in the same directory as plugin-container.
-  if (NS_SUCCEEDED(path->GetParent(getter_AddRefs(appDir))) &&
+#if defined(XP_MACOSX)
+  // On MacOS the firefox binary is a few parent directories up from
+  // plugin-container.
+  if (GetFirefoxAppPath(path, appDir) &&
       NS_SUCCEEDED(appDir->Clone(getter_AddRefs(path))) &&
       NS_SUCCEEDED(path->Append(FIREFOX_FILE)) && FileExists(path) &&
       ResolveLinks(path) && NS_SUCCEEDED(path->GetPath(str))) {
     paths.AppendElement(NS_ConvertUTF16toUTF8(str));
   }
-#elif defined(XP_MACOSX)
-  // On MacOS the firefox binary is a few parent directories up from
-  // plugin-container.
-  if (GetFirefoxAppPath(path, appDir) &&
+#else
+  // Note: re-using 'path' var here, as on Windows/Linux we assume Firefox
+  // executable is in the same directory as plugin-container.
+  if (NS_SUCCEEDED(path->GetParent(getter_AddRefs(appDir))) &&
       NS_SUCCEEDED(appDir->Clone(getter_AddRefs(path))) &&
       NS_SUCCEEDED(path->Append(FIREFOX_FILE)) && FileExists(path) &&
       ResolveLinks(path) && NS_SUCCEEDED(path->GetPath(str))) {
     paths.AppendElement(NS_ConvertUTF16toUTF8(str));
   }
 #endif
   // Libxul path. Note: re-using 'path' var here, as we assume libxul is in
   // the same directory as Firefox executable.
--- a/media/gmp-clearkey/0.1/gmp-clearkey.cpp
+++ b/media/gmp-clearkey/0.1/gmp-clearkey.cpp
@@ -22,17 +22,17 @@
 #include "ClearKeyCDM.h"
 #include "ClearKeySessionManager.h"
 // This include is required in order for content_decryption_module to work
 // on Unix systems.
 #include "stddef.h"
 #include "content_decryption_module.h"
 #include "content_decryption_module_ext.h"
 
-#if defined(XP_MACOSX) || defined(XP_LINUX)
+#ifndef XP_WIN
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #endif
 
 #ifdef ENABLE_WMF
 #include "WMFUtils.h"
 #endif // ENABLE_WMF
@@ -83,29 +83,27 @@ bool
 CanReadSome(cdm::PlatformFile aFile)
 {
   vector<uint8_t> data;
   data.resize(TEST_READ_SIZE);
 #ifdef XP_WIN
   DWORD bytesRead = 0;
   return ReadFile(aFile, &data.front(), TEST_READ_SIZE, &bytesRead, nullptr) &&
          bytesRead > 0;
-#elif defined(XP_MACOSX) || defined(XP_LINUX)
+#else
   return read(aFile, &data.front(), TEST_READ_SIZE) > 0;
-#else
-  return false;
 #endif
 }
 
 void
 ClosePlatformFile(cdm::PlatformFile aFile)
 {
 #ifdef XP_WIN
   CloseHandle(aFile);
-#elif defined(XP_MACOSX) || defined(XP_LINUX)
+#else
   close(aFile);
 #endif
 }
 
 CDM_API
 bool
 VerifyCdmHost_0(const cdm::HostFile* aHostFiles, uint32_t aNumFiles)
 {