Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/security/tor-browser tor-browser: merge multiprocess c...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b1e88ac21d25
branches:  trunk
changeset: 434526:b1e88ac21d25
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Thu Jun 18 12:56:40 2020 +0000

description:
tor-browser: merge multiprocess changes from firefox68

Bump PKGREVISION.

diffstat:

 security/tor-browser/Makefile                                                |    4 +-
 security/tor-browser/distinfo                                                |    7 +-
 security/tor-browser/patches/patch-browser_app_profile_firefox.js            |    9 +-
 security/tor-browser/patches/patch-gfx_thebes_gfxPlatform.cpp                |   28 +
 security/tor-browser/patches/patch-ipc_glue_CrossProcessSemaphore.h          |   18 -
 security/tor-browser/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp |  187 ----------
 6 files changed, 36 insertions(+), 217 deletions(-)

diffs (truncated from 315 to 300 lines):

diff -r b4b8b68a74b2 -r b1e88ac21d25 security/tor-browser/Makefile
--- a/security/tor-browser/Makefile     Thu Jun 18 12:26:42 2020 +0000
+++ b/security/tor-browser/Makefile     Thu Jun 18 12:56:40 2020 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.67 2020/06/17 18:02:53 nia Exp $
+# $NetBSD: Makefile,v 1.68 2020/06/18 12:56:40 wiz Exp $
 
 DISTNAME=      src-firefox-tor-browser-68.9.0esr-9.5-1-build2
 PKGNAME=       tor-browser-9.5
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    security www
 MASTER_SITES=  https://dist.torproject.org/torbrowser/${PKGVERSION_NOREV}/
 EXTRACT_SUFX=  .tar.xz
diff -r b4b8b68a74b2 -r b1e88ac21d25 security/tor-browser/distinfo
--- a/security/tor-browser/distinfo     Thu Jun 18 12:26:42 2020 +0000
+++ b/security/tor-browser/distinfo     Thu Jun 18 12:56:40 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.22 2020/06/17 18:02:53 nia Exp $
+$NetBSD: distinfo,v 1.23 2020/06/18 12:56:40 wiz Exp $
 
 SHA1 (src-firefox-tor-browser-68.9.0esr-9.5-1-build2.tar.xz) = 27b3e18e92341557b9c8b18afd114d458dd2e403
 RMD160 (src-firefox-tor-browser-68.9.0esr-9.5-1-build2.tar.xz) = db61ef7788f1b6c4111e7a4c6df56c7bd51e6777
@@ -11,7 +11,7 @@
 SHA1 (patch-.mozconfig) = 66fbb2f113091eee1f022cd656231f845b04b0f8
 SHA1 (patch-aa) = 9f7200c411cd2217a80ec10a276c8877bc6b845c
 SHA1 (patch-browser_app_profile_000-tor-browser.js) = 84a0a15605fff0e22f3150bce901a296fc920280
-SHA1 (patch-browser_app_profile_firefox.js) = 076cc2892547bac07fe907533f4e821f13f5738e
+SHA1 (patch-browser_app_profile_firefox.js) = cf93582b68b8d4e72c3c25682ab9138e185418c8
 SHA1 (patch-build_moz.configure_rust.configure) = b57a9b1451dc426d75774f73d7c05fc98fe6e317
 SHA1 (patch-dom_base_nsAttrName.h) = ac7ba441a3b27df2855cf2673eea36b1cb44ad49
 SHA1 (patch-dom_media_CubebUtils.cpp) = 3cd2c65ab281d802c56216565970450767a3fb24
@@ -19,11 +19,10 @@
 SHA1 (patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h) = 2f73c76c48852613e0c55c1680fcc2a9eb3cf4ef
 SHA1 (patch-gfx_gl_GLContextProviderGLX.cpp) = 2c909a10a341e600392417240ad0c556f495d6ba
 SHA1 (patch-gfx_skia_skia_src_core_SkCpu.cpp) = 36218819254f3681b9c717d652ea78c9f20d49ad
