Mute audio immediately on tab closure (bug 1355242). r=florian

MozReview-Commit-ID: BO161kV2UWE

--HG--
extra : rebase_source : 9d74976581efdccb07845dee5b84e77d8b6b8b92
This commit is contained in:
Panos Astithas 2017-05-11 17:39:45 -04:00
Родитель eab3fbb07a
Коммит 571c7ea21b
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -2851,6 +2851,13 @@
newTab = true;
}
// Mute audio immediately to improve perceived speed of tab closure.
if (aTab.hasAttribute("soundplaying")) {
// Don't persist the muted state as this wasn't a user action.
// This lets undo-close-tab return it to an unmuted state.
aTab.linkedBrowser.mute(true);
}
aTab.closing = true;
this._removingTabs.push(aTab);
this._visibleTabs = null; // invalidate cache

Просмотреть файл

@ -757,9 +757,12 @@
readonly="true"/>
<method name="mute">
<parameter name="transientState"/>
<body>
<![CDATA[
if (!transientState) {
this._audioMuted = true;
}
this.messageManager.sendAsyncMessage("AudioPlayback",
{type: "mute"});
]]>