From afaa32ab40d8e577b40a431ed951fb1352f46590 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sun, 2 Dec 2018 11:56:00 +0200 Subject: [PATCH 01/10] Bug 1511714 - Unbreak on platform without GeckoProfiler after bug 1509571. r=mconley --- browser/components/sessionstore/StartupPerformance.jsm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/browser/components/sessionstore/StartupPerformance.jsm b/browser/components/sessionstore/StartupPerformance.jsm index 54230065459b..7834ce188e92 100644 --- a/browser/components/sessionstore/StartupPerformance.jsm +++ b/browser/components/sessionstore/StartupPerformance.jsm @@ -76,7 +76,9 @@ var StartupPerformance = { // Record the start timestamp, setup the timer and `this._promiseFinished`. // Behavior is unspecified if there was already an ongoing measure. _onRestorationStarts(isAutoRestore) { - Services.profiler.AddMarker("_onRestorationStarts"); + if (Services.profiler) { + Services.profiler.AddMarker("_onRestorationStarts"); + } this._latestRestoredTimeStamp = this._startTimeStamp = Date.now(); this._totalNumberOfEagerTabs = 0; this._totalNumberOfTabs = 0; @@ -199,7 +201,9 @@ var StartupPerformance = { // to the user switching to a lazily restored tab, or for tabs // that are restoring eagerly. if (!event.detail.isRemotenessUpdate) { - Services.profiler.AddMarker("SSTabRestored"); + if (Services.profiler) { + Services.profiler.AddMarker("SSTabRestored"); + } this._latestRestoredTimeStamp = Date.now(); this._totalNumberOfEagerTabs += 1; } From 2f00a97c85483ff7e0d174f3e82f2ce339778bb5 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 29 Nov 2018 10:37:54 -0500 Subject: [PATCH 02/10] Bug 1510911 - Part 1: Backout changeset cdb8932d1d8d (bug 1493563 - Part 11) for regressing performance --- ...RequestNotificationForTrackingResources.js | 2 +- .../test/browser/browser_subResources.js | 2 +- .../antitracking/test/browser/head.js | 236 ++---------------- 3 files changed, 17 insertions(+), 223 deletions(-) diff --git a/toolkit/components/antitracking/test/browser/browser_onModifyRequestNotificationForTrackingResources.js b/toolkit/components/antitracking/test/browser/browser_onModifyRequestNotificationForTrackingResources.js index 1f684ce81644..825b53e175be 100644 --- a/toolkit/components/antitracking/test/browser/browser_onModifyRequestNotificationForTrackingResources.js +++ b/toolkit/components/antitracking/test/browser/browser_onModifyRequestNotificationForTrackingResources.js @@ -17,7 +17,7 @@ async function onModifyRequest() { let httpChannel = subject.QueryInterface(Ci.nsIHttpChannel); let spec = httpChannel.URI.spec; info("Observed channel for " + spec); - if (httpChannel.URI.prePath != TEST_3RD_PARTY_DOMAIN_TP) { + if (httpChannel.URI.prePath + "/" != TEST_3RD_PARTY_DOMAIN_TP) { return; } if (spec.endsWith("empty.js")) { diff --git a/toolkit/components/antitracking/test/browser/browser_subResources.js b/toolkit/components/antitracking/test/browser/browser_subResources.js index 6c19a1c5dfee..bfe68964494c 100644 --- a/toolkit/components/antitracking/test/browser/browser_subResources.js +++ b/toolkit/components/antitracking/test/browser/browser_subResources.js @@ -185,7 +185,7 @@ add_task(async function() { let log = JSON.parse(await browser.getContentBlockingLog()); for (let trackerOrigin in log) { - is(trackerOrigin, TEST_3RD_PARTY_DOMAIN, "Correct tracker origin must be reported"); + is(trackerOrigin + "/", TEST_3RD_PARTY_DOMAIN, "Correct tracker origin must be reported"); let originLog = log[trackerOrigin]; is(originLog.length, 4, "We should have 4 entries in the compressed log"); expectTrackerFound(originLog[0]); diff --git a/toolkit/components/antitracking/test/browser/head.js b/toolkit/components/antitracking/test/browser/head.js index 7cd73c09f87a..c29f4426d852 100644 --- a/toolkit/components/antitracking/test/browser/head.js +++ b/toolkit/components/antitracking/test/browser/head.js @@ -1,15 +1,15 @@ -const TEST_DOMAIN = "http://example.net"; -const TEST_DOMAIN_2 = "http://xn--exmple-cua.test"; -const TEST_DOMAIN_3 = "https://xn--hxajbheg2az3al.xn--jxalpdlp"; -const TEST_DOMAIN_4 = "http://prefixexample.com"; -const TEST_DOMAIN_5 = "http://test"; -const TEST_DOMAIN_6 = "http://mochi.test:8888"; -const TEST_3RD_PARTY_DOMAIN = "https://tracking.example.org"; -const TEST_3RD_PARTY_DOMAIN_TP = "https://tracking.example.com"; -const TEST_4TH_PARTY_DOMAIN = "http://not-tracking.example.com"; -const TEST_ANOTHER_3RD_PARTY_DOMAIN = "https://another-tracking.example.net"; +const TEST_DOMAIN = "http://example.net/"; +const TEST_DOMAIN_2 = "http://xn--exmple-cua.test/"; +const TEST_DOMAIN_3 = "https://xn--hxajbheg2az3al.xn--jxalpdlp/"; +const TEST_DOMAIN_4 = "http://prefixexample.com/"; +const TEST_DOMAIN_5 = "http://test/"; +const TEST_DOMAIN_6 = "http://mochi.test:8888/"; +const TEST_3RD_PARTY_DOMAIN = "https://tracking.example.org/"; +const TEST_3RD_PARTY_DOMAIN_TP = "https://tracking.example.com/"; +const TEST_4TH_PARTY_DOMAIN = "http://not-tracking.example.com/"; +const TEST_ANOTHER_3RD_PARTY_DOMAIN = "https://another-tracking.example.net/"; -const TEST_PATH = "/browser/toolkit/components/antitracking/test/browser/"; +const TEST_PATH = "browser/toolkit/components/antitracking/test/browser/"; const TEST_TOP_PAGE = TEST_DOMAIN + TEST_PATH + "page.html"; const TEST_TOP_PAGE_2 = TEST_DOMAIN_2 + TEST_PATH + "page.html"; @@ -35,7 +35,7 @@ var gFeatures = undefined; let {UrlClassifierTestUtils} = ChromeUtils.import("resource://testing-common/UrlClassifierTestUtils.jsm", {}); -requestLongerTimeout(5); +requestLongerTimeout(3); this.AntiTracking = { runTest(name, callbackTracking, callbackNonTracking, cleanupFunction, extraPrefs, @@ -230,8 +230,7 @@ this.AntiTracking = { // get blocked with user interaction present if (userInteractionTest) { this._createUserInteractionTask(name, callbackTracking, callbackNonTracking, - runInPrivateWindow, iframeSandbox, - expectedBlockingNotifications, extraPrefs); + runInPrivateWindow, iframeSandbox, extraPrefs); this._createCleanupTask(cleanupFunction); } } @@ -300,94 +299,10 @@ this.AntiTracking = { let cookieBlocked = 0; let listener = { - onSecurityChange(webProgress, request, oldState, state, - contentBlockingLogJSON) { + onSecurityChange(webProgress, request, state) { if ((state & options.expectedBlockingNotifications)) { ++cookieBlocked; } - let contentBlockingLog = {}; - try { - contentBlockingLog = JSON.parse(contentBlockingLogJSON); - } catch (e) { - } - - let trackerInteractionHelper = false; - if (request) { - request.QueryInterface(Ci.nsIChannel); - trackerInteractionHelper = request.URI.spec.endsWith("?messageme"); - } - - // If this is the first cookie to be blocked, our state should have - // just changed, otherwise it should have previously contained one of - // the blocking flag too. - if (options.expectedBlockingNotifications && cookieBlocked && - !options.allowList && !trackerInteractionHelper) { - if (cookieBlocked == 1) { - is(oldState & options.expectedBlockingNotifications, 0, - "When blocking the first cookie, old state should not have had " + - "one of the blocking flag bit"); - } - - for (let trackerOrigin in contentBlockingLog) { - is(trackerOrigin, TEST_3RD_PARTY_DOMAIN, "Correct tracker origin must be reported"); - let originLog = contentBlockingLog[trackerOrigin]; - if (options.expectedBlockingNotifications != Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_BY_PERMISSION) - ok(originLog.length > 1, "We should have at least two items in the log"); - for (let i = 0; i < originLog.length; ++i) { - let item = originLog[i]; - switch (item[0]) { - case Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT: - is(item[1], true, "Correct blocking status reported"); - is(item[2], 1, "Correct repeat count reported"); - break; - case Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT: - if (item[1]) { - ok(item[2] >= 1, "Correct repeat count reported"); - } else { - // This branch is needed here because of the tests that use the storage - // access API to gain storage access. - is(item[2], 1, "Correct repeat count reported"); - } - break; - case Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER: - if (item[1]) { - ok(item[2] >= 1, "Correct repeat count reported"); - } else { - // This branch is needed here because of the tests that use the storage - // access API to gain storage access. - is(item[2], 1, "Correct repeat count reported"); - } - break; - } - } - } - // Can't assert the number of tracker origins because we may get 0 - // for web progress navigations coming from the window opening from - // storage access API tracker interaction attempts... - } - if (!options.expectedBlockingNotifications) { - is(oldState & Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER, 0, - "When not blocking, old state should not have had the " + - "STATE_COOKIES_BLOCKED_TRACKER bit"); - // Ensure that if there is something in the content blocking log, it's only - // STATE_LOADED_TRACKING_CONTENT notifications. - for (let trackerOrigin in contentBlockingLog) { - let originLog = contentBlockingLog[trackerOrigin]; - for (let i = 0; i < originLog.length; ++i) { - let item = originLog[i]; - switch (item[0]) { - case Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT: - is(item[1], true, "Correct blocking status reported"); - ok(item[2] >= 1, "Correct repeat count reported"); - break; - case Ci.nsIWebProgressListener.STATE_COOKIES_LOADED: - is(item[1], true, "Correct blocking status reported"); - ok(item[2] >= 1, "Correct repeat count reported"); - break; - } - } - } - } }, }; win.gBrowser.addProgressListener(listener); @@ -552,58 +467,6 @@ this.AntiTracking = { await AntiTracking._setupTest(win, BEHAVIOR_REJECT_TRACKER, true, true, extraPrefs); - let cookieBlocked = 0; - let listener = { - onSecurityChange(webProgress, request, oldState, state, - contentBlockingLogJSON) { - if (state & Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER) { - ++cookieBlocked; - } - let contentBlockingLog = {}; - try { - contentBlockingLog = JSON.parse(contentBlockingLogJSON); - } catch (e) { - } - if (cookieBlocked) { - for (let trackerOrigin in contentBlockingLog) { - is(trackerOrigin, TEST_3RD_PARTY_DOMAIN, "Correct tracker origin must be reported"); - let originLog = contentBlockingLog[trackerOrigin]; - ok(originLog.length >= 1, "We should have at least two items in the log"); - for (let i = 0; i < originLog.length; ++i) { - let item = originLog[i]; - switch (item[0]) { - case Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT: - is(item[1], true, "Correct blocking status reported"); - ok(item[2] >= 1, "Correct repeat count reported"); - break; - case Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT: - if (item[1]) { - ok(item[2] >= 1, "Correct repeat count reported"); - } else { - is(item[2], 1, "Correct repeat count reported"); - } - break; - case Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER: - if (item[1]) { - ok(item[2] >= 1, "Correct repeat count reported"); - } else { - is(item[2], 1, "Correct repeat count reported"); - } - break; - case Ci.nsIWebProgressListener.STATE_COOKIES_LOADED: - is(item[1], true, "Correct blocking status reported"); - ok(item[2] >= 1, "Correct repeat count reported"); - break; - } - } - } - // Can't assert the number of tracker origins because we may get 0 - // for web progress navigations coming from the window opening... - } - }, - }; - win.gBrowser.addProgressListener(listener); - info("Creating a new tab"); let tab = BrowserTestUtils.addTab(win.gBrowser, TEST_TOP_PAGE); win.gBrowser.selectedTab = tab; @@ -659,8 +522,6 @@ this.AntiTracking = { }); }); - win.gBrowser.removeProgressListener(listener); - info("Removing the tab"); BrowserTestUtils.removeTab(tab); @@ -671,8 +532,7 @@ this.AntiTracking = { }, _createUserInteractionTask(name, blockingCallback, nonBlockingCallback, - runInPrivateWindow, iframeSandbox, - expectedBlockingNotifications, extraPrefs) { + runInPrivateWindow, iframeSandbox, extraPrefs) { add_task(async function() { info("Starting user-interaction test " + name); @@ -684,70 +544,6 @@ this.AntiTracking = { await AntiTracking._setupTest(win, BEHAVIOR_REJECT_TRACKER, true, true, extraPrefs); - let cookieBlocked = 0; - let listener = { - onSecurityChange(webProgress, request, oldState, state, - contentBlockingLogJSON) { - if (state & expectedBlockingNotifications) { - ++cookieBlocked; - } - let contentBlockingLog = {}; - try { - contentBlockingLog = JSON.parse(contentBlockingLogJSON); - } catch (e) { - } - // If this is the first cookie to be blocked, our state should have - // just changed, otherwise it should have previously contained one of - // the blocking flag bit too. - if (expectedBlockingNotifications && cookieBlocked) { - if (cookieBlocked == 1) { - is(oldState & expectedBlockingNotifications, 0, - "When blocking the first cookie, old state should not have had " + - "one of the blocking flag bit"); - } - - for (let trackerOrigin in contentBlockingLog) { - let originLog = contentBlockingLog[trackerOrigin]; - ok(originLog.length >= 1, "We should have at least two items in the log"); - for (let i = 0; i < originLog.length; ++i) { - let item = originLog[i]; - switch (item[0]) { - case Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT: - is(trackerOrigin, TEST_3RD_PARTY_DOMAIN, "Correct tracker origin must be reported"); - is(item[1], true, "Correct blocking status reported"); - ok(item[2] >= 1, "Correct repeat count reported"); - break; - case Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT: - is(trackerOrigin, TEST_3RD_PARTY_DOMAIN, "Correct tracker origin must be reported"); - if (item[1]) { - ok(item[2] >= 1, "Correct repeat count reported"); - } else { - // This branch is needed here because of the tests that use the storage - // access API to gain storage access. - is(item[2], 1, "Correct repeat count reported"); - } - break; - case Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER: - is(trackerOrigin, TEST_3RD_PARTY_DOMAIN, "Correct tracker origin must be reported"); - // We can expect 1 or more repeat count whether or not blocking has happened, - // so nothing to assert on item[1]. - ok(item[2] >= 1, "Correct repeat count reported"); - break; - case Ci.nsIWebProgressListener.STATE_COOKIES_LOADED: - // The trackerOrigin here is sometimes TEST_DOMAIN, sometimes TEST_3RD_PARTY_DOMAIN. - is(item[1], true, "Correct blocking status reported"); - ok(item[2] >= 1, "Correct repeat count reported"); - break; - } - } - } - // Can't assert the number of tracker origins because we may get 0 - // for web progress navigations coming from the window opening... - } - }, - }; - win.gBrowser.addProgressListener(listener); - info("Creating a new tab"); let tab = BrowserTestUtils.addTab(win.gBrowser, TEST_TOP_PAGE); win.gBrowser.selectedTab = tab; @@ -895,8 +691,6 @@ this.AntiTracking = { }); }); - win.gBrowser.removeProgressListener(listener); - info("Removing the tab"); BrowserTestUtils.removeTab(tab); From 0dcf936804a272b11958aa2d9a4b33f1fd5224eb Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 29 Nov 2018 10:46:08 -0500 Subject: [PATCH 03/10] Bug 1510911 - Part 2: Backout changeset f8849239da42 (bug 1493563 - Part 5) for regressing performance --- accessible/base/DocManager.cpp | 3 +- .../base/content/browser-contentblocking.js | 3 +- browser/base/content/browser.js | 6 +-- browser/base/content/tabbrowser.js | 19 ++-------- .../test/general/browser_alltabslistener.js | 6 +-- .../components/extensions/parent/ext-tabs.js | 3 +- .../components/shell/nsMacShellService.cpp | 4 +- docshell/base/nsDocShell.cpp | 3 +- docshell/base/nsDocShellTreeOwner.cpp | 5 +-- .../BrowserElementChildPreload.js | 3 +- dom/clients/manager/ClientNavigateOpChild.cpp | 3 +- dom/clients/manager/ClientOpenWindowUtils.cpp | 3 +- dom/html/HTMLFormElement.cpp | 4 +- dom/html/nsHTMLDNSPrefetch.cpp | 6 +-- dom/presentation/PresentationCallbacks.cpp | 3 +- editor/composer/nsEditingSession.cpp | 4 +- editor/composer/test/test_bug434998.xul | 3 +- editor/libeditor/tests/test_bug607584.xul | 3 +- editor/libeditor/tests/test_bug616590.xul | 3 +- editor/libeditor/tests/test_bug780908.xul | 3 +- .../chrome/printpreview_bug396024_helper.xul | 3 +- .../chrome/printpreview_bug482976_helper.xul | 3 +- .../base/tests/chrome/printpreview_helper.xul | 3 +- layout/printing/ipc/RemotePrintJobChild.cpp | 5 +-- layout/printing/nsPrintJob.cpp | 3 +- .../layout-debug/ui/content/layoutdebug.js | 3 +- mobile/android/chrome/content/browser.js | 3 +- .../modules/geckoview/GeckoViewProgress.jsm | 3 +- .../geckoview/GeckoViewTrackingProtection.jsm | 3 +- netwerk/base/nsISecureBrowserUI.idl | 25 ------------ .../manager/ssl/nsSecureBrowserUIImpl.cpp | 38 +------------------ toolkit/actors/PrintingChild.jsm | 3 +- toolkit/components/browser/nsWebBrowser.cpp | 7 +--- .../printing/content/printPreviewProgress.js | 3 +- .../printing/content/printProgress.js | 3 +- .../ipc/PrintProgressDialogChild.cpp | 6 +-- .../components/printingui/nsPrintProgress.cpp | 6 +-- .../printingui/nsPrintingPromptService.cpp | 10 ++--- .../statusfilter/nsBrowserStatusFilter.cpp | 8 ++-- .../mochitest/test_threathit_report.html | 3 +- toolkit/modules/RemoteSecurityUI.jsm | 8 +--- toolkit/modules/RemoteWebProgress.jsm | 14 +++---- toolkit/modules/WebProgressChild.jsm | 5 +-- toolkit/mozapps/downloads/nsHelperAppDlg.js | 3 +- .../mozapps/extensions/content/extensions.js | 3 +- uriloader/base/nsDocLoader.cpp | 5 +-- uriloader/base/nsIWebProgressListener.idl | 21 +--------- .../prefetch/nsOfflineCacheUpdateService.cpp | 6 +-- uriloader/prefetch/nsPrefetchService.cpp | 4 +- xpfe/appshell/nsChromeTreeOwner.cpp | 4 +- xpfe/appshell/nsWebShellWindow.cpp | 4 +- 51 files changed, 77 insertions(+), 231 deletions(-) diff --git a/accessible/base/DocManager.cpp b/accessible/base/DocManager.cpp index 33f30a227ad9..067bffce32e3 100644 --- a/accessible/base/DocManager.cpp +++ b/accessible/base/DocManager.cpp @@ -303,8 +303,7 @@ DocManager::OnStatusChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest, NS_IMETHODIMP DocManager::OnSecurityChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest, - uint32_t aOldState, uint32_t aState, - const nsAString& aContentBlockingLogJSON) { + uint32_t aState) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } diff --git a/browser/base/content/browser-contentblocking.js b/browser/base/content/browser-contentblocking.js index de0445c6b136..5f6a4df61704 100644 --- a/browser/base/content/browser-contentblocking.js +++ b/browser/base/content/browser-contentblocking.js @@ -717,8 +717,7 @@ var ContentBlocking = { Services.telemetry.getHistogramById("TRACKING_PROTECTION_SHIELD").add(value); }, - onSecurityChange(oldState, state, webProgress, isSimulated, - contentBlockingLogJSON) { + onSecurityChange(state, webProgress, isSimulated) { let baseURI = this._baseURIForChannelClassifier; // Don't deal with about:, file: etc. diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 30f9406c3e18..b921510a6303 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -4927,8 +4927,7 @@ var XULBrowserWindow = { // 3. Called directly during this object's initializations. // aRequest will be null always in case 2 and 3, and sometimes in case 1 (for // instance, there won't be a request when STATE_BLOCKED_TRACKING_CONTENT is observed). - onSecurityChange(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON, aIsSimulated) { + onSecurityChange(aWebProgress, aRequest, aState, aIsSimulated) { // Don't need to do anything if the data we use to update the UI hasn't // changed let uri = gBrowser.currentURI; @@ -4955,8 +4954,7 @@ var XULBrowserWindow = { uri = Services.uriFixup.createExposableURI(uri); } catch (e) {} gIdentityHandler.updateIdentity(this._state, uri); - ContentBlocking.onSecurityChange(aOldState, this._state, aWebProgress, aIsSimulated, - aContentBlockingLogJSON); + ContentBlocking.onSecurityChange(this._state, aWebProgress, aIsSimulated); }, // simulate all change notifications after switching tabs diff --git a/browser/base/content/tabbrowser.js b/browser/base/content/tabbrowser.js index b3eabf84bd0b..df4e7da6854a 100644 --- a/browser/base/content/tabbrowser.js +++ b/browser/base/content/tabbrowser.js @@ -962,13 +962,8 @@ window._gBrowser = { if (securityUI) { // Include the true final argument to indicate that this event is // simulated (instead of being observed by the webProgressListener). - // Note: check state first to make sure the security UI object updates its - // state from the docshell correctly. - let state = securityUI.state; - let oldState = securityUI.oldState; this._callProgressListeners(null, "onSecurityChange", - [webProgress, null, oldState, state, - securityUI.contentBlockingLogJSON, true], + [webProgress, null, securityUI.state, true], true, false); } @@ -1713,17 +1708,12 @@ window._gBrowser = { // Restore the securityUI state. let securityUI = aBrowser.securityUI; - // Make sure to call the state getter before the oldState getter to give - // the securityUI object a chance to sync its state with the docshell let state = securityUI ? securityUI.state : Ci.nsIWebProgressListener.STATE_IS_INSECURE; - let oldState = securityUI ? securityUI.oldState : - Ci.nsIWebProgressListener.STATE_IS_INSECURE; // Include the true final argument to indicate that this event is // simulated (instead of being observed by the webProgressListener). this._callProgressListeners(aBrowser, "onSecurityChange", - [aBrowser.webProgress, null, oldState, state, - securityUI.contentBlockingLogJSON, true], + [aBrowser.webProgress, null, state, true], true, false); if (aShouldBeRemote) { @@ -5206,10 +5196,9 @@ class TabProgressListener { this.mMessage = aMessage; } - onSecurityChange(aWebProgress, aRequest, aOldState, aState, aContentBlockingLogJSON) { + onSecurityChange(aWebProgress, aRequest, aState) { this._callProgressListeners("onSecurityChange", - [aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON]); + [aWebProgress, aRequest, aState]); } onRefreshAttempted(aWebProgress, aURI, aDelay, aSameURI) { diff --git a/browser/base/content/test/general/browser_alltabslistener.js b/browser/base/content/test/general/browser_alltabslistener.js index 515147cb75fe..f4f4c584fecf 100644 --- a/browser/base/content/test/general/browser_alltabslistener.js +++ b/browser/base/content/test/general/browser_alltabslistener.js @@ -36,8 +36,7 @@ var gFrontProgressListener = { onStatusChange(aWebProgress, aRequest, aStatus, aMessage) { }, - onSecurityChange(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) { + onSecurityChange(aWebProgress, aRequest, aState) { if (aRequest && aRequest.QueryInterface(Ci.nsIChannel).originalURI.spec == "about:blank") { // ignore initial about blank @@ -96,8 +95,7 @@ var gAllProgressListener = { ok(aBrowser == gTestBrowser, state + " notification came from the correct browser"); }, - onSecurityChange(aBrowser, aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) { + onSecurityChange(aBrowser, aWebProgress, aRequest, aState) { if (aRequest && aRequest.QueryInterface(Ci.nsIChannel).originalURI.spec == "about:blank") { // ignore initial about blank diff --git a/browser/components/extensions/parent/ext-tabs.js b/browser/components/extensions/parent/ext-tabs.js index 4ef7113208ad..f25d7922b7e2 100644 --- a/browser/components/extensions/parent/ext-tabs.js +++ b/browser/components/extensions/parent/ext-tabs.js @@ -1221,8 +1221,7 @@ this.tabs = class extends ExtensionAPI { let printProgressListener = { onLocationChange(webProgress, request, location, flags) { }, onProgressChange(webProgress, request, curSelfProgress, maxSelfProgress, curTotalProgress, maxTotalProgress) { }, - onSecurityChange(webProgress, request, oldState, state, - contentBlockingLogJSON) { }, + onSecurityChange(webProgress, request, state) { }, onStateChange(webProgress, request, flags, status) { if ((flags & Ci.nsIWebProgressListener.STATE_STOP) && (flags & Ci.nsIWebProgressListener.STATE_IS_DOCUMENT)) { resolve(retval == 0 ? "saved" : "replaced"); diff --git a/browser/components/shell/nsMacShellService.cpp b/browser/components/shell/nsMacShellService.cpp index 5f7a1a2c1469..e7891e5f34a2 100644 --- a/browser/components/shell/nsMacShellService.cpp +++ b/browser/components/shell/nsMacShellService.cpp @@ -184,9 +184,7 @@ nsMacShellService::OnStatusChange(nsIWebProgress* aWebProgress, NS_IMETHODIMP nsMacShellService::OnSecurityChange(nsIWebProgress* aWebProgress, - nsIRequest* aRequest, uint32_t aOldState, - uint32_t aState, - const nsAString& aContentBlockingLogJSON) { + nsIRequest* aRequest, uint32_t aState) { return NS_OK; } diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 8e335534a57e..c6b93dde7355 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -6630,8 +6630,7 @@ nsDocShell::OnStatusChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest, NS_IMETHODIMP nsDocShell::OnSecurityChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest, - uint32_t aOldState, uint32_t aState, - const nsAString& aContentBlockingLogJSON) { + uint32_t aState) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } diff --git a/docshell/base/nsDocShellTreeOwner.cpp b/docshell/base/nsDocShellTreeOwner.cpp index 866879c760e4..fa60b36d3487 100644 --- a/docshell/base/nsDocShellTreeOwner.cpp +++ b/docshell/base/nsDocShellTreeOwner.cpp @@ -694,9 +694,8 @@ nsDocShellTreeOwner::OnStatusChange(nsIWebProgress* aWebProgress, } NS_IMETHODIMP -nsDocShellTreeOwner::OnSecurityChange( - nsIWebProgress* aWebProgress, nsIRequest* aRequest, uint32_t aOldState, - uint32_t aState, const nsAString& aContentBlockingLogJSON) { +nsDocShellTreeOwner::OnSecurityChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t aState) { return NS_OK; } diff --git a/dom/browser-element/BrowserElementChildPreload.js b/dom/browser-element/BrowserElementChildPreload.js index 351ef5ca93c6..2b7d513e6c7e 100644 --- a/dom/browser-element/BrowserElementChildPreload.js +++ b/dom/browser-element/BrowserElementChildPreload.js @@ -1181,8 +1181,7 @@ BrowserElementChild.prototype = { } }, - onSecurityChange: function(webProgress, request, oldState, state, - contentBlockingLogJSON) { + onSecurityChange: function(webProgress, request, state) { if (webProgress != docShell) { return; } diff --git a/dom/clients/manager/ClientNavigateOpChild.cpp b/dom/clients/manager/ClientNavigateOpChild.cpp index 49fd919dd4e2..5be4c0e5e5de 100644 --- a/dom/clients/manager/ClientNavigateOpChild.cpp +++ b/dom/clients/manager/ClientNavigateOpChild.cpp @@ -121,8 +121,7 @@ class NavigateLoadListener final : public nsIWebProgressListener, NS_IMETHOD OnSecurityChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest, - uint32_t aOldState, uint32_t aState, - const nsAString& aContentBlockingLogJSON) override { + uint32_t aState) override { MOZ_CRASH("Unexpected notification."); return NS_OK; } diff --git a/dom/clients/manager/ClientOpenWindowUtils.cpp b/dom/clients/manager/ClientOpenWindowUtils.cpp index a3253df75e7f..d44150ad1588 100644 --- a/dom/clients/manager/ClientOpenWindowUtils.cpp +++ b/dom/clients/manager/ClientOpenWindowUtils.cpp @@ -117,8 +117,7 @@ class WebProgressListener final : public nsIWebProgressListener, NS_IMETHOD OnSecurityChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest, - uint32_t aOldState, uint32_t aState, - const nsAString& aContentBlockingLogJSON) override { + uint32_t aState) override { MOZ_ASSERT(false, "Unexpected notification."); return NS_OK; } diff --git a/dom/html/HTMLFormElement.cpp b/dom/html/HTMLFormElement.cpp index 73860d52061c..21df3b6851f0 100644 --- a/dom/html/HTMLFormElement.cpp +++ b/dom/html/HTMLFormElement.cpp @@ -1995,9 +1995,7 @@ HTMLFormElement::OnStatusChange(nsIWebProgress* aWebProgress, NS_IMETHODIMP HTMLFormElement::OnSecurityChange(nsIWebProgress* aWebProgress, - nsIRequest* aRequest, uint32_t aOldState, - uint32_t aState, - const nsAString& aContentBlockingLogJSON) { + nsIRequest* aRequest, uint32_t state) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } diff --git a/dom/html/nsHTMLDNSPrefetch.cpp b/dom/html/nsHTMLDNSPrefetch.cpp index 79ec3dc96495..97a6837c5006 100644 --- a/dom/html/nsHTMLDNSPrefetch.cpp +++ b/dom/html/nsHTMLDNSPrefetch.cpp @@ -504,9 +504,9 @@ nsHTMLDNSPrefetch::nsDeferrals::OnStatusChange(nsIWebProgress *aWebProgress, } NS_IMETHODIMP -nsHTMLDNSPrefetch::nsDeferrals::OnSecurityChange( - nsIWebProgress *aWebProgress, nsIRequest *aRequest, uint32_t aOldState, - uint32_t aState, const nsAString &aContentBlockingLogJSON) { +nsHTMLDNSPrefetch::nsDeferrals::OnSecurityChange(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, + uint32_t state) { return NS_OK; } diff --git a/dom/presentation/PresentationCallbacks.cpp b/dom/presentation/PresentationCallbacks.cpp index 5e2023afa659..f8a184c7f047 100644 --- a/dom/presentation/PresentationCallbacks.cpp +++ b/dom/presentation/PresentationCallbacks.cpp @@ -235,8 +235,7 @@ PresentationResponderLoadingCallback::OnStatusChange( NS_IMETHODIMP PresentationResponderLoadingCallback::OnSecurityChange( - nsIWebProgress* aWebProgress, nsIRequest* aRequest, uint32_t aOldState, - uint32_t aState, const nsAString& aContentBlockingLogJSON) { + nsIWebProgress* aWebProgress, nsIRequest* aRequest, uint32_t state) { // Do nothing. return NS_OK; } diff --git a/editor/composer/nsEditingSession.cpp b/editor/composer/nsEditingSession.cpp index d8b701f80768..430c7b323c63 100644 --- a/editor/composer/nsEditingSession.cpp +++ b/editor/composer/nsEditingSession.cpp @@ -787,9 +787,7 @@ nsEditingSession::OnStatusChange(nsIWebProgress* aWebProgress, ----------------------------------------------------------------------------*/ NS_IMETHODIMP nsEditingSession::OnSecurityChange(nsIWebProgress* aWebProgress, - nsIRequest* aRequest, uint32_t aOldState, - uint32_t aState, - const nsAString& aContentBlockingLogJSON) { + nsIRequest* aRequest, uint32_t state) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } diff --git a/editor/composer/test/test_bug434998.xul b/editor/composer/test/test_bug434998.xul index ebf9126500e8..1f3fab7514a7 100644 --- a/editor/composer/test/test_bug434998.xul +++ b/editor/composer/test/test_bug434998.xul @@ -87,8 +87,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=434998 { }, - onSecurityChange : function(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) + onSecurityChange : function(aWebProgress, aRequest, aState) { }, diff --git a/editor/libeditor/tests/test_bug607584.xul b/editor/libeditor/tests/test_bug607584.xul index 5ff23a413a47..16d815965f7f 100644 --- a/editor/libeditor/tests/test_bug607584.xul +++ b/editor/libeditor/tests/test_bug607584.xul @@ -93,8 +93,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=607584 { }, - onSecurityChange : function(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) + onSecurityChange : function(aWebProgress, aRequest, aState) { }, diff --git a/editor/libeditor/tests/test_bug616590.xul b/editor/libeditor/tests/test_bug616590.xul index 169b6eef4a7c..dfc94b1a8f9e 100644 --- a/editor/libeditor/tests/test_bug616590.xul +++ b/editor/libeditor/tests/test_bug616590.xul @@ -82,8 +82,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616590 { }, - onSecurityChange : function(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) + onSecurityChange : function(aWebProgress, aRequest, aState) { }, diff --git a/editor/libeditor/tests/test_bug780908.xul b/editor/libeditor/tests/test_bug780908.xul index 8b626cbdd33d..1e0939d041fd 100644 --- a/editor/libeditor/tests/test_bug780908.xul +++ b/editor/libeditor/tests/test_bug780908.xul @@ -91,8 +91,7 @@ adapted from test_bug607584.xul by Kent James { }, - onSecurityChange : function(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) + onSecurityChange : function(aWebProgress, aRequest, aState) { }, diff --git a/layout/base/tests/chrome/printpreview_bug396024_helper.xul b/layout/base/tests/chrome/printpreview_bug396024_helper.xul index 2f20470ee6d9..ae11bc2fd0d4 100644 --- a/layout/base/tests/chrome/printpreview_bug396024_helper.xul +++ b/layout/base/tests/chrome/printpreview_bug396024_helper.xul @@ -23,8 +23,7 @@ function printpreview() { onProgressChange: function(webProgress, request, curSelfProgress, maxSelfProgress, curTotalProgress, maxTotalProgress) { }, - onSecurityChange: function(webProgress, request, oldState, state, - contentBlockingLogJSON) { }, + onSecurityChange: function(webProgress, request, state) { }, onStateChange: function(webProgress, request, stateFlags, status) { }, onStatusChange: function(webProgress, request, status, message) { }, QueryInterface: function(iid) { diff --git a/layout/base/tests/chrome/printpreview_bug482976_helper.xul b/layout/base/tests/chrome/printpreview_bug482976_helper.xul index cc35e2e77c9d..114b37bf1747 100644 --- a/layout/base/tests/chrome/printpreview_bug482976_helper.xul +++ b/layout/base/tests/chrome/printpreview_bug482976_helper.xul @@ -23,8 +23,7 @@ function printpreview() { onProgressChange: function(webProgress, request, curSelfProgress, maxSelfProgress, curTotalProgress, maxTotalProgress) { }, - onSecurityChange: function(webProgress, request, oldState, state, - contentBlockingLogJSON) { }, + onSecurityChange: function(webProgress, request, state) { }, onStateChange: function(webProgress, request, stateFlags, status) { }, onStatusChange: function(webProgress, request, status, message) { }, QueryInterface: function(iid) { diff --git a/layout/base/tests/chrome/printpreview_helper.xul b/layout/base/tests/chrome/printpreview_helper.xul index c3a9ade0083f..aac0ed817b28 100644 --- a/layout/base/tests/chrome/printpreview_helper.xul +++ b/layout/base/tests/chrome/printpreview_helper.xul @@ -30,8 +30,7 @@ function printpreview() { onProgressChange: function(webProgress, request, curSelfProgress, maxSelfProgress, curTotalProgress, maxTotalProgress) { }, - onSecurityChange: function(webProgress, request, oldState, state, - contentBlockingLogJSON) { }, + onSecurityChange: function(webProgress, request, state) { }, onStateChange: function(webProgress, request, stateFlags, status) { }, onStatusChange: function(webProgress, request, status, message) { }, QueryInterface: function(iid) { diff --git a/layout/printing/ipc/RemotePrintJobChild.cpp b/layout/printing/ipc/RemotePrintJobChild.cpp index a526dd2750ac..12a9e87d2f2e 100644 --- a/layout/printing/ipc/RemotePrintJobChild.cpp +++ b/layout/printing/ipc/RemotePrintJobChild.cpp @@ -139,9 +139,8 @@ RemotePrintJobChild::OnStatusChange(nsIWebProgress* aProgress, } NS_IMETHODIMP -RemotePrintJobChild::OnSecurityChange( - nsIWebProgress* aProgress, nsIRequest* aRequest, uint32_t aState, - uint32_t aOldState, const nsAString& aContentBlockingLogJSON) { +RemotePrintJobChild::OnSecurityChange(nsIWebProgress* aProgress, + nsIRequest* aRequest, uint32_t aState) { return NS_OK; } diff --git a/layout/printing/nsPrintJob.cpp b/layout/printing/nsPrintJob.cpp index 7cd665a12476..fda780a623b9 100644 --- a/layout/printing/nsPrintJob.cpp +++ b/layout/printing/nsPrintJob.cpp @@ -2018,8 +2018,7 @@ nsPrintJob::OnStatusChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest, NS_IMETHODIMP nsPrintJob::OnSecurityChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest, - uint32_t aState, uint32_t aOldState, - const nsAString& aContentBlockingLogJSON) { + uint32_t aState) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } diff --git a/layout/tools/layout-debug/ui/content/layoutdebug.js b/layout/tools/layout-debug/ui/content/layoutdebug.js index 3baaaa3c0441..e6e2130aa19b 100644 --- a/layout/tools/layout-debug/ui/content/layoutdebug.js +++ b/layout/tools/layout-debug/ui/content/layoutdebug.js @@ -77,8 +77,7 @@ nsLDBBrowserContentListener.prototype = { this.mStatusText.value = aMessage; }, - onSecurityChange : function(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) + onSecurityChange : function(aWebProgress, aRequest, aState) { }, diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 573e633613b5..6bf591d9b20b 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -4725,8 +4725,7 @@ Tab.prototype = { _state: null, _hostChanged: false, // onLocationChange will flip this bit - onSecurityChange: function(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) { + onSecurityChange: function(aWebProgress, aRequest, aState) { // Don't need to do anything if the data we use to update the UI hasn't changed if (this._state == aState && !this._hostChanged) return; diff --git a/mobile/android/modules/geckoview/GeckoViewProgress.jsm b/mobile/android/modules/geckoview/GeckoViewProgress.jsm index 372b5f865e59..b55fc84cba0b 100644 --- a/mobile/android/modules/geckoview/GeckoViewProgress.jsm +++ b/mobile/android/modules/geckoview/GeckoViewProgress.jsm @@ -253,8 +253,7 @@ class GeckoViewProgress extends GeckoViewModule { } } - onSecurityChange(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) { + onSecurityChange(aWebProgress, aRequest, aState) { debug `onSecurityChange`; // Don't need to do anything if the data we use to update the UI hasn't changed diff --git a/mobile/android/modules/geckoview/GeckoViewTrackingProtection.jsm b/mobile/android/modules/geckoview/GeckoViewTrackingProtection.jsm index 44af25c4542c..7d00ecaef1b4 100644 --- a/mobile/android/modules/geckoview/GeckoViewTrackingProtection.jsm +++ b/mobile/android/modules/geckoview/GeckoViewTrackingProtection.jsm @@ -20,8 +20,7 @@ class GeckoViewTrackingProtection extends GeckoViewModule { this.browser.addProgressListener(this.progressFilter, flags); } - onSecurityChange(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) { + onSecurityChange(aWebProgress, aRequest, aState) { debug `onSecurityChange`; if (!(aState & Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT) || diff --git a/netwerk/base/nsISecureBrowserUI.idl b/netwerk/base/nsISecureBrowserUI.idl index b718a71732f9..dcad1fa5938b 100644 --- a/netwerk/base/nsISecureBrowserUI.idl +++ b/netwerk/base/nsISecureBrowserUI.idl @@ -14,32 +14,7 @@ interface nsISecureBrowserUI : nsISupports { void init(in nsIDocShell docShell); - // A value composed of the Security State Flags and the Security - // Strength Flags defined in nsIWebProgressListener. - // Any undefined bits are reserved for future use. - // This represents the security state before the change. - readonly attribute unsigned long oldState; - // A value composed of the Security State Flags and the Security - // Strength Flags defined in nsIWebProgressListener. - // Any undefined bits are reserved for future use. - // This represents the security state after the change. readonly attribute unsigned long state; - // An optional JSON string representing a log of the content blocking - // events happened so far. This will be a JSON object containing keys - // representing origins that content blocking has acted on, with values - // being an array of items, each representing one action. Each action - // itself is an an array containing three elements, the first element - // being a blocking code from one of the Security State Flags above, and - // the second element being a boolean representing whether the origin - // was blocked (if true) or unblocked (if false) in that category, and - // the third element being the number of times that combination has been - // repeated consecutively. - // The reason JSON strings was chosen here was that we needed a format - // that is transferrable across processes in JS; and also the consumer - // of this data (browser-contentblocking.js) would be able to use the - // JSON.parse() API to parse out an object representation of the value. - readonly attribute AString contentBlockingLogJSON; - // Information about the connection security. readonly attribute nsITransportSecurityInfo secInfo; }; diff --git a/security/manager/ssl/nsSecureBrowserUIImpl.cpp b/security/manager/ssl/nsSecureBrowserUIImpl.cpp index 67745b97da9c..491df8ef34c6 100644 --- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp +++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp @@ -57,19 +57,6 @@ nsSecureBrowserUIImpl::Init(nsIDocShell* aDocShell) { return wp->AddProgressListener(this, nsIWebProgress::NOTIFY_LOCATION); } -NS_IMETHODIMP -nsSecureBrowserUIImpl::GetOldState(uint32_t* aOldState) { - MOZ_ASSERT(NS_IsMainThread()); - NS_ENSURE_ARG(aOldState); - - MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug, ("GetOldState %p", this)); - // Only sync our state with the docshell in GetState(). - MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug, (" mOldState: %x", mOldState)); - - *aOldState = mOldState; - return NS_OK; -} - NS_IMETHODIMP nsSecureBrowserUIImpl::GetState(uint32_t* aState) { MOZ_ASSERT(NS_IsMainThread()); @@ -86,28 +73,6 @@ nsSecureBrowserUIImpl::GetState(uint32_t* aState) { return NS_OK; } -NS_IMETHODIMP -nsSecureBrowserUIImpl::GetContentBlockingLogJSON( - nsAString& aContentBlockingLogJSON) { - MOZ_ASSERT(NS_IsMainThread()); - - MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug, - ("GetContentBlockingLogJSON %p", this)); - aContentBlockingLogJSON.Truncate(); - nsCOMPtr docShell = do_QueryReferent(mDocShell); - if (docShell) { - nsIDocument* doc = docShell->GetDocument(); - if (doc) { - aContentBlockingLogJSON = doc->GetContentBlockingLog()->Stringify(); - } - } - MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug, - (" ContentBlockingLogJSON: %s", - NS_ConvertUTF16toUTF8(aContentBlockingLogJSON).get())); - - return NS_OK; -} - NS_IMETHODIMP nsSecureBrowserUIImpl::GetSecInfo(nsITransportSecurityInfo** result) { MOZ_ASSERT(NS_IsMainThread()); @@ -460,8 +425,7 @@ nsSecureBrowserUIImpl::OnStatusChange(nsIWebProgress*, nsIRequest*, nsresult, } nsresult nsSecureBrowserUIImpl::OnSecurityChange(nsIWebProgress*, nsIRequest*, - uint32_t, uint32_t, - const nsAString&) { + uint32_t) { MOZ_ASSERT_UNREACHABLE("Should have been excluded in AddProgressListener()"); return NS_OK; } diff --git a/toolkit/actors/PrintingChild.jsm b/toolkit/actors/PrintingChild.jsm index 9e74183d0847..1fbcba8f7315 100644 --- a/toolkit/actors/PrintingChild.jsm +++ b/toolkit/actors/PrintingChild.jsm @@ -421,6 +421,5 @@ PrintingListener.prototype = { onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {}, onStatusChange(aWebProgress, aRequest, aStatus, aMessage) {}, - onSecurityChange(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) {}, + onSecurityChange(aWebProgress, aRequest, aState) {}, }; diff --git a/toolkit/components/browser/nsWebBrowser.cpp b/toolkit/components/browser/nsWebBrowser.cpp index d3ba8a41d94f..3f9cc7c5a53f 100644 --- a/toolkit/components/browser/nsWebBrowser.cpp +++ b/toolkit/components/browser/nsWebBrowser.cpp @@ -711,12 +711,9 @@ nsWebBrowser::OnStatusChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest, NS_IMETHODIMP nsWebBrowser::OnSecurityChange(nsIWebProgress* aWebProgress, - nsIRequest* aRequest, uint32_t aOldState, - uint32_t aState, - const nsAString& aContentBlockingLogJSON) { + nsIRequest* aRequest, uint32_t aState) { if (mProgressListener) { - return mProgressListener->OnSecurityChange( - aWebProgress, aRequest, aOldState, aState, aContentBlockingLogJSON); + return mProgressListener->OnSecurityChange(aWebProgress, aRequest, aState); } return NS_OK; } diff --git a/toolkit/components/printing/content/printPreviewProgress.js b/toolkit/components/printing/content/printPreviewProgress.js index 3b63e24e7050..54a0a837e3de 100644 --- a/toolkit/components/printing/content/printPreviewProgress.js +++ b/toolkit/components/printing/content/printPreviewProgress.js @@ -59,8 +59,7 @@ var progressListener = { }, onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {}, - onSecurityChange(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) {}, + onSecurityChange(aWebProgress, aRequest, state) {}, onStatusChange(aWebProgress, aRequest, aStatus, aMessage) { if (aMessage) diff --git a/toolkit/components/printing/content/printProgress.js b/toolkit/components/printing/content/printProgress.js index ab64ddbe928a..6e966ac2374a 100644 --- a/toolkit/components/printing/content/printProgress.js +++ b/toolkit/components/printing/content/printProgress.js @@ -140,8 +140,7 @@ var progressListener = { dialog.title.setAttribute("value", aMessage); }, - onSecurityChange(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) { + onSecurityChange(aWebProgress, aRequest, state) { // we can ignore this notification }, diff --git a/toolkit/components/printingui/ipc/PrintProgressDialogChild.cpp b/toolkit/components/printingui/ipc/PrintProgressDialogChild.cpp index a1cbeb84e150..1503b4da8f20 100644 --- a/toolkit/components/printingui/ipc/PrintProgressDialogChild.cpp +++ b/toolkit/components/printingui/ipc/PrintProgressDialogChild.cpp @@ -82,9 +82,9 @@ PrintProgressDialogChild::OnStatusChange(nsIWebProgress* aProgress, } NS_IMETHODIMP -PrintProgressDialogChild::OnSecurityChange( - nsIWebProgress* aProgress, nsIRequest* aRequest, uint32_t aOldState, - uint32_t aState, const nsAString& aContentBlockingLogJSON) { +PrintProgressDialogChild::OnSecurityChange(nsIWebProgress* aProgress, + nsIRequest* aRequest, + uint32_t aState) { return NS_OK; } diff --git a/toolkit/components/printingui/nsPrintProgress.cpp b/toolkit/components/printingui/nsPrintProgress.cpp index cae1332b0f99..a43e1403b993 100644 --- a/toolkit/components/printingui/nsPrintProgress.cpp +++ b/toolkit/components/printingui/nsPrintProgress.cpp @@ -243,9 +243,9 @@ NS_IMETHODIMP nsPrintProgress::OnStatusChange(nsIWebProgress *aWebProgress, return NS_OK; } -NS_IMETHODIMP nsPrintProgress::OnSecurityChange( - nsIWebProgress *aWebProgress, nsIRequest *aRequest, uint32_t aOldState, - uint32_t aState, const nsAString &aContentBlockingLogJSON) { +NS_IMETHODIMP nsPrintProgress::OnSecurityChange(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, + uint32_t state) { return NS_OK; } diff --git a/toolkit/components/printingui/nsPrintingPromptService.cpp b/toolkit/components/printingui/nsPrintingPromptService.cpp index fe850e1c88fe..bb15a37680ac 100644 --- a/toolkit/components/printingui/nsPrintingPromptService.cpp +++ b/toolkit/components/printingui/nsPrintingPromptService.cpp @@ -203,13 +203,13 @@ nsPrintingPromptService::OnStatusChange(nsIWebProgress* aWebProgress, } NS_IMETHODIMP -nsPrintingPromptService::OnSecurityChange( - nsIWebProgress* aWebProgress, nsIRequest* aRequest, uint32_t aOldState, - uint32_t aState, const nsAString& aContentBlockingLogJSON) { +nsPrintingPromptService::OnSecurityChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, + uint32_t state) { #if !defined(XP_MACOSX) if (mWebProgressListener) { - return mWebProgressListener->OnSecurityChange( - aWebProgress, aRequest, aOldState, aState, aContentBlockingLogJSON); + return mWebProgressListener->OnSecurityChange(aWebProgress, aRequest, + state); } #endif return NS_OK; diff --git a/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp b/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp index 96ab9ed9be5d..61fcfef258c1 100644 --- a/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp +++ b/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp @@ -234,13 +234,11 @@ nsBrowserStatusFilter::OnStatusChange(nsIWebProgress *aWebProgress, } NS_IMETHODIMP -nsBrowserStatusFilter::OnSecurityChange( - nsIWebProgress *aWebProgress, nsIRequest *aRequest, uint32_t aOldState, - uint32_t aState, const nsAString &aContentBlockingLogJSON) { +nsBrowserStatusFilter::OnSecurityChange(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, uint32_t aState) { if (!mListener) return NS_OK; - return mListener->OnSecurityChange(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON); + return mListener->OnSecurityChange(aWebProgress, aRequest, aState); } //----------------------------------------------------------------------------- diff --git a/toolkit/components/url-classifier/tests/mochitest/test_threathit_report.html b/toolkit/components/url-classifier/tests/mochitest/test_threathit_report.html index 292749ea21dc..7b2b96d6439a 100644 --- a/toolkit/components/url-classifier/tests/mochitest/test_threathit_report.html +++ b/toolkit/components/url-classifier/tests/mochitest/test_threathit_report.html @@ -194,8 +194,7 @@ function testOnWindow(aTestData) { let browser = win.gBrowser.selectedBrowser; let wp = win.gBrowser.contentWindow.docShell.QueryInterface(Ci.nsIWebProgress); let progressListener = { - onSecurityChange(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) { + onSecurityChange(aWebProgress, aRequest, aState) { expected = aTestData.reportUrl; }, QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"]), diff --git a/toolkit/modules/RemoteSecurityUI.jsm b/toolkit/modules/RemoteSecurityUI.jsm index 5d736b38c0dc..1d0e402e37a5 100644 --- a/toolkit/modules/RemoteSecurityUI.jsm +++ b/toolkit/modules/RemoteSecurityUI.jsm @@ -7,25 +7,19 @@ var EXPORTED_SYMBOLS = ["RemoteSecurityUI"]; function RemoteSecurityUI() { this._secInfo = null; - this._oldState = 0; this._state = 0; - this._contentBlockingLogJSON = ""; } RemoteSecurityUI.prototype = { QueryInterface: ChromeUtils.generateQI([Ci.nsISecureBrowserUI]), // nsISecureBrowserUI - get oldState() { return this._oldState; }, get state() { return this._state; }, - get contentBlockingLogJSON() { return this._contentBlockingLogJSON; }, get tooltipText() { return ""; }, get secInfo() { return this._secInfo; }, - _update(aSecInfo, aOldState, aState, aContentBlockingLogJSON) { + _update(aSecInfo, aState) { this._secInfo = aSecInfo; - this._oldState = aOldState; this._state = aState; - this._contentBlockingLogJSON = aContentBlockingLogJSON; }, }; diff --git a/toolkit/modules/RemoteWebProgress.jsm b/toolkit/modules/RemoteWebProgress.jsm index dc7c32e36223..aa75a5672680 100644 --- a/toolkit/modules/RemoteWebProgress.jsm +++ b/toolkit/modules/RemoteWebProgress.jsm @@ -119,7 +119,7 @@ RemoteWebProgressManager.prototype = { this._progressListeners.filter(l => l.listener != aListener); }, - _fixSecInfo(aSecInfo) { + _fixSecInfoAndState(aSecInfo, aState) { let deserialized = null; if (aSecInfo) { let helper = Cc["@mozilla.org/network/serialization-helper;1"] @@ -129,7 +129,7 @@ RemoteWebProgressManager.prototype = { deserialized.QueryInterface(Ci.nsITransportSecurityInfo); } - return deserialized; + return [deserialized, aState]; }, setCurrentURI(aURI) { @@ -244,23 +244,19 @@ RemoteWebProgressManager.prototype = { break; case "Content:SecurityChange": - let secInfo = this._fixSecInfo(json.secInfo); - let oldState = json.oldState; - let state = json.state; - let contentBlockingLogJSON = json.contentBlockingLogJSON; + let [secInfo, state] = this._fixSecInfoAndState(json.secInfo, json.state); if (isTopLevel) { // Invoking this getter triggers the generation of the underlying object, // which we need to access with ._securityUI, because .securityUI returns // a wrapper that makes _update inaccessible. void this._browser.securityUI; - this._browser._securityUI._update(secInfo, oldState, state, - contentBlockingLogJSON); + this._browser._securityUI._update(secInfo, state); } this._callProgressListeners( Ci.nsIWebProgress.NOTIFY_SECURITY, "onSecurityChange", webProgress, - request, oldState, state, contentBlockingLogJSON + request, state ); break; diff --git a/toolkit/modules/WebProgressChild.jsm b/toolkit/modules/WebProgressChild.jsm index 42c158aa25ea..4eb5348e7e84 100644 --- a/toolkit/modules/WebProgressChild.jsm +++ b/toolkit/modules/WebProgressChild.jsm @@ -188,14 +188,11 @@ class WebProgressChild { return null; } - onSecurityChange(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) { + onSecurityChange(aWebProgress, aRequest, aState) { let json = this._setupJSON(aWebProgress, aRequest); - json.oldState = aOldState; json.state = aState; json.secInfo = this.getSecInfoAsString(); - json.contentBlockingLogJSON = aContentBlockingLogJSON; json.matchedList = null; if (aRequest && aRequest instanceof Ci.nsIClassifiedChannel) { diff --git a/toolkit/mozapps/downloads/nsHelperAppDlg.js b/toolkit/mozapps/downloads/nsHelperAppDlg.js index 3d74a2a9d166..21dfb3fd5cec 100644 --- a/toolkit/mozapps/downloads/nsHelperAppDlg.js +++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js @@ -70,8 +70,7 @@ nsUnknownContentTypeDialogProgressListener.prototype = { onLocationChange(aWebProgress, aRequest, aLocation, aFlags) { }, - onSecurityChange(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) { + onSecurityChange(aWebProgress, aRequest, state) { }, onRefreshAttempted(aWebProgress, aURI, aDelay, aSameURI) { diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js index 85a1a07585c5..57e08559d555 100644 --- a/toolkit/mozapps/extensions/content/extensions.js +++ b/toolkit/mozapps/extensions/content/extensions.js @@ -2186,8 +2186,7 @@ var gDiscoverView = { aRequest.cancel(Cr.NS_BINDING_ABORTED); }, - onSecurityChange(aWebProgress, aRequest, aOldState, aState, - aContentBlockingLogJSON) { + onSecurityChange(aWebProgress, aRequest, aState) { // Don't care about security if the page is not https if (!this.homepageURL.schemeIs("https")) return; diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp index cd727596090d..19f222d2e42d 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp @@ -1403,12 +1403,9 @@ NS_IMETHODIMP nsDocLoader::OnSecurityChange( nsCOMPtr request = do_QueryInterface(aContext); nsIWebProgress* webProgress = static_cast(this); - nsAutoString contentBlockingLogJSON( - aContentBlockingLog ? aContentBlockingLog->Stringify() : EmptyString()); NOTIFY_LISTENERS(nsIWebProgress::NOTIFY_SECURITY, - listener->OnSecurityChange(webProgress, request, aOldState, - aState, contentBlockingLogJSON);); + listener->OnSecurityChange(webProgress, request, aState);); // Pass the notification up to the parent... if (mParent) { diff --git a/uriloader/base/nsIWebProgressListener.idl b/uriloader/base/nsIWebProgressListener.idl index a2a138397876..814f07d527f7 100644 --- a/uriloader/base/nsIWebProgressListener.idl +++ b/uriloader/base/nsIWebProgressListener.idl @@ -471,32 +471,15 @@ interface nsIWebProgressListener : nsISupports * The nsIWebProgress instance that fired the notification. * @param aRequest * The nsIRequest that has new security state. - * @param aOldState - * A value composed of the Security State Flags and the Security - * Strength Flags listed above. Any undefined bits are reserved for - * future use. This represents the security state before the change. * @param aState * A value composed of the Security State Flags and the Security * Strength Flags listed above. Any undefined bits are reserved for - * future use. This represents the security state after the change. - * @param aContentBlockingLog - * An optional JSON string representing a log of the content blocking - * events happened so far. This will be a JSON object containing keys - * representing origins that content blocking has acted on, with values - * being an array of items, each representing one action. Each action - * itself is an an array containing three elements, the first element - * being a blocking code from one of the Security State Flags above, and - * the second element being a boolean representing whether the origin - * was blocked (if true) or unblocked (if false) in that category, and - * the third element being the number of times that combination has been - * repeated consecutively. + * future use. * * NOTE: These notifications will only occur if a security package is * installed. */ void onSecurityChange(in nsIWebProgress aWebProgress, in nsIRequest aRequest, - in unsigned long aOldState, - in unsigned long aState, - in AString aContentBlockingLogJSON); + in unsigned long aState); }; diff --git a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp index 50f0484195bd..341f0ecb6daf 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp +++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp @@ -212,9 +212,9 @@ nsOfflineCachePendingUpdate::OnStatusChange(nsIWebProgress *aWebProgress, } NS_IMETHODIMP -nsOfflineCachePendingUpdate::OnSecurityChange( - nsIWebProgress *aWebProgress, nsIRequest *aRequest, uint32_t aOldState, - uint32_t aState, const nsAString &aContentBlockingLogJSON) { +nsOfflineCachePendingUpdate::OnSecurityChange(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, + uint32_t state) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } diff --git a/uriloader/prefetch/nsPrefetchService.cpp b/uriloader/prefetch/nsPrefetchService.cpp index d9a743f4390d..8e5536311f28 100644 --- a/uriloader/prefetch/nsPrefetchService.cpp +++ b/uriloader/prefetch/nsPrefetchService.cpp @@ -919,9 +919,7 @@ nsPrefetchService::OnStatusChange(nsIWebProgress *aWebProgress, NS_IMETHODIMP nsPrefetchService::OnSecurityChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, uint32_t aOldState, - uint32_t aState, - const nsAString &aContentBlockingLogJSON) { + nsIRequest *aRequest, uint32_t state) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } diff --git a/xpfe/appshell/nsChromeTreeOwner.cpp b/xpfe/appshell/nsChromeTreeOwner.cpp index f17786042c9a..448d7a4d3390 100644 --- a/xpfe/appshell/nsChromeTreeOwner.cpp +++ b/xpfe/appshell/nsChromeTreeOwner.cpp @@ -445,9 +445,7 @@ nsChromeTreeOwner::OnStatusChange(nsIWebProgress* aWebProgress, NS_IMETHODIMP nsChromeTreeOwner::OnSecurityChange(nsIWebProgress* aWebProgress, - nsIRequest* aRequest, uint32_t aOldState, - uint32_t aState, - const nsAString& aContentBlockingLogJSON) { + nsIRequest* aRequest, uint32_t state) { return NS_OK; } diff --git a/xpfe/appshell/nsWebShellWindow.cpp b/xpfe/appshell/nsWebShellWindow.cpp index bd449975e724..58093b3a8548 100644 --- a/xpfe/appshell/nsWebShellWindow.cpp +++ b/xpfe/appshell/nsWebShellWindow.cpp @@ -629,9 +629,7 @@ nsWebShellWindow::OnStatusChange(nsIWebProgress* aWebProgress, NS_IMETHODIMP nsWebShellWindow::OnSecurityChange(nsIWebProgress* aWebProgress, - nsIRequest* aRequest, uint32_t aOldState, - uint32_t aState, - const nsAString& aContentBlockingLogJSON) { + nsIRequest* aRequest, uint32_t state) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } From a9178e878ddbb59b654fad5753ec21d4f298538b Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 29 Nov 2018 10:50:38 -0500 Subject: [PATCH 04/10] Bug 1510911 - Part 3: Backout changeset d0997972e4d4 (bug 1493563 - Part 4) for regressing performance --- dom/base/nsGlobalWindowOuter.cpp | 3 +- dom/security/nsMixedContentBlocker.cpp | 53 ++++++++----------- netwerk/base/nsISecurityEventSink.idl | 17 +----- .../manager/ssl/nsSecureBrowserUIImpl.cpp | 16 +----- security/manager/ssl/nsSecureBrowserUIImpl.h | 6 +-- uriloader/base/nsDocLoader.cpp | 8 ++- 6 files changed, 31 insertions(+), 72 deletions(-) diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp index 22ce2090d3bf..7357ccff09db 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp @@ -5073,8 +5073,7 @@ void nsGlobalWindowOuter::NotifyContentBlockingState(unsigned aState, return; } - eventSink->OnSecurityChange(aChannel, oldState, state, - doc->GetContentBlockingLog()); + eventSink->OnSecurityChange(aChannel, state); } // static diff --git a/dom/security/nsMixedContentBlocker.cpp b/dom/security/nsMixedContentBlocker.cpp index 1184ab9f7c18..b9db68d9c7bd 100644 --- a/dom/security/nsMixedContentBlocker.cpp +++ b/dom/security/nsMixedContentBlocker.cpp @@ -102,7 +102,6 @@ class nsMixedContentEvent : public Runnable { nsCOMPtr rootDoc = sameTypeRoot->GetDocument(); NS_ASSERTION(rootDoc, "No root document from document shell root tree item."); - ContentBlockingLog* contentBlockingLog = rootDoc->GetContentBlockingLog(); // Get eventSink and the current security state from the docShell nsCOMPtr eventSink = do_QueryInterface(docShell); @@ -146,18 +145,16 @@ class nsMixedContentEvent : public Runnable { } eventSink->OnSecurityChange( - mContext, state, + mContext, (state | - nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT), - contentBlockingLog); + nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT)); } else { // root not secure, mixed active content loaded in an https subframe if (NS_SUCCEEDED(stateRV)) { eventSink->OnSecurityChange( - mContext, state, + mContext, (state | - nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT), - contentBlockingLog); + nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT)); } } } @@ -188,18 +185,16 @@ class nsMixedContentEvent : public Runnable { } eventSink->OnSecurityChange( - mContext, state, + mContext, (state | - nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT), - contentBlockingLog); + nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT)); } else { // root not secure, mixed display content loaded in an https subframe if (NS_SUCCEEDED(stateRV)) { eventSink->OnSecurityChange( - mContext, state, + mContext, (state | - nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT), - contentBlockingLog); + nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT)); } } } @@ -900,7 +895,6 @@ nsresult nsMixedContentBlocker::ShouldLoad( // Get the root document from the sameTypeRoot nsCOMPtr rootDoc = sameTypeRoot->GetDocument(); NS_ASSERTION(rootDoc, "No root document from document shell root tree item."); - ContentBlockingLog* contentBlockingLog = rootDoc->GetContentBlockingLog(); // Get eventSink and the current security state from the docShell nsCOMPtr eventSink = do_QueryInterface(docShell); @@ -991,19 +985,17 @@ nsresult nsMixedContentBlocker::ShouldLoad( } eventSink->OnSecurityChange( - aRequestingContext, state, + aRequestingContext, (state | - nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT), - contentBlockingLog); + nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT)); } else { // User has overriden the pref and the root is not https; // mixed display content was allowed on an https subframe. if (NS_SUCCEEDED(stateRV)) { eventSink->OnSecurityChange( - aRequestingContext, state, + aRequestingContext, (state | - nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT), - contentBlockingLog); + nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT)); } } } else { @@ -1014,10 +1006,9 @@ nsresult nsMixedContentBlocker::ShouldLoad( NS_SUCCEEDED(stateRV)) { rootDoc->SetHasMixedDisplayContentBlocked(true); eventSink->OnSecurityChange( - aRequestingContext, state, + aRequestingContext, (state | - nsIWebProgressListener::STATE_BLOCKED_MIXED_DISPLAY_CONTENT), - contentBlockingLog); + nsIWebProgressListener::STATE_BLOCKED_MIXED_DISPLAY_CONTENT)); } } return NS_OK; @@ -1049,9 +1040,9 @@ nsresult nsMixedContentBlocker::ShouldLoad( } eventSink->OnSecurityChange( - aRequestingContext, state, - (state | nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT), - contentBlockingLog); + aRequestingContext, + (state | + nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT)); return NS_OK; } else { @@ -1059,10 +1050,9 @@ nsresult nsMixedContentBlocker::ShouldLoad( // mixed active content was allowed on an https subframe. if (NS_SUCCEEDED(stateRV)) { eventSink->OnSecurityChange( - aRequestingContext, state, + aRequestingContext, (state | - nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT), - contentBlockingLog); + nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT)); } return NS_OK; } @@ -1083,10 +1073,9 @@ nsresult nsMixedContentBlocker::ShouldLoad( // option by calling eventSink which will invoke the doorhanger if (NS_SUCCEEDED(stateRV)) { eventSink->OnSecurityChange( - aRequestingContext, state, + aRequestingContext, (state | - nsIWebProgressListener::STATE_BLOCKED_MIXED_ACTIVE_CONTENT), - contentBlockingLog); + nsIWebProgressListener::STATE_BLOCKED_MIXED_ACTIVE_CONTENT)); } return NS_OK; } diff --git a/netwerk/base/nsISecurityEventSink.idl b/netwerk/base/nsISecurityEventSink.idl index 0f752e284cb0..d824fe5a7f0b 100644 --- a/netwerk/base/nsISecurityEventSink.idl +++ b/netwerk/base/nsISecurityEventSink.idl @@ -4,16 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsISupports.idl" - -%{ C++ -namespace mozilla { -namespace dom { -class ContentBlockingLog; -} -} -%} - -[ptr] native ContentBlockingLog(mozilla::dom::ContentBlockingLog); +interface nsIURI; [builtinclass, uuid(a71aee68-dd38-4736-bd79-035fea1a1ec6)] interface nsISecurityEventSink : nsISupports @@ -25,13 +16,9 @@ interface nsISecurityEventSink : nsISupports * a security package (eg Netscape Personal Security Manager) * to notify nsIWebProgressListeners that security state has * changed. State flags are in nsIWebProgressListener.idl - * The old state flags before the change must also be passed in. - * cbLog represents the log of the content blocking actions on - * the page so far. */ - void onSecurityChange(in nsISupports i_Context, in unsigned long oldState, - in unsigned long state, in ContentBlockingLog cbLog); + void onSecurityChange(in nsISupports i_Context, in unsigned long state); }; diff --git a/security/manager/ssl/nsSecureBrowserUIImpl.cpp b/security/manager/ssl/nsSecureBrowserUIImpl.cpp index 491df8ef34c6..b7f9f73a5942 100644 --- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp +++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp @@ -21,7 +21,7 @@ using namespace mozilla; LazyLogModule gSecureBrowserUILog("nsSecureBrowserUI"); -nsSecureBrowserUIImpl::nsSecureBrowserUIImpl() : mOldState(0), mState(0) { +nsSecureBrowserUIImpl::nsSecureBrowserUIImpl() : mState(0) { MOZ_ASSERT(NS_IsMainThread()); } @@ -107,8 +107,6 @@ void nsSecureBrowserUIImpl::CheckForBlockedContent() { } } - mOldState = mState; - // Has mixed content been loaded or blocked in nsMixedContentBlocker? // This only applies to secure documents even if they're affected by mixed // content blocking in which case the STATE_IS_BROKEN bit would be set rather @@ -353,7 +351,6 @@ nsSecureBrowserUIImpl::OnLocationChange(nsIWebProgress* aWebProgress, return NS_OK; } - mOldState = 0; mState = 0; mTopLevelSecurityInfo = nullptr; @@ -380,21 +377,12 @@ nsSecureBrowserUIImpl::OnLocationChange(nsIWebProgress* aWebProgress, } } - mozilla::dom::ContentBlockingLog* contentBlockingLog = nullptr; nsCOMPtr docShell = do_QueryReferent(mDocShell); - if (docShell) { - nsIDocument* doc = docShell->GetDocument(); - if (doc) { - contentBlockingLog = doc->GetContentBlockingLog(); - } - } - nsCOMPtr eventSink = do_QueryInterface(docShell); if (eventSink) { MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug, (" calling OnSecurityChange %p %x", aRequest, mState)); - Unused << eventSink->OnSecurityChange(aRequest, mOldState, mState, - contentBlockingLog); + Unused << eventSink->OnSecurityChange(aRequest, mState); } else { MOZ_LOG(gSecureBrowserUILog, LogLevel::Debug, (" no docShell or couldn't QI it to nsISecurityEventSink?")); diff --git a/security/manager/ssl/nsSecureBrowserUIImpl.h b/security/manager/ssl/nsSecureBrowserUIImpl.h index bab4de26901e..38f2e018dd71 100644 --- a/security/manager/ssl/nsSecureBrowserUIImpl.h +++ b/security/manager/ssl/nsSecureBrowserUIImpl.h @@ -34,14 +34,12 @@ class nsSecureBrowserUIImpl : public nsISecureBrowserUI, protected: virtual ~nsSecureBrowserUIImpl(){}; - // Do mixed content and tracking protection checks. May update mState and - // mOldState. + // Do mixed content and tracking protection checks. May update mState. void CheckForBlockedContent(); // Given some information about a request from an OnLocationChange event, - // update mState, mOldState and mTopLevelSecurityInfo. + // update mState and mTopLevelSecurityInfo. nsresult UpdateStateAndSecurityInfo(nsIChannel* channel, nsIURI* uri); - uint32_t mOldState; uint32_t mState; nsWeakPtr mDocShell; nsWeakPtr mWebProgress; diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp index 19f222d2e42d..54a7483498eb 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp @@ -40,7 +40,6 @@ using mozilla::DebugOnly; using mozilla::LogLevel; -using mozilla::dom::ContentBlockingLog; // // Log module for nsIDocumentLoader logging... @@ -1394,9 +1393,8 @@ NS_IMETHODIMP nsDocLoader::AsyncOnChannelRedirect( * Implementation of nsISecurityEventSink method... */ -NS_IMETHODIMP nsDocLoader::OnSecurityChange( - nsISupports* aContext, uint32_t aOldState, uint32_t aState, - ContentBlockingLog* aContentBlockingLog) { +NS_IMETHODIMP nsDocLoader::OnSecurityChange(nsISupports* aContext, + uint32_t aState) { // // Fire progress notifications out to any registered nsIWebProgressListeners. // @@ -1409,7 +1407,7 @@ NS_IMETHODIMP nsDocLoader::OnSecurityChange( // Pass the notification up to the parent... if (mParent) { - mParent->OnSecurityChange(aContext, aOldState, aState, aContentBlockingLog); + mParent->OnSecurityChange(aContext, aState); } return NS_OK; } From 5c2dc1d41d6bb855367f778e24d85f5ad5f52188 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Mon, 3 Dec 2018 15:19:24 -0500 Subject: [PATCH 05/10] Bug 1498102 - Set the dom.ipc.processCount in the mochitest.ini file to ensure it is set throughout the entire test --- toolkit/components/antitracking/test/browser/browser.ini | 1 + .../test/browser/browser_blockingServiceWorkers.js | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/toolkit/components/antitracking/test/browser/browser.ini b/toolkit/components/antitracking/test/browser/browser.ini index 360d4a4be03a..192d5f37fa9a 100644 --- a/toolkit/components/antitracking/test/browser/browser.ini +++ b/toolkit/components/antitracking/test/browser/browser.ini @@ -34,6 +34,7 @@ skip-if = serviceworker_e10s skip-if = serviceworker_e10s [browser_blockingServiceWorkers.js] skip-if = (os == "win" && os_version == "6.1" && bits == 32 && !debug) # Bug 1491937 +prefs = dom.ipc.processCount=1 # Bug 1498102 [browser_blockingSharedWorkers.js] skip-if = (os == "win" && os_version == "6.1" && bits == 32 && !debug) # Bug 1491937 [browser_blockingMessaging.js] diff --git a/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js b/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js index a342af332538..a2f0a1f0d6c2 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js @@ -14,7 +14,6 @@ AntiTracking.runTest("ServiceWorkers", }); }, [["dom.serviceWorkers.exemptFromPerDomainMax", true], - ["dom.ipc.processCount", 1], ["dom.serviceWorkers.enabled", true], ["dom.serviceWorkers.testing.enabled", true]]); @@ -22,7 +21,6 @@ AntiTracking.runTest("ServiceWorkers and Storage Access API", async _ => { await SpecialPowers.pushPrefEnv({"set": [ ["dom.serviceWorkers.exemptFromPerDomainMax", true], - ["dom.ipc.processCount", 1], ["dom.serviceWorkers.enabled", true], ["dom.serviceWorkers.testing.enabled", true], ]}); @@ -48,7 +46,6 @@ AntiTracking.runTest("ServiceWorkers and Storage Access API", async _ => { await SpecialPowers.pushPrefEnv({"set": [ ["dom.serviceWorkers.exemptFromPerDomainMax", true], - ["dom.ipc.processCount", 1], ["dom.serviceWorkers.enabled", true], ["dom.serviceWorkers.testing.enabled", true], ]}); @@ -80,7 +77,6 @@ AntiTracking.runTest("ServiceWorkers and Storage Access API", }); }, [["dom.serviceWorkers.exemptFromPerDomainMax", true], - ["dom.ipc.processCount", 1], ["dom.serviceWorkers.enabled", true], ["dom.serviceWorkers.testing.enabled", true]], false, false); From 0d6916073ec59839bdc728ff62fef988d9c2b5a7 Mon Sep 17 00:00:00 2001 From: Eric Rahm Date: Mon, 3 Dec 2018 11:50:45 -0800 Subject: [PATCH 06/10] Bug 1510829 - Upload AWSY artifacts even if processing fails. r=bc It's useful to get DMD reports even if we end up with negative heap-unclassified. This catches any assertions during processing and makes sure we move the reports to the upload dir even if there's a failure. --HG-- extra : rebase_source : 3268d7b8f7f33c36c9b59bfdd5f181d80a0c4201 --- testing/awsy/awsy/awsy_test_case.py | 41 ++++++++++++++++------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/testing/awsy/awsy/awsy_test_case.py b/testing/awsy/awsy/awsy_test_case.py index b0de7a7c6bc9..73a317f7793c 100644 --- a/testing/awsy/awsy/awsy_test_case.py +++ b/testing/awsy/awsy/awsy_test_case.py @@ -80,26 +80,31 @@ class AwsyTestCase(MarionetteTestCase): def tearDown(self): MarionetteTestCase.tearDown(self) - self.logger.info("processing data in %s!" % self._resultsDir) - perf_blob = process_perf_data.create_perf_data( - self._resultsDir, self.perf_suites(), - self.perf_checkpoints()) - self.logger.info("PERFHERDER_DATA: %s" % json.dumps(perf_blob)) + try: + self.logger.info("processing data in %s!" % self._resultsDir) + perf_blob = process_perf_data.create_perf_data( + self._resultsDir, self.perf_suites(), + self.perf_checkpoints()) + self.logger.info("PERFHERDER_DATA: %s" % json.dumps(perf_blob)) - perf_file = os.path.join(self._resultsDir, "perfherder_data.json") - with open(perf_file, 'w') as fp: - json.dump(perf_blob, fp, indent=2) - self.logger.info("Perfherder data written to %s" % perf_file) + perf_file = os.path.join(self._resultsDir, "perfherder_data.json") + with open(perf_file, 'w') as fp: + json.dump(perf_blob, fp, indent=2) + self.logger.info("Perfherder data written to %s" % perf_file) + except: + raise + finally: + # Make sure we cleanup and upload any existing files even if there + # were errors processing the perf data. + if self._dmd: + self.cleanup_dmd() - if self._dmd: - self.cleanup_dmd() - - # copy it to moz upload dir if set - if 'MOZ_UPLOAD_DIR' in os.environ: - for file in os.listdir(self._resultsDir): - file = os.path.join(self._resultsDir, file) - if os.path.isfile(file): - shutil.copy2(file, os.environ["MOZ_UPLOAD_DIR"]) + # copy it to moz upload dir if set + if 'MOZ_UPLOAD_DIR' in os.environ: + for file in os.listdir(self._resultsDir): + file = os.path.join(self._resultsDir, file) + if os.path.isfile(file): + shutil.copy2(file, os.environ["MOZ_UPLOAD_DIR"]) def cleanup_dmd(self): """ From 987ffa06f3ca8ad8ef28aa5b36d25dd913926397 Mon Sep 17 00:00:00 2001 From: Csoregi Natalia Date: Mon, 3 Dec 2018 23:12:28 +0200 Subject: [PATCH 07/10] Backed out changeset e90a86bd84b2 (bug 1498102) for browser-chrome failures pref key related. CLOSED TREE --- toolkit/components/antitracking/test/browser/browser.ini | 1 - .../test/browser/browser_blockingServiceWorkers.js | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/toolkit/components/antitracking/test/browser/browser.ini b/toolkit/components/antitracking/test/browser/browser.ini index 192d5f37fa9a..360d4a4be03a 100644 --- a/toolkit/components/antitracking/test/browser/browser.ini +++ b/toolkit/components/antitracking/test/browser/browser.ini @@ -34,7 +34,6 @@ skip-if = serviceworker_e10s skip-if = serviceworker_e10s [browser_blockingServiceWorkers.js] skip-if = (os == "win" && os_version == "6.1" && bits == 32 && !debug) # Bug 1491937 -prefs = dom.ipc.processCount=1 # Bug 1498102 [browser_blockingSharedWorkers.js] skip-if = (os == "win" && os_version == "6.1" && bits == 32 && !debug) # Bug 1491937 [browser_blockingMessaging.js] diff --git a/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js b/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js index a2f0a1f0d6c2..a342af332538 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js @@ -14,6 +14,7 @@ AntiTracking.runTest("ServiceWorkers", }); }, [["dom.serviceWorkers.exemptFromPerDomainMax", true], + ["dom.ipc.processCount", 1], ["dom.serviceWorkers.enabled", true], ["dom.serviceWorkers.testing.enabled", true]]); @@ -21,6 +22,7 @@ AntiTracking.runTest("ServiceWorkers and Storage Access API", async _ => { await SpecialPowers.pushPrefEnv({"set": [ ["dom.serviceWorkers.exemptFromPerDomainMax", true], + ["dom.ipc.processCount", 1], ["dom.serviceWorkers.enabled", true], ["dom.serviceWorkers.testing.enabled", true], ]}); @@ -46,6 +48,7 @@ AntiTracking.runTest("ServiceWorkers and Storage Access API", async _ => { await SpecialPowers.pushPrefEnv({"set": [ ["dom.serviceWorkers.exemptFromPerDomainMax", true], + ["dom.ipc.processCount", 1], ["dom.serviceWorkers.enabled", true], ["dom.serviceWorkers.testing.enabled", true], ]}); @@ -77,6 +80,7 @@ AntiTracking.runTest("ServiceWorkers and Storage Access API", }); }, [["dom.serviceWorkers.exemptFromPerDomainMax", true], + ["dom.ipc.processCount", 1], ["dom.serviceWorkers.enabled", true], ["dom.serviceWorkers.testing.enabled", true]], false, false); From d64dcc72d0b0db45c67eb1e6bed45ec9fadfff08 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Mon, 3 Dec 2018 14:37:58 -0800 Subject: [PATCH 08/10] Bug 1511894 - Re-enable wasm abort.any.js on fennec wpt r=me a=testonly --HG-- extra : rebase_source : cdf8dca1ce4d79027d6cf3af440fa7a8037e7855 --- testing/web-platform/meta/wasm/webapi/abort.any.js.ini | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 testing/web-platform/meta/wasm/webapi/abort.any.js.ini diff --git a/testing/web-platform/meta/wasm/webapi/abort.any.js.ini b/testing/web-platform/meta/wasm/webapi/abort.any.js.ini deleted file mode 100644 index 8fe65f62d5d3..000000000000 --- a/testing/web-platform/meta/wasm/webapi/abort.any.js.ini +++ /dev/null @@ -1,6 +0,0 @@ -[abort.any.worker.html] - disabled: - if os == "android": https://bugzilla.mozilla.org/show_bug.cgi?id=1499003 - - -[abort.any.html] From 5a6ca9bbf409e3276b9863f70247adda418bcce0 Mon Sep 17 00:00:00 2001 From: Jorg K Date: Tue, 4 Dec 2018 00:48:00 +0200 Subject: [PATCH 09/10] Bug 1511692 - suppress warning for NS_BASE_STREAM_CLOSED from base streams Available() call. r=baku --- xpcom/io/NonBlockingAsyncInputStream.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xpcom/io/NonBlockingAsyncInputStream.cpp b/xpcom/io/NonBlockingAsyncInputStream.cpp index 5d8573ec7df8..84d812454b51 100644 --- a/xpcom/io/NonBlockingAsyncInputStream.cpp +++ b/xpcom/io/NonBlockingAsyncInputStream.cpp @@ -168,7 +168,8 @@ NonBlockingAsyncInputStream::Close() { NS_IMETHODIMP NonBlockingAsyncInputStream::Available(uint64_t* aLength) { nsresult rv = mInputStream->Available(aLength); - if (NS_WARN_IF(NS_FAILED(rv))) { + // Don't issue warnings for legal condition NS_BASE_STREAM_CLOSED. + if (rv == NS_BASE_STREAM_CLOSED || NS_WARN_IF(NS_FAILED(rv))) { return rv; } From 6ca4903c3f48f770ae70669575880563ccce85a3 Mon Sep 17 00:00:00 2001 From: "Francesco Lodolo (:flod)" Date: Tue, 4 Dec 2018 10:12:32 -0500 Subject: [PATCH 10/10] Bug 1511988 - Convert aboutNetworking.ftl to LF line ending r=Pike a=release-bustage Differential Revision: https://phabricator.services.mozilla.com/D13730 --HG-- extra : amend_source : 16e03236f12449e0eae333819997b26b2e669157 --- .../en-US/toolkit/about/aboutNetworking.ftl | 122 +++++++++--------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/toolkit/locales/en-US/toolkit/about/aboutNetworking.ftl b/toolkit/locales/en-US/toolkit/about/aboutNetworking.ftl index f6739b35e78d..2eca62a9c85f 100644 --- a/toolkit/locales/en-US/toolkit/about/aboutNetworking.ftl +++ b/toolkit/locales/en-US/toolkit/about/aboutNetworking.ftl @@ -1,61 +1,61 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -title = About Networking -warning = This is very experimental. Do not use without adult supervision. -show-next-time-checkbox = Show this warning next time -ok = OK -http = HTTP -sockets = Sockets -dns = DNS -websockets = WebSockets -refresh = Refresh -auto-refresh = Autorefresh every 3 seconds -hostname = Hostname -port = Port -http2 = HTTP/2 -ssl = SSL -active = Active -idle = Idle -host = Host -tcp = TCP -sent = Sent -received = Received -family = Family -trr = TRR -addresses = Addresses -expires = Expires (Seconds) -messages-sent = Messages Sent -messages-received = Messages Received -bytes-sent = Bytes Sent -bytes-received = Bytes Received -logging = Logging -log-tutorial = - See HTTP Logging - for instructions on how to use this tool. -current-log-file = Current Log File: -current-log-modules = Current Log Modules: -set-log-file = Set Log File -set-log-modules = Set Log Modules -start-logging = Start Logging -stop-logging = Stop Logging -dns-lookup = DNS Lookup -dns-lookup-button = Resolve -dns-domain = Domain: -dns-lookup-table-column = IPs -rcwn = RCWN Stats -rcwn-status = RCWN Status -rcwn-cache-won-count = Cache won count -rcwn-net-won-count = Net won count -total-network-requests = Total network request count -rcwn-operation = Cache Operation -rcwn-perf-open = Open -rcwn-perf-read = Read -rcwn-perf-write = Write -rcwn-perf-entry-open = Entry Open -rcwn-avg-short = Short Average -rcwn-avg-long = Long Average -rcwn-std-dev-long = Long Standard Deviation -rcwn-cache-slow = Cache slow count -rcwn-cache-not-slow = Cache not slow count +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +title = About Networking +warning = This is very experimental. Do not use without adult supervision. +show-next-time-checkbox = Show this warning next time +ok = OK +http = HTTP +sockets = Sockets +dns = DNS +websockets = WebSockets +refresh = Refresh +auto-refresh = Autorefresh every 3 seconds +hostname = Hostname +port = Port +http2 = HTTP/2 +ssl = SSL +active = Active +idle = Idle +host = Host +tcp = TCP +sent = Sent +received = Received +family = Family +trr = TRR +addresses = Addresses +expires = Expires (Seconds) +messages-sent = Messages Sent +messages-received = Messages Received +bytes-sent = Bytes Sent +bytes-received = Bytes Received +logging = Logging +log-tutorial = + See HTTP Logging + for instructions on how to use this tool. +current-log-file = Current Log File: +current-log-modules = Current Log Modules: +set-log-file = Set Log File +set-log-modules = Set Log Modules +start-logging = Start Logging +stop-logging = Stop Logging +dns-lookup = DNS Lookup +dns-lookup-button = Resolve +dns-domain = Domain: +dns-lookup-table-column = IPs +rcwn = RCWN Stats +rcwn-status = RCWN Status +rcwn-cache-won-count = Cache won count +rcwn-net-won-count = Net won count +total-network-requests = Total network request count +rcwn-operation = Cache Operation +rcwn-perf-open = Open +rcwn-perf-read = Read +rcwn-perf-write = Write +rcwn-perf-entry-open = Entry Open +rcwn-avg-short = Short Average +rcwn-avg-long = Long Average +rcwn-std-dev-long = Long Standard Deviation +rcwn-cache-slow = Cache slow count +rcwn-cache-not-slow = Cache not slow count