+SHA1 (patch-gfx_thebes_gfxPlatform.cpp) = e4a25e4a96055b1c42ec018b02d1828257a571de
 SHA1 (patch-ipc_chromium_src_base_message__pump__libevent.cc) = 4a6606da590cfb8d855bde58b9c6f90e98d0870c
 SHA1 (patch-ipc_chromium_src_base_platform__thread__posix.cc) = 35d20981d33ccdb1d8ffb8039e48798777f11658
 SHA1 (patch-ipc_chromium_src_chrome_common_ipc__channel__posix.cc) = d634805bf3b02475081cb2f263e91e3f4c481a29
-SHA1 (patch-ipc_glue_CrossProcessSemaphore.h) = 25e24743060acf10c776c6b3b3660f52a2e9fbe8
-SHA1 (patch-ipc_glue_CrossProcessSemaphore__posix.cpp) = f8d155ee66008b7cc4052b6a889327543b89e0bb
 SHA1 (patch-ipc_glue_GeckoChildProcessHost.cpp) = 260c29bacd8bf265951b7a412f850bf2b292c836
 SHA1 (patch-js_src_threading_posix_Thread.cpp) = 47e612a676e614fd6dd43b8a3140218a3fbdc7fa
 SHA1 (patch-js_src_util_NativeStack.cpp) = 2c6f844d38343f40ebbc8fd665279256e4ae6d35
diff -r b4b8b68a74b2 -r b1e88ac21d25 security/tor-browser/patches/patch-browser_app_profile_firefox.js
--- a/security/tor-browser/patches/patch-browser_app_profile_firefox.js Thu Jun 18 12:26:42 2020 +0000
+++ b/security/tor-browser/patches/patch-browser_app_profile_firefox.js Thu Jun 18 12:56:40 2020 +0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-browser_app_profile_firefox.js,v 1.2 2020/03/13 17:59:27 wiz Exp $
+$NetBSD: patch-browser_app_profile_firefox.js,v 1.3 2020/06/18 12:56:40 wiz Exp $
 
---- browser/app/profile/firefox.js.orig        2019-07-06 01:48:29.000000000 +0000
+--- browser/app/profile/firefox.js.orig        2020-05-28 00:01:33.000000000 +0000
 +++ browser/app/profile/firefox.js
