From 3c4a44c16eab5f2518c4c7cee9486ee56571d109 Mon Sep 17 00:00:00 2001 From: Roy Tam Date: Fri, 17 Jan 2020 09:03:54 +0800 Subject: [PATCH] import changes from `devel' branch of rmottola/Arctic-Fox: - Bug 1132874 - Improve protections against sending a parent plugin protocol shutdown message to the child after the child has torn down. r=aklotz (b80b45fa7) - Bug 1103036 - Follow-up to initial patch; r=jchen (51337c2dc) - Bug 1132874 - Simplify PPluginWidget protocol handling, and avoid sending async messages from the parent. Addresses a problem with sub protocols that are torn down randomly from either side of the connection. r=aklotz (3ad936e84) - Bug 1128214 - Avoid a crash when attempting to render windows titlebar specific theme elements with e10s. r=roc (b6f17da09) - Bug 1139368 - Set FilterTypeSet dependency in improveThisTypesForCall. r=h4writer (422de7271) - Bug 864041 - Remove Firefox 2+3 compat code from about:sessionrestore. r=mak (4cfc6fe9a) - Bug 1009599 - Restoring from about:sessionrestore fails when there is more than one tab in the window r=smacleod (88ca1cfbc) - Bug 1146052 - Fix empty about:sessionrestore after crash as well as empty about:welcomeback after resetting the profile r=smacleod (211b50396) - Bug 1043797: extended popup notifications to create a generic doorhanger for all security notifications incl. mixed content r=adw (f7c2d5ded) - Bug 900845 - We aren't using the NetUtil module in SessionStore.jsm. (3f5ddd133) - Bug 898755 - Remove _resume_session_once_on_shutdown code from SessionStore; r=yoric (eb159fec9) - Bug 902727 - [Session Restore] Remove legacy _writeFileEncoder; r=smacleod (8e375c529) - space cleanup (cbd71ce91) - Bug 968923 - part 1 - add infrastructure for defining use counters from UseCounters.conf; original-author=heycam; r=heycam,gfritzsche,mshal (d0dea9997) - Bug 968923 - part 2 - change MappedAttrParser to store a nsSVGElement directly, instead of its nsIPrincipal; r=smaug (4eff86d7f) - Merge branch 'devel' of https://github.com/rmottola/Arctic-Fox into devel (feb4378e6) --- browser/base/content/browser.css | 4 + browser/base/content/browser.js | 41 ++----- browser/base/content/browser.xul | 2 +- browser/base/content/popup-notifications.inc | 7 -- browser/base/content/urlbarBindings.xml | 106 ++++++++++++++++++ .../sessionstore/SessionMigration.jsm | 11 +- .../components/sessionstore/SessionStore.jsm | 44 +------- .../content/aboutSessionRestore.js | 27 ++--- .../test/browser_aboutSessionRestore.js | 46 ++++++++ .../locales/en-US/chrome/browser/browser.dtd | 10 +- .../en-US/chrome/browser/browser.properties | 13 +-- ...cked-16.png => bad-content-blocked-16.png} | Bin ...cked-64.png => bad-content-blocked-64.png} | Bin browser/themes/linux/browser.css | 1 + browser/themes/linux/jar.mn | 4 +- ...cked-16.png => bad-content-blocked-16.png} | Bin .../themes/osx/bad-content-blocked-16@2x.png | Bin 0 -> 691 bytes ...cked-64.png => bad-content-blocked-64.png} | Bin .../themes/osx/bad-content-blocked-64@2x.png | Bin 0 -> 4788 bytes browser/themes/osx/browser.css | 1 + browser/themes/osx/jar.mn | 6 +- .../shared/badcontent-doorhanger.inc.css | 7 ++ ...cked-16.png => bad-content-blocked-16.png} | Bin ...cked-64.png => bad-content-blocked-64.png} | Bin browser/themes/windows/browser.css | 1 + browser/themes/windows/jar.mn | 4 +- dom/base/Makefile.in | 8 ++ dom/base/UseCounter.h | 27 +++++ dom/base/UseCounters.conf | 33 ++++++ dom/base/gen-usecounters.py | 79 +++++++++++++ dom/base/moz.build | 14 +++ dom/base/usecounters.py | 78 +++++++++++++ dom/ipc/ContentChild.cpp | 30 ++++- dom/ipc/ContentChild.h | 1 + dom/ipc/ContentParent.cpp | 46 +++++--- dom/ipc/ContentParent.h | 17 ++- dom/ipc/PContent.ipdl | 6 + dom/ipc/PPluginWidget.ipdl | 16 --- dom/ipc/TabChild.h | 3 +- dom/plugins/ipc/PluginWidgetChild.cpp | 51 ++------- dom/plugins/ipc/PluginWidgetChild.h | 2 - dom/plugins/ipc/PluginWidgetParent.cpp | 102 +++++------------ dom/plugins/ipc/PluginWidgetParent.h | 18 +-- dom/svg/nsSVGElement.cpp | 16 +-- js/src/jit/IonBuilder.cpp | 5 + toolkit/components/telemetry/Makefile.in | 10 +- .../telemetry/gen-histogram-bucket-ranges.py | 5 +- .../telemetry/gen-histogram-data.py | 4 +- .../telemetry/gen-histogram-enum.py | 59 ++++++++-- .../components/telemetry/histogram_tools.py | 65 ++++++++++- widget/PluginWidgetProxy.cpp | 4 + widget/crashtests/1128214.html | 19 ++++ widget/crashtests/crashtests.list | 1 + widget/windows/nsNativeThemeWin.cpp | 6 + widget/windows/nsWindowGfx.cpp | 16 +-- 55 files changed, 744 insertions(+), 332 deletions(-) create mode 100644 browser/components/sessionstore/test/browser_aboutSessionRestore.js rename browser/themes/linux/{mixed-content-blocked-16.png => bad-content-blocked-16.png} (100%) rename browser/themes/linux/{mixed-content-blocked-64.png => bad-content-blocked-64.png} (100%) rename browser/themes/osx/{mixed-content-blocked-16.png => bad-content-blocked-16.png} (100%) create mode 100644 browser/themes/osx/bad-content-blocked-16@2x.png rename browser/themes/osx/{mixed-content-blocked-64.png => bad-content-blocked-64.png} (100%) create mode 100644 browser/themes/osx/bad-content-blocked-64@2x.png create mode 100644 browser/themes/shared/badcontent-doorhanger.inc.css rename browser/themes/windows/{mixed-content-blocked-16.png => bad-content-blocked-16.png} (100%) rename browser/themes/windows/{mixed-content-blocked-64.png => bad-content-blocked-64.png} (100%) create mode 100644 dom/base/Makefile.in create mode 100644 dom/base/UseCounter.h create mode 100644 dom/base/UseCounters.conf create mode 100644 dom/base/gen-usecounters.py create mode 100644 dom/base/usecounters.py create mode 100644 widget/crashtests/1128214.html diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css index aa2641dc2d..32f9c77168 100644 --- a/browser/base/content/browser.css +++ b/browser/base/content/browser.css @@ -549,6 +549,10 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(#nav-bar):not( -moz-binding: url("chrome://browser/content/urlbarBindings.xml#addon-progress-notification"); } +#bad-content-notification { + -moz-binding: url("chrome://browser/content/urlbarBindings.xml#bad-content-notification"); +} + #click-to-play-plugins-notification { -moz-binding: url("chrome://browser/content/urlbarBindings.xml#click-to-play-plugins-notification"); } diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index f6f50e6f65..5c1ed5edb7 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -6472,43 +6472,26 @@ var gIdentityHandler = { // Ensure the doorhanger is shown when mixed active content is blocked. if (state & nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT) - this.showMixedContentDoorhanger(); + this.showBadContentDoorhanger(state); }, - /** - * Display the Mixed Content Blocker doohanger, providing an option - * to the user to override mixed content blocking - */ - showMixedContentDoorhanger : function() { + showBadContentDoorhanger : function(state) { + var currentNotification = + PopupNotifications.getNotification("bad-content", + gBrowser.selectedBrowser); + // If we've already got an active notification, bail out to avoid showing it repeatedly. - if (PopupNotifications.getNotification("mixed-content-blocked", gBrowser.selectedBrowser)) + if (currentNotification && currentNotification.options.state == state) return; - let brandBundle = document.getElementById("bundle_brand"); - let brandShortName = brandBundle.getString("brandShortName"); - let messageString = gNavigatorBundle.getFormattedString("mixedContentBlocked.message", [brandShortName]); - let action = { - label: gNavigatorBundle.getString("mixedContentBlocked.keepBlockingButton.label"), - accessKey: gNavigatorBundle.getString("mixedContentBlocked.keepBlockingButton.accesskey"), - callback: function() { /* NOP */ } - }; - let secondaryActions = [ - { - label: gNavigatorBundle.getString("mixedContentBlocked.unblock.label"), - accessKey: gNavigatorBundle.getString("mixedContentBlocked.unblock.accesskey"), - callback: function() { - // Reload the page with the content unblocked - BrowserReloadWithFlags(nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT); - } - } - ]; let options = { dismissed: true, - learnMoreURL: Services.urlFormatter.formatURLPref("browser.mixedcontent.warning.infoURL"), + state: state }; - PopupNotifications.show(gBrowser.selectedBrowser, "mixed-content-blocked", - messageString, "mixed-content-blocked-notification-icon", - action, secondaryActions, options); + + PopupNotifications.show(gBrowser.selectedBrowser, "bad-content", + "", "bad-content-blocked-notification-icon", + null, null, options); }, /** diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index f1a10c4ba4..20c626be29 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -441,7 +441,7 @@ - + diff --git a/browser/base/content/popup-notifications.inc b/browser/base/content/popup-notifications.inc index 04f4cb5b78..b6a8c55c2a 100644 --- a/browser/base/content/popup-notifications.inc +++ b/browser/base/content/popup-notifications.inc @@ -88,10 +88,3 @@