Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Dec 2017 11:19:28 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r455272 - in branches/2017Q4/www/firefox: . files
Message-ID:  <201712011119.vB1BJSkN096487@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Fri Dec  1 11:19:28 2017
New Revision: 455272
URL: https://svnweb.freebsd.org/changeset/ports/455272

Log:
  www/firefox: backport more FF57+ fixes (direct commit)
  
  PR:		222859
  Security:	Mozilla bug 1410106/1420001
  Approved by:	ports-secteam blanket

Added:
  branches/2017Q4/www/firefox/files/patch-bug1405364   (contents, props changed)
  branches/2017Q4/www/firefox/files/patch-bug1410106   (contents, props changed)
  branches/2017Q4/www/firefox/files/patch-bug1420001   (contents, props changed)
Modified:
  branches/2017Q4/www/firefox/Makefile

Modified: branches/2017Q4/www/firefox/Makefile
==============================================================================
--- branches/2017Q4/www/firefox/Makefile	Fri Dec  1 11:19:21 2017	(r455271)
+++ branches/2017Q4/www/firefox/Makefile	Fri Dec  1 11:19:28 2017	(r455272)
@@ -4,7 +4,7 @@
 PORTNAME=	firefox
 DISTVERSION=	56.0.2
 DISTVERSIONSUFFIX=.source
-PORTREVISION=	10
+PORTREVISION=	11
 PORTEPOCH=	1
 CATEGORIES=	www ipv6
 MASTER_SITES=	MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \

Added: branches/2017Q4/www/firefox/files/patch-bug1405364
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2017Q4/www/firefox/files/patch-bug1405364	Fri Dec  1 11:19:28 2017	(r455272)
@@ -0,0 +1,84 @@
+commit bc3e9c9c8230
+Author: Andrew Osmond <aosmond@mozilla.com>
+Date:   Mon Oct 30 06:58:04 2017 -0400
+
+    Bug 1405364 - ImageBridgeParent::GetInstance should not mutate sImageBridges for lookups. r=sotaro a=sylvestre
+    
+    --HG--
+    extra : amend_source : 6121399940a53f45027923e0e3f5a517722036ed
+    extra : transplant_source : %D1%06%8F%0D%25%B3%FD%82%3D%C9%0A%5C%9B%C7%3B%15%9C%A7%EC%91
+---
+ gfx/layers/ipc/ImageBridgeParent.cpp | 18 ++++++++++++------
+ gfx/layers/ipc/ImageBridgeParent.h   |  5 +++--
+ 2 files changed, 15 insertions(+), 8 deletions(-)
+
+diff --git gfx/layers/ipc/ImageBridgeParent.cpp gfx/layers/ipc/ImageBridgeParent.cpp
+index 745576a3a7b3..8f8f60ffcd78 100644
+--- gfx/layers/ipc/ImageBridgeParent.cpp
++++ gfx/layers/ipc/ImageBridgeParent.cpp
+@@ -42,7 +42,7 @@ using namespace mozilla::ipc;
+ using namespace mozilla::gfx;
+ using namespace mozilla::media;
+ 
+-std::map<base::ProcessId, ImageBridgeParent*> ImageBridgeParent::sImageBridges;
++ImageBridgeParent::ImageBridgeMap ImageBridgeParent::sImageBridges;
+ 
+ StaticAutoPtr<mozilla::Monitor> sImageBridgesLock;
+ 
+@@ -366,8 +366,9 @@ ImageBridgeParent::NotifyImageComposites(nsTArray<ImageCompositeNotificationInfo
+       notifications.AppendElement(aNotifications[end].mNotification);
+       ++end;
+     }
+-    GetInstance(pid)->SendPendingAsyncMessages();
+-    if (!GetInstance(pid)->SendDidComposite(notifications)) {
++    RefPtr<ImageBridgeParent> bridge = GetInstance(pid);
++    bridge->SendPendingAsyncMessages();
++    if (!bridge->SendDidComposite(notifications)) {
+       ok = false;
+     }
+     i = end;
+@@ -382,13 +383,18 @@ ImageBridgeParent::DeferredDestroy()
+   mSelfRef = nullptr; // "this" ImageBridge may get deleted here.
+ }
+ 
+-RefPtr<ImageBridgeParent>
++already_AddRefed<ImageBridgeParent>
+ ImageBridgeParent::GetInstance(ProcessId aId)
+ {
+   MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
+   MonitorAutoLock lock(*sImageBridgesLock);
+-  NS_ASSERTION(sImageBridges.count(aId) == 1, "ImageBridgeParent for the process");
+-  return sImageBridges[aId];
++  ImageBridgeMap::const_iterator i = sImageBridges.find(aId);
++  if (i == sImageBridges.end()) {
++    NS_ASSERTION(false, "Cannot find image bridge for process!");
++    return nullptr;
++  }
++  RefPtr<ImageBridgeParent> bridge = i->second;
++  return bridge.forget();
+ }
+ 
+ bool
+diff --git gfx/layers/ipc/ImageBridgeParent.h gfx/layers/ipc/ImageBridgeParent.h
+index 7475b67e356d..3edd1f8861ee 100644
+--- gfx/layers/ipc/ImageBridgeParent.h
++++ gfx/layers/ipc/ImageBridgeParent.h
+@@ -114,7 +114,7 @@ public:
+ 
+   virtual bool IsSameProcess() const override;
+ 
+-  static RefPtr<ImageBridgeParent> GetInstance(ProcessId aId);
++  static already_AddRefed<ImageBridgeParent> GetInstance(ProcessId aId);
+ 
+   static bool NotifyImageComposites(nsTArray<ImageCompositeNotificationInfo>& aNotifications);
+ 
+@@ -140,7 +140,8 @@ private:
+   /**
+    * Map of all living ImageBridgeParent instances
+    */
+-  static std::map<base::ProcessId, ImageBridgeParent*> sImageBridges;
++  typedef std::map<base::ProcessId, ImageBridgeParent*> ImageBridgeMap;
++  static ImageBridgeMap sImageBridges;
+ 
+   RefPtr<CompositorThreadHolder> mCompositorThreadHolder;
+ };