-@@ -1865,6 +1865,15 @@ pref("prio.publicKeyB", "26E6674E65425B8
+@@ -1862,6 +1862,12 @@ pref("prio.publicKeyB", "26E6674E65425B8
  pref("toolkit.coverage.enabled", false);
  pref("toolkit.coverage.endpoint.base", "https://coverage.mozilla.org";);
  
@@ -12,9 +12,6 @@
 +// Enable system addons, for example langpacks from www/firefox-l10n
 +pref("extensions.autoDisableScopes", 11);
 +
-+// Disable multiprocess window support. Workaround for PR 53273.
-+pref("browser.tabs.remote.autostart", false);
-+
  // Discovery prefs
  pref("browser.discovery.enabled", true);
  pref("browser.discovery.containers.enabled", true);
diff -r b4b8b68a74b2 -r b1e88ac21d25 security/tor-browser/patches/patch-gfx_thebes_gfxPlatform.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/tor-browser/patches/patch-gfx_thebes_gfxPlatform.cpp     Thu Jun 18 12:56:40 2020 +0000
@@ -0,0 +1,28 @@
+$NetBSD: patch-gfx_thebes_gfxPlatform.cpp,v 1.1 2020/06/18 12:56:40 wiz Exp $
+
+Don't rely on CrossProcessSemaphore on NetBSD. It has some implementation
+issues that cause issues (kern/55386, not available on NetBSD<9)
+
+This idea is borrowed from macOS which has the same limitation.
+
+--- gfx/thebes/gfxPlatform.cpp.orig    2020-05-28 00:01:45.000000000 +0000
++++ gfx/thebes/gfxPlatform.cpp
+@@ -2991,6 +2991,10 @@ bool gfxPlatform::UsesOffMainThreadCompo
+ }
+ 
+ bool gfxPlatform::UsesTiling() const {
++#ifdef __NetBSD__
++  // Avoid relying on CrossProcessSemaphore
++  return true;
++#else
+   bool usesSkia = GetDefaultContentBackend() == BackendType::SKIA;
+ 
+   // We can't just test whether the PaintThread is initialized here because
+@@ -3002,6 +3006,7 @@ bool gfxPlatform::UsesTiling() const {
+ 
+   return gfxPrefs::LayersTilesEnabled() ||
+          (gfxPrefs::LayersTilesEnabledIfSkiaPOMTP() && usesSkia && usesPOMTP);
++#endif
+ }
+ 
+ bool gfxPlatform::ContentUsesTiling() const {
diff -r b4b8b68a74b2 -r b1e88ac21d25 security/tor-browser/patches/patch-ipc_glue_CrossProcessSemaphore.h
--- a/security/tor-browser/patches/patch-ipc_glue_CrossProcessSemaphore.h       Thu Jun 18 12:26:42 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-$NetBSD: patch-ipc_glue_CrossProcessSemaphore.h,v 1.2 2020/03/13 17:59:27 wiz Exp $
-
---- ipc/glue/CrossProcessSemaphore.h.orig      2018-10-18 20:06:06.000000000 +0000
-+++ ipc/glue/CrossProcessSemaphore.h
-@@ -93,7 +93,13 @@ private:
-   HANDLE mSemaphore;
- #elif !defined(OS_MACOSX)
-   RefPtr<mozilla::ipc::SharedMemoryBasic> mSharedBuffer;
-+#if defined(__NetBSD__)
-+  pthread_mutex_t* mMutex;
-+  pthread_cond_t* mNotZero;
-+  uint32_t* mValue;
-+#else
-   sem_t* mSemaphore;
-+#endif
-   mozilla::Atomic<int32_t>* mRefCount;
- #endif
- };
diff -r b4b8b68a74b2 -r b1e88ac21d25 security/tor-browser/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp
--- a/security/tor-browser/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp      Thu Jun 18 12:26:42 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-$NetBSD: patch-ipc_glue_CrossProcessSemaphore__posix.cpp,v 1.3 2020/03/13 17:59:27 wiz Exp $
-
---- ipc/glue/CrossProcessSemaphore_posix.cpp.orig      2019-01-18 00:20:30.000000000 +0000
-+++ ipc/glue/CrossProcessSemaphore_posix.cpp
-@@ -9,6 +9,11 @@
- #include "nsDebug.h"
- #include "nsISupportsImpl.h"
- #include <errno.h>
-+#if defined(__NetBSD__)
-+#include <iostream>
-+#include <unistd.h>
-+#include <limits>
-+#endif
- 
- static const uint64_t kNsPerMs = 1000000;
- static const uint64_t kNsPerSec = 1000000000;
-@@ -16,7 +21,13 @@ static const uint64_t kNsPerSec = 100000
- namespace {
- 
- struct SemaphoreData {
-+#if defined(__NetBSD__)
-+  pthread_mutex_t mMutex;
-+  pthread_cond_t mNotZero;
-+  uint32_t mValue;
-+#else
-   sem_t mSemaphore;
-+#endif
-   mozilla::Atomic<int32_t> mRefCount;
-   uint32_t mInitialValue;
- };
-@@ -42,13 +53,27 @@ namespace mozilla {
-     return nullptr;
-   }
- 
-+#if defined(__NetBSD__)
-+  data->mValue = aInitialValue;
-+  if (pthread_mutex_init(&data->mMutex, NULL) ||
-+      pthread_cond_init(&data->mNotZero, NULL) ) {
-+    return nullptr;
-+  }
-+#else
-   if (sem_init(&data->mSemaphore, 1, aInitialValue)) {
-     return nullptr;
-   }
-+#endif
- 
-   CrossProcessSemaphore* sem = new CrossProcessSemaphore;
-   sem->mSharedBuffer = sharedBuffer;
-+#if defined(__NetBSD__)
-+  sem->mMutex = &data->mMutex;
-+  sem->mNotZero = &data->mNotZero;
-+  sem->mValue = &data->mValue;
-+#else
-   sem->mSemaphore = &data->mSemaphore;
-+#endif
-   sem->mRefCount = &data->mRefCount;
-   *sem->mRefCount = 1;
- 
-@@ -83,23 +108,44 @@ namespace mozilla {
- 
-   int32_t oldCount = data->mRefCount++;
-   if (oldCount == 0) {
-+#if defined(__NetBSD__)
-+    if (pthread_mutex_init(&data->mMutex, NULL) ||
-+        pthread_cond_init(&data->mNotZero, NULL) ) {
-+      data->mRefCount--;
-+      return nullptr;
-+    }
-+#else
-     // The other side has already let go of their CrossProcessSemaphore, so now
-     // mSemaphore is garbage. We need to re-initialize it.
-     if (sem_init(&data->mSemaphore, 1, data->mInitialValue)) {
-       data->mRefCount--;
-       return nullptr;
-     }
-+#endif
-   }
- 
-   CrossProcessSemaphore* sem = new CrossProcessSemaphore;
-   sem->mSharedBuffer = sharedBuffer;
-+#if defined(__NetBSD__)
-+  sem->mMutex = &data->mMutex;
-+  sem->mNotZero = &data->mNotZero;
-+  sem->mValue = &data->mValue;
-+#else
-   sem->mSemaphore = &data->mSemaphore;
-+#endif
-   sem->mRefCount = &data->mRefCount;
-   return sem;
- }
- 
- CrossProcessSemaphore::CrossProcessSemaphore()
--    : mSemaphore(nullptr), mRefCount(nullptr) {
-+#if defined(__NetBSD__)
-+  : mMutex (nullptr)
-+  , mNotZero (nullptr)
-+  , mValue (nullptr)
-+#else
-+    : mSemaphore(nullptr)
-+#endif
-+    , mRefCount(nullptr) {
-   MOZ_COUNT_CTOR(CrossProcessSemaphore);
- }
- 
-@@ -108,16 +154,57 @@ CrossProcessSemaphore::~CrossProcessSema
- 
-   if (oldCount == 0) {
-     // Nothing can be done if the destroy fails so ignore return code.
-+#if defined(__NetBSD__)
-+    (void)pthread_cond_destroy(mNotZero);
-+    (void)pthread_mutex_destroy(mMutex);
-+#else
-     Unused << sem_destroy(mSemaphore);
-+#endif
-   }
- 
-   MOZ_COUNT_DTOR(CrossProcessSemaphore);
- }
- 
-+#if defined(__NetBSD__)
-+static struct timespec
-+makeAbsTime(const Maybe<TimeDuration>& aWaitTime) {
-+  struct timespec ts;
-+  if (aWaitTime.isSome()) {
-+    clock_gettime(CLOCK_REALTIME, &ts);
-+    ts.tv_nsec += (kNsPerMs * aWaitTime->ToMilliseconds());
-+    ts.tv_sec += ts.tv_nsec / kNsPerSec;
-+    ts.tv_nsec %= kNsPerSec;
-+  }
-+  else {
-+    ts.tv_sec = std::numeric_limits<time_t>::max();
-+    ts.tv_nsec = 0;
-+  }
-+  return ts;
-+}
-+#endif
-+
- bool CrossProcessSemaphore::Wait(const Maybe<TimeDuration>& aWaitTime) {
-   MOZ_ASSERT(*mRefCount > 0,
-              "Attempting to wait on a semaphore with zero ref count");
-   int ret;
-+#if defined(__NetBSD__)
-+  struct timespec ts = makeAbsTime(aWaitTime);
-+
-+  ret = pthread_mutex_lock(mMutex);
-+
-+  if (ret == 0) {
-+    while (ret == 0 && mValue == 0) {
-+      ret = pthread_cond_timedwait(mNotZero, mMutex, &ts);
-+      while (ret == -1 && errno == EINTR) {
-+        ret = pthread_cond_timedwait(mNotZero, mMutex, &ts);
-+      }
-+    }
-+    if (ret == 0) {
-+      --(*mValue);
-+    }
-+    pthread_mutex_unlock(mMutex);
-+  }
-+#else
-   if (aWaitTime.isSome()) {
-     struct timespec ts;
-     if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {
-@@ -134,13 +221,24 @@ bool CrossProcessSemaphore::Wait(const M
-     while ((ret = sem_wait(mSemaphore)) == -1 && errno == EINTR) {
-     }
-   }
-+#endif
-   return ret == 0;
- }
- 
- void CrossProcessSemaphore::Signal() {
-   MOZ_ASSERT(*mRefCount > 0,



Home | Main Index | Thread Index | Old Index