Bug 1457092 - Content sandbox codepaths are Linux only. r=gcp
authorLandry Breuil <landry@openbsd.org>
Wed, 22 Aug 2018 05:27:00 -0400
changeset 433084 411427c1f5fe876edcd92f31b3c86bbb8d509ac7
parent 433083 8f5c17ac83aa8cd493b9b051820ccc4d61c46a14
child 433085 3ad8c54c6dc8978a3317544bea487cef8860db50
push id34499
push usercsabou@mozilla.com
push dateThu, 23 Aug 2018 21:40:51 +0000
treeherdermozilla-central@49b70f7e6817 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcp
bugs1457092
milestone63.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 1457092 - Content sandbox codepaths are Linux only. r=gcp
gfx/thebes/gfxFcPlatformFontList.cpp
gfx/thebes/gfxFcPlatformFontList.h
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ b/gfx/thebes/gfxFcPlatformFontList.cpp
@@ -1538,17 +1538,17 @@ gfxFcPlatformFontList::AddFontSetFamilie
         FcChar8* path;
         if (FcPatternGetString(pattern, FC_FILE, 0, &path) != FcResultMatch) {
             continue;
         }
         if (access(reinterpret_cast<const char*>(path), F_OK | R_OK) != 0) {
             continue;
         }
 
-#ifdef MOZ_CONTENT_SANDBOX
+#if defined(MOZ_CONTENT_SANDBOX) && defined (XP_LINUX)
         // Skip any fonts that will be blocked by the content-process sandbox
         // policy.
         if (aPolicy && !(aPolicy->Lookup(reinterpret_cast<const char*>(path)) &
                          SandboxBroker::Perms::MAY_READ)) {
             continue;
         }
 #endif
 
@@ -1700,17 +1700,17 @@ gfxFcPlatformFontList::InitFontListForPl
 
         return NS_OK;
     }
 
     mLastConfig = FcConfigGetCurrent();
 
     UniquePtr<SandboxPolicy> policy;
 
-#ifdef MOZ_CONTENT_SANDBOX
+#if defined(MOZ_CONTENT_SANDBOX) && defined (XP_LINUX)
     // If read sandboxing is enabled, create a temporary SandboxPolicy to
     // check font paths; use a fake PID to avoid picking up any PID-specific
     // rules by accident.
     SandboxBrokerPolicyFactory policyFactory;
     if (GetEffectiveContentSandboxLevel() > 2 &&
         !PR_GetEnv("MOZ_DISABLE_CONTENT_SANDBOX")) {
         policy = policyFactory.GetContentPolicy(-1, false);
     }
--- a/gfx/thebes/gfxFcPlatformFontList.h
+++ b/gfx/thebes/gfxFcPlatformFontList.h
@@ -335,17 +335,17 @@ public:
     void GetSampleLangForGroup(nsAtom* aLanguage, nsACString& aLangStr,
                                bool aForFontEnumerationThread = false);
 
     static FT_Library GetFTLibrary();
 
 protected:
     virtual ~gfxFcPlatformFontList();
 
-#ifdef MOZ_CONTENT_SANDBOX
+#if defined(MOZ_CONTENT_SANDBOX) && defined(XP_LINUX)
     typedef mozilla::SandboxBroker::Policy SandboxPolicy;
 #else
     // Dummy type just so we can still have a SandboxPolicy* parameter.
     struct SandboxPolicy {};
 #endif
 
     // Add all the font families found in a font set.
     // aAppFonts indicates whether this is the system or application fontset.