Added: branches/2017Q4/www/firefox/files/patch-bug1410106
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2017Q4/www/firefox/files/patch-bug1410106	Fri Dec  1 11:19:28 2017	(r455272)
@@ -0,0 +1,86 @@
+commit b5408a6b95e1
+Author: Andrea Marchesini <amarchesini@mozilla.com>
+Date:   Wed Nov 8 06:43:50 2017 +0100
+
+    Bug 1410106 - Better check about privateBrowsing for IDB. r=asuth, a=ritu
+    
+    --HG--
+    extra : source : 8a46aeb0b562dd2ac240657a53f489046deb9acb
+---
+ dom/indexedDB/ActorsParent.cpp           | 35 ++++++++++++++++++++++----------
+ dom/indexedDB/IDBFactory.cpp             |  1 -
+ dom/indexedDB/PBackgroundIDBFactory.ipdl |  1 -
+ 3 files changed, 24 insertions(+), 13 deletions(-)
+
+diff --git dom/indexedDB/ActorsParent.cpp dom/indexedDB/ActorsParent.cpp
+index 42aa9e38d630..21232cd4c0e3 100644
+--- dom/indexedDB/ActorsParent.cpp
++++ dom/indexedDB/ActorsParent.cpp
+@@ -21047,19 +21047,32 @@ FactoryOp::CheckPermission(ContentParent* aContentParent,
+   MOZ_ASSERT(mState == State::Initial || mState == State::PermissionRetry);
+ 
+   const PrincipalInfo& principalInfo = mCommonParams.principalInfo();
+-  if (principalInfo.type() != PrincipalInfo::TSystemPrincipalInfo &&
+-      NS_WARN_IF(!Preferences::GetBool(kPrefIndexedDBEnabled, false))) {
+-    if (aContentParent) {
+-      // The DOM in the other process should have kept us from receiving any
+-      // indexedDB messages so assume that the child is misbehaving.
+-      aContentParent->KillHard("IndexedDB CheckPermission 1");
++  if (principalInfo.type() != PrincipalInfo::TSystemPrincipalInfo) {
++    if (principalInfo.type() != PrincipalInfo::TContentPrincipalInfo) {
++      if (aContentParent) {
++        // We just want ContentPrincipalInfo or SystemPrincipalInfo.
++        aContentParent->KillHard("IndexedDB CheckPermission 0");
++      }
++
++      return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
+     }
+-    return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
+-  }
+ 
+-  if (NS_WARN_IF(mCommonParams.privateBrowsingMode())) {
+-    // XXX This is only temporary.
+-    return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
++    if (NS_WARN_IF(!Preferences::GetBool(kPrefIndexedDBEnabled, false))) {
++      if (aContentParent) {
++        // The DOM in the other process should have kept us from receiving any
++        // indexedDB messages so assume that the child is misbehaving.
++        aContentParent->KillHard("IndexedDB CheckPermission 1");
++      }
++
++      return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
++    }
++
++    const ContentPrincipalInfo& contentPrincipalInfo =
++      principalInfo.get_ContentPrincipalInfo();
++    if (contentPrincipalInfo.attrs().mPrivateBrowsingId != 0) {
++      // IndexedDB is currently disabled in privateBrowsing.
++      return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
++    }
+   }
+ 
+   mFileHandleDisabled = !Preferences::GetBool(kPrefFileHandleEnabled);
+diff --git dom/indexedDB/IDBFactory.cpp dom/indexedDB/IDBFactory.cpp
+index 49e60ffc8927..3e12382a932e 100644
+--- dom/indexedDB/IDBFactory.cpp
++++ dom/indexedDB/IDBFactory.cpp
+@@ -638,7 +638,6 @@ IDBFactory::OpenInternal(JSContext* aCx,
+   MOZ_ASSERT_IF(!mWindow, !mPrivateBrowsingMode);
+ 
+   CommonFactoryRequestParams commonParams;
+-  commonParams.privateBrowsingMode() = mPrivateBrowsingMode;
+ 
+   PrincipalInfo& principalInfo = commonParams.principalInfo();
+ 
+diff --git dom/indexedDB/PBackgroundIDBFactory.ipdl dom/indexedDB/PBackgroundIDBFactory.ipdl
+index e6c64dca4e09..1e81e324dc7d 100644
+--- dom/indexedDB/PBackgroundIDBFactory.ipdl
++++ dom/indexedDB/PBackgroundIDBFactory.ipdl
+@@ -22,7 +22,6 @@ struct CommonFactoryRequestParams
+ {
+   DatabaseMetadata metadata;
+   PrincipalInfo principalInfo;
+-  bool privateBrowsingMode;
+ };
+ 
+ struct OpenDatabaseRequestParams

Added: branches/2017Q4/www/firefox/files/patch-bug1420001
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2017Q4/www/firefox/files/patch-bug1420001	Fri Dec  1 11:19:28 2017	(r455272)
@@ -0,0 +1,67 @@
+commit 3bd032461399
+Author: Emilio Cobos Álvarez <emilio@crisal.io>
+Date:   Mon Nov 27 14:57:57 2017 -0600
+
+    Bug 1420001 - style: Disable :visited if the document is being used as an image (from emilio:visited-as-an-image). r=dholbert, a=sledru
+    
+    MozReview-Commit-ID: F9MeT1kXZER
+    Source-Repo: https://github.com/servo/servo
+    Source-Revision: 7c99ae3bb8056f7e30a3b40340200eced385902d
+    
+    --HG--
+    extra : source : ed1802f246cb377522e492bf313038213c114843
+    extra : intermediate-source : d1599028c579f31e1441b9df277bf8f38c0e7f56
+---
+ servo/components/style/gecko/data.rs | 25 +++++++++++++++++++++++--
+ 1 file changed, 23 insertions(+), 2 deletions(-)
+
+diff --git servo/components/style/gecko/data.rs servo/components/style/gecko/data.rs
+index aeab6a938b9f..244fa034ba61 100644
+--- servo/components/style/gecko/data.rs
++++ servo/components/style/gecko/data.rs
+@@ -165,12 +165,20 @@ impl PerDocumentStyleDataImpl {
+     }
+ 
+     /// Returns whether private browsing is enabled.
+-    pub fn is_private_browsing_enabled(&self) -> bool {
++    fn is_private_browsing_enabled(&self) -> bool {
+         let doc =
+             self.stylist.device().pres_context().mDocument.raw::<nsIDocument>();
+         unsafe { bindings::Gecko_IsPrivateBrowsingEnabled(doc) }
+     }
+ 
++    /// Returns whether the document is being used as an image.
++    fn is_being_used_as_an_image(&self) -> bool {
++        let doc =
++            self.stylist.device().pres_context().mDocument.raw::<nsIDocument>();
++
++        unsafe { (*doc).mIsBeingUsedAsImage() }
++    }
++
+     /// Get the default computed values for this document.
+     pub fn default_computed_values(&self) -> &Arc<ComputedValues> {
+         self.stylist.device().default_computed_values_arc()
+@@ -180,9 +188,22 @@ impl PerDocumentStyleDataImpl {
+     fn visited_links_enabled(&self) -> bool {
+         unsafe { bindings::Gecko_AreVisitedLinksEnabled() }
+     }
++
+     /// Returns whether visited styles are enabled.
+     pub fn visited_styles_enabled(&self) -> bool {
+-        self.visited_links_enabled() && !self.is_private_browsing_enabled()
++        if !self.visited_links_enabled() {
++            return false;
++        }
++
++        if self.is_private_browsing_enabled() {
++            return false;
++        }
++
++        if self.is_being_used_as_an_image() {
++            return false;
++        }
++
++        true
+     }
+ 
+     /// Measure heap usage.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712011119.vB1BJSkN096487>