From 4eaf343f6a5d4d8ca3ed10164f815341739bacce Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Sat, 8 Dec 2018 19:41:05 +0000 Subject: [PATCH 1/7] Bug 1510657 - Ensure that we don't attempt to access a channel's window in the parent process inside AntiTrackingCommon::NotifyBlockingDecision() r=baku Some channels such as the dummy channel created inside CookieServiceParent::RecvSetCookieString() do not have an nsIParentChannel interface, but we must be careful to not run the content process code path for them. Differential Revision: https://phabricator.services.mozilla.com/D13519 --HG-- extra : moz-landing-system : lando --- .../antitracking/AntiTrackingCommon.cpp | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/toolkit/components/antitracking/AntiTrackingCommon.cpp b/toolkit/components/antitracking/AntiTrackingCommon.cpp index 0e7b76e95fb1..44b0da2c4ab9 100644 --- a/toolkit/components/antitracking/AntiTrackingCommon.cpp +++ b/toolkit/components/antitracking/AntiTrackingCommon.cpp @@ -1452,19 +1452,23 @@ nsresult AntiTrackingCommon::IsOnContentBlockingAllowList( } // Can be called in EITHER the parent or child process. - nsCOMPtr parentChannel; - NS_QueryNotificationCallbacks(aChannel, parentChannel); - if (parentChannel) { - // This channel is a parent-process proxy for a child process request. - // Tell the child process channel to do this instead. - if (aDecision == BlockingDecision::eBlock) { - parentChannel->NotifyTrackingCookieBlocked(aRejectedReason); - } else { - parentChannel->NotifyCookieAllowed(); + if (XRE_IsParentProcess()) { + nsCOMPtr parentChannel; + NS_QueryNotificationCallbacks(aChannel, parentChannel); + if (parentChannel) { + // This channel is a parent-process proxy for a child process request. + // Tell the child process channel to do this instead. + if (aDecision == BlockingDecision::eBlock) { + parentChannel->NotifyTrackingCookieBlocked(aRejectedReason); + } else { + parentChannel->NotifyCookieAllowed(); + } } return; } + MOZ_ASSERT(XRE_IsContentProcess()); + nsCOMPtr thirdPartyUtil = services::GetThirdPartyUtil(); if (!thirdPartyUtil) { return; From e283953da8815abfa2627cd6c9bd9d7fe91c12d5 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Fri, 7 Dec 2018 18:02:56 +0000 Subject: [PATCH 2/7] Bug 1512179 - Fix a nullptr deref crash in ContentPermissionRequestBase::GetPrincipal() r=baku Differential Revision: https://phabricator.services.mozilla.com/D13852 --HG-- extra : moz-landing-system : lando --- dom/base/nsContentPermissionHelper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dom/base/nsContentPermissionHelper.cpp b/dom/base/nsContentPermissionHelper.cpp index 30ce37137407..468a19d83d96 100644 --- a/dom/base/nsContentPermissionHelper.cpp +++ b/dom/base/nsContentPermissionHelper.cpp @@ -523,20 +523,20 @@ ContentPermissionRequestBase::ContentPermissionRequestBase( NS_IMETHODIMP ContentPermissionRequestBase::GetPrincipal( nsIPrincipal** aRequestingPrincipal) { - NS_ADDREF(*aRequestingPrincipal = mPrincipal); + NS_IF_ADDREF(*aRequestingPrincipal = mPrincipal); return NS_OK; } NS_IMETHODIMP ContentPermissionRequestBase::GetTopLevelPrincipal( nsIPrincipal** aRequestingPrincipal) { - NS_ADDREF(*aRequestingPrincipal = mTopLevelPrincipal); + NS_IF_ADDREF(*aRequestingPrincipal = mTopLevelPrincipal); return NS_OK; } NS_IMETHODIMP ContentPermissionRequestBase::GetWindow(mozIDOMWindow** aRequestingWindow) { - NS_ADDREF(*aRequestingWindow = mWindow); + NS_IF_ADDREF(*aRequestingWindow = mWindow); return NS_OK; } From 02f24d2f6069dd37876803cafbf26a62be1e5a0b Mon Sep 17 00:00:00 2001 From: Gijs Kruitbosch Date: Wed, 5 Dec 2018 21:31:45 +0000 Subject: [PATCH 3/7] Bug 1483354 - avoid flushing layout for new background tabs when the tabstrip isn't overflowing, r=dao Differential Revision: https://phabricator.services.mozilla.com/D13675 --HG-- extra : moz-landing-system : lando --- browser/base/content/tabbrowser.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 40f77464b30b..0efa22b09853 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -931,7 +931,7 @@ Date: Sat, 8 Dec 2018 16:27:12 +0000 Subject: [PATCH 4/7] Bug 1483354 - use promiseDocumentFlushed to execute tabstrip scrolling after creating a background tab, r=dao Depends on D13675 Differential Revision: https://phabricator.services.mozilla.com/D13676 --HG-- extra : moz-landing-system : lando --- browser/base/content/tabbrowser.xml | 71 +++++++++++++++++------------ 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 0efa22b09853..dde684598c3b 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -934,39 +934,50 @@ if (aTab.pinned || aTab.hidden || this.getAttribute("overflow") != "true") return; - var scrollRect = this.arrowScrollbox.scrollClientRect; - var tab = aTab.getBoundingClientRect(); + this._lastTabToScrollIntoView = aTab; + if (!this._backgroundTabScrollPromise) { + this._backgroundTabScrollPromise = window.promiseDocumentFlushed(() => { + let lastTabRect = this._lastTabToScrollIntoView.getBoundingClientRect(); + let selectedTab = this.selectedItem; + if (selectedTab.pinned) { + selectedTab = null; + } else { + selectedTab = selectedTab.getBoundingClientRect(); + selectedTab = {left: selectedTab.left, right: selectedTab.right}; + } + delete this._lastTabToScrollIntoView; + delete this._backgroundTabScrollPromise; + return [ + this.arrowScrollbox.scrollClientRect, + {left: lastTabRect.left, right: lastTabRect.right}, + selectedTab, + ]; + }).then(([scrollRect, tab, selected]) => { + // Is the new tab already completely visible? + if (scrollRect.left <= tab.left && tab.right <= scrollRect.right) + return; - // DOMRect left/right properties are immutable. - tab = {left: tab.left, right: tab.right}; + if (this.arrowScrollbox.smoothScroll) { + // Can we make both the new tab and the selected tab completely visible? + if (!selected || + Math.max(tab.right - selected.left, selected.right - tab.left) <= + scrollRect.width) { + this.arrowScrollbox.ensureElementIsVisible(aTab); + return; + } - // Is the new tab already completely visible? - if (scrollRect.left <= tab.left && tab.right <= scrollRect.right) - return; + this.arrowScrollbox.scrollByPixels(RTL_UI ? + selected.right - scrollRect.right : + selected.left - scrollRect.left); + } - if (this.arrowScrollbox.smoothScroll) { - let selectedTab = this.selectedItem; - let selected = !selectedTab.pinned && - selectedTab.getBoundingClientRect(); - - // Can we make both the new tab and the selected tab completely visible? - if (!selected || - Math.max(tab.right - selected.left, selected.right - tab.left) <= - scrollRect.width) { - this.arrowScrollbox.ensureElementIsVisible(aTab); - return; - } - - this.arrowScrollbox.scrollByPixels(RTL_UI ? - selected.right - scrollRect.right : - selected.left - scrollRect.left); - } - - if (!this._animateElement.hasAttribute("highlight")) { - this._animateElement.setAttribute("highlight", "true"); - setTimeout(function(ele) { - ele.removeAttribute("highlight"); - }, 150, this._animateElement); + if (!this._animateElement.hasAttribute("highlight")) { + this._animateElement.setAttribute("highlight", "true"); + setTimeout(function(ele) { + ele.removeAttribute("highlight"); + }, 150, this._animateElement); + } + }); } ]]> From 7040d79ff996b00091f09abceff37b85491d42b3 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Sat, 8 Dec 2018 20:19:16 +0000 Subject: [PATCH 5/7] Bug 1510275 - Make sure that we only ever dispatch a single STATE_COOKIES_LOADED notification per top-level document r=baku Differential Revision: https://phabricator.services.mozilla.com/D13849 --HG-- extra : moz-landing-system : lando --- dom/base/ContentBlockingLog.h | 10 +++++++--- dom/base/nsGlobalWindowOuter.cpp | 11 +++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/dom/base/ContentBlockingLog.h b/dom/base/ContentBlockingLog.h index c59ea1fb712a..2c3dfaf2ada1 100644 --- a/dom/base/ContentBlockingLog.h +++ b/dom/base/ContentBlockingLog.h @@ -156,6 +156,10 @@ class ContentBlockingLog final { } bool HasBlockedAnyOfType(uint32_t aType) { + // Note: nothing inside this loop should return false, the goal for the + // loop is to scan the log to see if we find a matching entry, and if so + // we would return true, otherwise in the end of the function outside of + // the loop we take the common `return false;` statement. for (auto iter = mLog.Iter(); !iter.Done(); iter.Next()) { if (!iter.UserData()) { continue; @@ -166,10 +170,10 @@ class ContentBlockingLog final { return true; } } else if (aType == nsIWebProgressListener::STATE_COOKIES_LOADED) { - if (Get<1>(*iter.UserData()).isSome()) { - return Get<1>(*iter.UserData()).value(); + if (Get<1>(*iter.UserData()).isSome() && + Get<1>(*iter.UserData()).value()) { + return true; } - return false; // false means not blocked, aka not loaded any cookies } else { for (auto& item : Get<2>(*iter.UserData())) { if ((item.mType & aType) != 0) { diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp index ec3f466d6c0a..c58b5787eec3 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp @@ -5031,6 +5031,7 @@ void nsGlobalWindowOuter::NotifyContentBlockingState(unsigned aState, nsAutoString origin; nsContentUtils::GetUTFOrigin(aURIHint, origin); + bool blockedValue = aBlocked; bool unblocked = false; if (aState == nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT) { doc->SetHasTrackingContentBlocked(aBlocked, origin); @@ -5069,14 +5070,16 @@ void nsGlobalWindowOuter::NotifyContentBlockingState(unsigned aState, // Note that the logic in this branch is the logical negation of the logic // in other branches, since the nsIDocument API we have is phrased in // "loaded" terms as opposed to "blocked" terms. - doc->SetHasCookiesLoaded(!aBlocked, origin); - aBlocked = true; - unblocked = false; + blockedValue = !aBlocked; + doc->SetHasCookiesLoaded(blockedValue, origin); + if (!aBlocked) { + unblocked = !doc->GetHasCookiesLoaded(); + } } else { // Ignore nsIWebProgressListener::STATE_BLOCKED_UNSAFE_CONTENT; } const uint32_t oldState = state; - if (aBlocked) { + if (blockedValue) { state |= aState; } else if (unblocked) { state &= ~aState; From 571d6b7d323cf1f4b3887f0960501fcf3e7a69c7 Mon Sep 17 00:00:00 2001 From: Johann Hofmann Date: Sat, 8 Dec 2018 20:50:12 +0000 Subject: [PATCH 6/7] Bug 1511655 - Re-enable browser_UrlbarInput_tooltip.js on Windows. r=dao Differential Revision: https://phabricator.services.mozilla.com/D14016 --HG-- extra : moz-landing-system : lando --- browser/components/urlbar/tests/browser/browser.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/browser/components/urlbar/tests/browser/browser.ini b/browser/components/urlbar/tests/browser/browser.ini index c6dd622adc36..d27448db7dd0 100644 --- a/browser/components/urlbar/tests/browser/browser.ini +++ b/browser/components/urlbar/tests/browser/browser.ini @@ -9,7 +9,6 @@ support-files = [browser_UrlbarInput_formatValue.js] [browser_UrlbarInput_overflow.js] [browser_UrlbarInput_tooltip.js] -skip-if = os == "win" # Bug 1511655 [browser_UrlbarInput_trimURLs.js] subsuite = clipboard [browser_UrlbarInput_unit.js] From dc3585e58b427c3a8a7c01712fe54ebe118a3ce2 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Sun, 9 Dec 2018 05:07:48 +0000 Subject: [PATCH 7/7] Bug 1423215 - Upload an uncompressed runnable-jobs.json artifact in addition to the gz version r=dustin Uploading both versions will hopefully make this easier to uplift. Once old pushes and artifacts expire, we can stop uploading the gzipped version. Differential Revision: https://phabricator.services.mozilla.com/D13601 --HG-- extra : moz-landing-system : lando --- taskcluster/taskgraph/decision.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/taskcluster/taskgraph/decision.py b/taskcluster/taskgraph/decision.py index 24ff46099ccf..a7deb93f39e0 100644 --- a/taskcluster/taskgraph/decision.py +++ b/taskcluster/taskgraph/decision.py @@ -169,8 +169,9 @@ def taskgraph_decision(options, parameters=None): full_task_json = tgg.full_task_graph.to_json() write_artifact('full-task-graph.json', full_task_json) - # write out the public/runnable-jobs.json.gz file + # write out the public/runnable-jobs.json file write_artifact('runnable-jobs.json.gz', full_task_graph_to_runnable_jobs(full_task_json)) + write_artifact('runnable-jobs.json', full_task_graph_to_runnable_jobs(full_task_json)) # this is just a test to check whether the from_json() function is working _, _ = TaskGraph.from_json(full_task_json)