' +
diff --git a/devtools/client/jsonview/css/dark-theme.css b/devtools/client/jsonview/css/dark-theme.css
deleted file mode 100644
index c7ff256a8bf6..000000000000
--- a/devtools/client/jsonview/css/dark-theme.css
+++ /dev/null
@@ -1,27 +0,0 @@
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* 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/. */
-
-/******************************************************************************/
-/* Dark Theme (copied from themes/dark-theme.css) */
-
-:root {
- --theme-body-background: #14171a;
-
- --theme-tab-toolbar-background: #252c33;
- --theme-toolbar-background: #343c45;
- --theme-selection-background: #1d4f73;
- --theme-splitter-color: black;
- --theme-selection-color: #f5f7fa;
- --theme-comment: #757873;
-
- --theme-body-color: #8fa1b2;
- --theme-body-color-alt: #b6babf;
- --theme-content-color1: #a9bacb;
-
- --theme-highlight-green: #70bf53;
- --theme-highlight-blue: #46afe3;
- --theme-highlight-orange: #d96629;
- --theme-highlight-bluegrey: #5e88b0;
-}
diff --git a/devtools/client/jsonview/css/light-theme.css b/devtools/client/jsonview/css/light-theme.css
deleted file mode 100644
index bec77bba5ec2..000000000000
--- a/devtools/client/jsonview/css/light-theme.css
+++ /dev/null
@@ -1,27 +0,0 @@
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* 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/. */
-
-/******************************************************************************/
-/* Light Theme Constants (copied from themes/light-theme.css) */
-
-:root {
- --theme-body-background: #fcfcfc;
-
- --theme-tab-toolbar-background: #ebeced;
- --theme-toolbar-background: #f0f1f2;
- --theme-selection-background: #4c9ed9;
- --theme-splitter-color: #aaaaaa;
- --theme-selection-color: #f5f7fa;
- --theme-comment: #757873;
-
- --theme-body-color: #18191a;
- --theme-body-color-alt: #585959;
- --theme-content-color1: #292e33;
-
- --theme-highlight-green: #2cbb0f;
- --theme-highlight-blue: #0088cc;
- --theme-highlight-orange: #f13c00;
- --theme-highlight-bluegrey: #0072ab;
-}
diff --git a/devtools/client/jsonview/css/moz.build b/devtools/client/jsonview/css/moz.build
index 71d92ddc09c6..be368cb8bba6 100644
--- a/devtools/client/jsonview/css/moz.build
+++ b/devtools/client/jsonview/css/moz.build
@@ -6,12 +6,10 @@
DevToolsModules(
- 'dark-theme.css',
'dom-tree.css',
'general.css',
'headers-panel.css',
'json-panel.css',
- 'light-theme.css',
'main.css',
'read-only-prop.svg',
'reps.css',
diff --git a/devtools/client/moz.build b/devtools/client/moz.build
index bd19108af85d..13d887830efb 100644
--- a/devtools/client/moz.build
+++ b/devtools/client/moz.build
@@ -35,6 +35,7 @@ DIRS += [
'storage',
'styleeditor',
'styleinspector',
+ 'themes',
'tilt',
'webaudioeditor',
'webconsole',
diff --git a/devtools/client/performance/views/details-waterfall.js b/devtools/client/performance/views/details-waterfall.js
index 6ff0d6f94eca..b84a9d68ee9e 100644
--- a/devtools/client/performance/views/details-waterfall.js
+++ b/devtools/client/performance/views/details-waterfall.js
@@ -130,7 +130,7 @@ var WaterfallView = Heritage.extend(DetailsSubview, {
* Called when MarkerDetails view emits an event to view source.
*/
_onViewSource: function (_, data) {
- gToolbox.viewSourceInDebugger(data.file, data.line);
+ gToolbox.viewSourceInDebugger(data.url, data.line);
},
/**
diff --git a/devtools/client/themes/computedview.css b/devtools/client/themes/computedview.css
index 4b27724e735f..ad47fa215335 100644
--- a/devtools/client/themes/computedview.css
+++ b/devtools/client/themes/computedview.css
@@ -20,6 +20,12 @@ body {
height: 100%;
}
+#browser-style-checkbox {
+ /* Bug 1200073 - extra space before the browser styles checkbox so
+ they aren't squished together in a small window. */
+ -moz-margin-start: 5px;
+}
+
#propertyContainer {
-moz-user-select: text;
overflow: auto;
diff --git a/devtools/client/themes/moz.build b/devtools/client/themes/moz.build
new file mode 100644
index 000000000000..8f68044b02d9
--- /dev/null
+++ b/devtools/client/themes/moz.build
@@ -0,0 +1,9 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+DevToolsModules(
+ 'variables.css',
+)
diff --git a/devtools/shared/DevToolsUtils.js b/devtools/shared/DevToolsUtils.js
index 6453855ce5ae..a5b187d206a0 100644
--- a/devtools/shared/DevToolsUtils.js
+++ b/devtools/shared/DevToolsUtils.js
@@ -441,7 +441,18 @@ exports.defineLazyGetter = function defineLazyGetter(aObject, aName, aLambda) {
};
// DEPRECATED: use DevToolsUtils.assert(condition, message) instead!
+let haveLoggedDeprecationMessage = false;
exports.dbg_assert = function dbg_assert(cond, e) {
+ if (!haveLoggedDeprecationMessage) {
+ haveLoggedDeprecationMessage = true;
+ const deprecationMessage = "DevToolsUtils.dbg_assert is deprecated! Use DevToolsUtils.assert instead!\n"
+ + Error().stack;
+ dump(deprecationMessage);
+ if (typeof console === "object" && console && console.warn) {
+ console.warn(deprecationMessage);
+ }
+ }
+
if (!cond) {
return e;
}
diff --git a/devtools/shared/gcli/commands/security.js b/devtools/shared/gcli/commands/security.js
index b6c4492877c2..dd3f4060b740 100644
--- a/devtools/shared/gcli/commands/security.js
+++ b/devtools/shared/gcli/commands/security.js
@@ -41,7 +41,7 @@ const CONTENT_SECURITY_POLICY_REPORT_ONLY_MSG = l10n.lookup("securityCSPROHeader
const NEXT_URI_HEADER = l10n.lookup("securityReferrerNextURI");
const CALCULATED_REFERRER_HEADER = l10n.lookup("securityReferrerCalculatedReferrer");
/* The official names from the W3C Referrer Policy Draft http://www.w3.org/TR/referrer-policy/ */
-const REFERRER_POLICY_NAMES = [ "None When Downgrade", "None", "Origin Only", "Origin When Cross-Origin", "Unsafe URL" ];
+const REFERRER_POLICY_NAMES = [ "None When Downgrade (default)", "None", "Origin Only", "Origin When Cross-Origin", "Unsafe URL" ];
exports.items = [
{
@@ -201,35 +201,54 @@ exports.items = [
var sameDomainReferrer = "";
var otherDomainReferrer = "";
var downgradeReferrer = "";
+ var otherDowngradeReferrer = "";
var origin = pageURI.prePath;
switch (referrerPolicy) {
case Ci.nsIHttpChannel.REFERRER_POLICY_NO_REFERRER:
// sends no referrer
- sameDomainReferrer = otherDomainReferrer = downgradeReferrer = "(no referrer)";
+ sameDomainReferrer
+ = otherDomainReferrer
+ = downgradeReferrer
+ = otherDowngradeReferrer
+ = "(no referrer)";
break;
case Ci.nsIHttpChannel.REFERRER_POLICY_ORIGIN:
// only sends the origin of the referring URL
- sameDomainReferrer = otherDomainReferrer = downgradeReferrer = origin;
+ sameDomainReferrer
+ = otherDomainReferrer
+ = downgradeReferrer
+ = otherDowngradeReferrer
+ = origin;
break;
case Ci.nsIHttpChannel.REFERRER_POLICY_ORIGIN_WHEN_XORIGIN:
// same as default, but reduced to ORIGIN when cross-origin.
sameDomainReferrer = pageURI.spec;
- otherDomainReferrer = origin;
- downgradeReferrer = "(no referrer)";
+ otherDomainReferrer
+ = downgradeReferrer
+ = otherDowngradeReferrer
+ = origin;
break;
case Ci.nsIHttpChannel.REFERRER_POLICY_UNSAFE_URL:
// always sends the referrer, even on downgrade.
- sameDomainReferrer = otherDomainReferrer = downgradeReferrer = pageURI.spec;
+ sameDomainReferrer
+ = otherDomainReferrer
+ = downgradeReferrer
+ = otherDowngradeReferrer
+ = pageURI.spec;
break;
case Ci.nsIHttpChannel.REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE:
// default state, doesn't send referrer from https->http
sameDomainReferrer = otherDomainReferrer = pageURI.spec;
- downgradeReferrer = "(no referrer)";
+ downgradeReferrer = otherDowngradeReferrer = "(no referrer)";
break;
default:
// this is a new referrer policy which we do not know about
- sameDomainReferrer = otherDomainReferrer = downgradeReferrer = "(unknown Referrer Policy)";
+ sameDomainReferrer
+ = otherDomainReferrer
+ = downgradeReferrer
+ = otherDowngradeReferrer
+ = "(unknown Referrer Policy)";
break;
}
@@ -237,17 +256,39 @@ exports.items = [
var referrerUrls = [
// add the referrer uri 'referrer' we would send when visiting 'uri'
- {uri: 'http://example.com/', referrer: otherDomainReferrer},
- {uri: sameDomainUri, referrer: sameDomainReferrer}
+ {
+ uri: pageURI.scheme+'://example.com/',
+ referrer: otherDomainReferrer,
+ description: l10n.lookup('securityReferrerPolicyOtherDomain')},
+ {
+ uri: sameDomainUri,
+ referrer: sameDomainReferrer,
+ description: l10n.lookup('securityReferrerPolicySameDomain')}
];
if (pageURI.schemeIs('https')) {
// add the referrer we would send on downgrading http->https
- referrerUrls.push({uri: "http://"+pageURI.hostPort+"/*", referrer: downgradeReferrer});
+ if (sameDomainReferrer != downgradeReferrer) {
+ referrerUrls.push({
+ uri: "http://"+pageURI.hostPort+"/*",
+ referrer: downgradeReferrer,
+ description:
+ l10n.lookup('securityReferrerPolicySameDomainDowngrade')
+ });
+ }
+ if (otherDomainReferrer != otherDowngradeReferrer) {
+ referrerUrls.push({
+ uri: "http://example.com/",
+ referrer: otherDowngradeReferrer,
+ description:
+ l10n.lookup('securityReferrerPolicyOtherDomainDowngrade')
+ });
+ }
}
return {
- header: l10n.lookupFormat("securityReferrerPolicyReportHeader", [pageURI.spec]),
+ header: l10n.lookupFormat("securityReferrerPolicyReportHeader",
+ [pageURI.spec]),
policyName: REFERRER_POLICY_NAMES[referrerPolicy],
urls: referrerUrls
}
@@ -264,10 +305,13 @@ exports.items = [
" ${rpi.header} " +
" ${rpi.policyName} " +
"
" +
- "
" + NEXT_URI_HEADER + "
" + CALCULATED_REFERRER_HEADER + "
" +
+ "
" +
+ "
" + NEXT_URI_HEADER + "
" +
+ "
" + CALCULATED_REFERRER_HEADER + "
" +
+ "
" +
// iterate all policies
"
" +
- "
${nextURI.uri}
" +
+ "
${nextURI.description} (e.g., ${nextURI.uri})
" +
"
${nextURI.referrer}
" +
"
" +
"
" +
diff --git a/dom/events/KeyNameList.h b/dom/events/KeyNameList.h
index 4e024b35b6a4..45ef0b41c1da 100644
--- a/dom/events/KeyNameList.h
+++ b/dom/events/KeyNameList.h
@@ -31,6 +31,9 @@ DEFINE_KEYNAME_WITH_SAME_NAME(Unidentified)
DEFINE_KEYNAME_INTERNAL(PrintableKey, "MozPrintableKey")
DEFINE_KEYNAME_INTERNAL(HomeScreen, "MozHomeScreen")
DEFINE_KEYNAME_INTERNAL(CameraFocusAdjust, "MozCameraFocusAdjust")
+DEFINE_KEYNAME_INTERNAL(PhoneCall, "MozPhoneCall")
+DEFINE_KEYNAME_INTERNAL(SoftLeft, "MozSoftLeft")
+DEFINE_KEYNAME_INTERNAL(SoftRight, "MozSoftRight")
/******************************************************************************
* Modifier Keys
diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp
index a6afdb8be80e..349d795fbc72 100644
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -510,16 +510,8 @@ private:
content->GetIPCChannel()->Unblock();
}
- nsTArray actors;
- content->GetOpenedActors(actors);
- for (size_t j = 0; j < actors.Length(); j++) {
- IToplevelProtocol* actor = actors[j];
- if (aBlock) {
- actor->GetIPCChannel()->Block();
- } else {
- actor->GetIPCChannel()->Unblock();
- }
- }
+ // Other IPC channels do not perform the checks through Block() and
+ // Unblock().
}
};
#endif
diff --git a/dom/ipc/tests/mochitest.ini b/dom/ipc/tests/mochitest.ini
index 185334689d64..177b37df22dc 100644
--- a/dom/ipc/tests/mochitest.ini
+++ b/dom/ipc/tests/mochitest.ini
@@ -16,7 +16,7 @@ skip-if = buildapp == 'b2g' || buildapp == 'mulet'
[test_NuwaProcessCreation.html]
skip-if = toolkit != 'gonk'
[test_NuwaProcessDeadlock.html]
-skip-if = true # bug 1166923
+skip-if = toolkit != 'gonk'
[test_child_docshell.html]
skip-if = toolkit == 'cocoa' # disabled due to hangs, see changeset 6852e7c47edf
[test_CrashService_crash.html]
diff --git a/dom/ipc/tests/test_NuwaProcessDeadlock.html b/dom/ipc/tests/test_NuwaProcessDeadlock.html
index 1029aa1aa9b8..150707f5b3b5 100644
--- a/dom/ipc/tests/test_NuwaProcessDeadlock.html
+++ b/dom/ipc/tests/test_NuwaProcessDeadlock.html
@@ -14,6 +14,9 @@ Test if Nuwa process created successfully.
function runTest()
{
+ info("Shut down processes by disabling process prelaunch");
+ SpecialPowers.setBoolPref('dom.ipc.processPrelaunch.enabled', false);
+
info("Launch the Nuwa process");
let cpmm = SpecialPowers.Cc["@mozilla.org/childprocessmessagemanager;1"]
.getService(SpecialPowers.Ci.nsISyncMessageSender);
@@ -22,12 +25,11 @@ function runTest()
receiveMessage: function receiveMessage(msg) {
msg = SpecialPowers.wrap(msg);
if (msg.name == 'TEST-ONLY:nuwa-ready') {
- ok(true, "Got nuwa-ready");
- is(seenNuwaReady, false, "Already received nuwa ready");
+ is(seenNuwaReady, false, "The Nuwa process is launched");
seenNuwaReady = true;
} else if (msg.name == 'TEST-ONLY:nuwa-add-new-process') {
ok(true, "Got nuwa-add-new-process");
- is(seenNuwaReady, true, "Receive nuwa-add-new-process before nuwa-ready");
+ is(seenNuwaReady, true, "The preallocated process is launched from the Nuwa process");
shutdown();
}
}
@@ -51,12 +53,11 @@ function runTest()
function setup()
{
- info("Set up preferences for testing deadlock in the Nuwa process.");
+ info("Set up preferences for testing the Nuwa process.");
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({
'set': [
- ['dom.ipc.processPrelaunch.enabled', false],
['dom.ipc.preallocatedProcessManager.testMode', true],
['dom.ipc.processPrelaunch.testMode', true] // For testing deadlock
]
diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp
index f3bb1997e1d1..683b01601613 100644
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -1563,6 +1563,38 @@ MediaManager::Get() {
prefs->AddObserver("media.navigator.video.default_fps", sSingleton, false);
prefs->AddObserver("media.navigator.video.default_minfps", sSingleton, false);
}
+
+ // Prepare async shutdown
+
+ nsCOMPtr profileBeforeChange;
+ {
+ nsCOMPtr svc = services::GetAsyncShutdown();
+ MOZ_RELEASE_ASSERT(svc);
+ nsresult rv = svc->GetProfileBeforeChange(getter_AddRefs(profileBeforeChange));
+ MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
+ }
+
+ class Blocker : public media::ShutdownBlocker
+ {
+ public:
+ Blocker()
+ : media::ShutdownBlocker(NS_LITERAL_STRING(
+ "Media shutdown: blocking on media thread")) {}
+
+ NS_IMETHOD BlockShutdown(nsIAsyncShutdownClient* aProfileBeforeChange) override
+ {
+ MOZ_RELEASE_ASSERT(MediaManager::GetIfExists());
+ MediaManager::GetIfExists()->Shutdown();
+ return NS_OK;
+ }
+ };
+
+ sSingleton->mShutdownBlocker = new Blocker();
+ nsresult rv = profileBeforeChange->AddBlocker(sSingleton->mShutdownBlocker,
+ NS_LITERAL_STRING(__FILE__),
+ __LINE__,
+ NS_LITERAL_STRING("Media shutdown"));
+ MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
#ifdef MOZ_B2G
// Init MediaPermissionManager before sending out any permission requests.
(void) MediaPermissionManager::GetInstance();
@@ -2533,12 +2565,119 @@ MediaManager::GetPrefs(nsIPrefBranch *aBranch, const char *aData)
GetPref(aBranch, "media.navigator.audio.fake_frequency", aData, &mPrefs.mFreq);
}
+void
+MediaManager::Shutdown()
+{
+ MOZ_ASSERT(NS_IsMainThread());
+ if (sInShutdown) {
+ return;
+ }
+ sInShutdown = true;
+
+ nsCOMPtr obs = services::GetObserverService();
+
+ obs->RemoveObserver(this, "xpcom-will-shutdown");
+ obs->RemoveObserver(this, "last-pb-context-exited");
+ obs->RemoveObserver(this, "getUserMedia:privileged:allow");
+ obs->RemoveObserver(this, "getUserMedia:response:allow");
+ obs->RemoveObserver(this, "getUserMedia:response:deny");
+ obs->RemoveObserver(this, "getUserMedia:revoke");
+
+ nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
+ if (prefs) {
+ prefs->RemoveObserver("media.navigator.video.default_width", this);
+ prefs->RemoveObserver("media.navigator.video.default_height", this);
+ prefs->RemoveObserver("media.navigator.video.default_fps", this);
+ prefs->RemoveObserver("media.navigator.video.default_minfps", this);
+ prefs->RemoveObserver("media.navigator.audio.fake_frequency", this);
+ }
+
+ // Close off any remaining active windows.
+ GetActiveWindows()->Clear();
+ mActiveCallbacks.Clear();
+ mCallIds.Clear();
+ {
+ MutexAutoLock lock(mMutex);
+ if (mBackend) {
+ mBackend->Shutdown(); // ok to invoke multiple times
+ }
+ }
+
+ // Because mMediaThread is not an nsThread, we must dispatch to it so it can
+ // clean up BackgroundChild. Continue stopping thread once this is done.
+
+ class ShutdownTask : public Task
+ {
+ public:
+ ShutdownTask(already_AddRefed aBackend,
+ nsRunnable* aReply)
+ : mReply(aReply)
+ , mBackend(aBackend) {}
+ private:
+ virtual void
+ Run()
+ {
+ LOG(("MediaManager Thread Shutdown"));
+ MOZ_ASSERT(MediaManager::IsInMediaThread());
+ mozilla::ipc::BackgroundChild::CloseForCurrentThread();
+ // must explicitly do this before dispatching the reply, since the reply may kill us with Stop()
+ mBackend = nullptr; // last reference, will invoke Shutdown() again
+
+ if (NS_FAILED(NS_DispatchToMainThread(mReply.forget()))) {
+ LOG(("Will leak thread: DispatchToMainthread of reply runnable failed in MediaManager shutdown"));
+ }
+ }
+ RefPtr mReply;
+ RefPtr mBackend;
+ };
+
+ // Post ShutdownTask to execute on mMediaThread and pass in a lambda
+ // callback to be executed back on this thread once it is done.
+ //
+ // The lambda callback "captures" the 'this' pointer for member access.
+ // This is safe since this is guaranteed to be here since sSingleton isn't
+ // cleared until the lambda function clears it.
+
+ // note that this == sSingleton
+ RefPtr that(sSingleton);
+ // Release the backend (and call Shutdown()) from within the MediaManager thread
+ RefPtr temp;
+ {
+ MutexAutoLock lock(mMutex);
+ temp = mBackend.forget();
+ }
+ // Don't use MediaManager::PostTask() because we're sInShutdown=true here!
+ mMediaThread->message_loop()->PostTask(FROM_HERE, new ShutdownTask(
+ temp.forget(),
+ media::NewRunnableFrom([this, that]() mutable {
+ LOG(("MediaManager shutdown lambda running, releasing MediaManager singleton and thread"));
+ if (mMediaThread) {
+ mMediaThread->Stop();
+ }
+
+ // Remove async shutdown blocker
+
+ nsCOMPtr profileBeforeChange;
+ {
+ nsCOMPtr svc = services::GetAsyncShutdown();
+ MOZ_RELEASE_ASSERT(svc);
+ nsresult rv = svc->GetProfileBeforeChange(getter_AddRefs(profileBeforeChange));
+ MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
+ }
+ profileBeforeChange->RemoveBlocker(sSingleton->mShutdownBlocker);
+
+ // we hold a ref to 'that' which is the same as sSingleton
+ sSingleton = nullptr;
+
+ return NS_OK;
+ })));
+}
+
nsresult
MediaManager::Observe(nsISupports* aSubject, const char* aTopic,
const char16_t* aData)
{
MOZ_ASSERT(NS_IsMainThread());
- nsCOMPtr obs = services::GetObserverService();
if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
nsCOMPtr branch( do_QueryInterface(aSubject) );
@@ -2548,93 +2687,8 @@ MediaManager::Observe(nsISupports* aSubject, const char* aTopic,
mPrefs.mWidth, mPrefs.mHeight, mPrefs.mFPS, mPrefs.mMinFPS));
}
} else if (!strcmp(aTopic, "xpcom-will-shutdown")) {
- sInShutdown = true;
-
- obs->RemoveObserver(this, "xpcom-will-shutdown");
- obs->RemoveObserver(this, "last-pb-context-exited");
- obs->RemoveObserver(this, "getUserMedia:privileged:allow");
- obs->RemoveObserver(this, "getUserMedia:response:allow");
- obs->RemoveObserver(this, "getUserMedia:response:deny");
- obs->RemoveObserver(this, "getUserMedia:revoke");
-
- nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
- if (prefs) {
- prefs->RemoveObserver("media.navigator.video.default_width", this);
- prefs->RemoveObserver("media.navigator.video.default_height", this);
- prefs->RemoveObserver("media.navigator.video.default_fps", this);
- prefs->RemoveObserver("media.navigator.video.default_minfps", this);
- prefs->RemoveObserver("media.navigator.audio.fake_frequency", this);
- }
-
- // Close off any remaining active windows.
- GetActiveWindows()->Clear();
- mActiveCallbacks.Clear();
- mCallIds.Clear();
- {
- MutexAutoLock lock(mMutex);
- if (mBackend) {
- mBackend->Shutdown(); // ok to invoke multiple times
- }
- }
-
- // Because mMediaThread is not an nsThread, we must dispatch to it so it can
- // clean up BackgroundChild. Continue stopping thread once this is done.
-
- class ShutdownTask : public Task
- {
- public:
- ShutdownTask(already_AddRefed aBackend,
- nsRunnable* aReply)
- : mReply(aReply)
- , mBackend(aBackend) {}
- private:
- virtual void
- Run()
- {
- LOG(("MediaManager Thread Shutdown"));
- MOZ_ASSERT(MediaManager::IsInMediaThread());
- mozilla::ipc::BackgroundChild::CloseForCurrentThread();
- // must explicitly do this before dispatching the reply, since the reply may kill us with Stop()
- mBackend = nullptr; // last reference, will invoke Shutdown() again
-
- if (NS_FAILED(NS_DispatchToMainThread(mReply.forget()))) {
- LOG(("Will leak thread: DispatchToMainthread of reply runnable failed in MediaManager shutdown"));
- }
- }
- RefPtr mReply;
- RefPtr mBackend;
- };
-
- // Post ShutdownTask to execute on mMediaThread and pass in a lambda
- // callback to be executed back on this thread once it is done.
- //
- // The lambda callback "captures" the 'this' pointer for member access.
- // This is safe since this is guaranteed to be here since sSingleton isn't
- // cleared until the lambda function clears it.
-
- // note that this == sSingleton
- RefPtr that(sSingleton);
- // Release the backend (and call Shutdown()) from within the MediaManager thread
- RefPtr temp;
- {
- MutexAutoLock lock(mMutex);
- temp = mBackend.forget();
- }
- // Don't use MediaManager::PostTask() because we're sInShutdown=true here!
- mMediaThread->message_loop()->PostTask(FROM_HERE, new ShutdownTask(
- temp.forget(),
- media::NewRunnableFrom([this, that]() mutable {
- LOG(("MediaManager shutdown lambda running, releasing MediaManager singleton and thread"));
- if (mMediaThread) {
- mMediaThread->Stop();
- }
- // we hold a ref to 'that' which is the same as sSingleton
- sSingleton = nullptr;
-
- return NS_OK;
- })));
+ Shutdown();
return NS_OK;
-
} else if (!strcmp(aTopic, "last-pb-context-exited")) {
// Clear memory of private-browsing-specific deviceIds. Fire and forget.
media::SanitizeOriginKeys(0, true);
diff --git a/dom/media/MediaManager.h b/dom/media/MediaManager.h
index e9c9cb2de016..2244643779c1 100644
--- a/dom/media/MediaManager.h
+++ b/dom/media/MediaManager.h
@@ -515,6 +515,7 @@ private:
MediaManager();
~MediaManager() {}
+ void Shutdown();
void StopScreensharing(uint64_t aWindowID);
void IterateWindowListeners(nsPIDOMWindow *aWindow,
@@ -530,6 +531,7 @@ private:
// Always exists
nsAutoPtr mMediaThread;
+ nsCOMPtr mShutdownBlocker;
Mutex mMutex;
// protected with mMutex:
diff --git a/dom/media/systemservices/MediaUtils.cpp b/dom/media/systemservices/MediaUtils.cpp
index 7d3bd577bb95..a77e3404abe2 100644
--- a/dom/media/systemservices/MediaUtils.cpp
+++ b/dom/media/systemservices/MediaUtils.cpp
@@ -9,5 +9,7 @@
namespace mozilla {
namespace media {
+NS_IMPL_ISUPPORTS(ShutdownBlocker, nsIAsyncShutdownBlocker)
+
} // namespace media
} // namespace mozilla
diff --git a/dom/media/systemservices/MediaUtils.h b/dom/media/systemservices/MediaUtils.h
index dd6cbfc5347b..d50472ffd6c0 100644
--- a/dom/media/systemservices/MediaUtils.h
+++ b/dom/media/systemservices/MediaUtils.h
@@ -9,6 +9,7 @@
#include "nsAutoPtr.h"
#include "nsThreadUtils.h"
+#include "nsIAsyncShutdown.h"
namespace mozilla {
namespace media {
@@ -357,6 +358,35 @@ private:
~Refcountable>() {}
};
+/* media::ShutdownBlocker - Async shutdown helper.
+ */
+
+class ShutdownBlocker : public nsIAsyncShutdownBlocker
+{
+public:
+ ShutdownBlocker(const nsString& aName) : mName(aName) {}
+
+ NS_IMETHOD
+ BlockShutdown(nsIAsyncShutdownClient* aProfileBeforeChange) override = 0;
+
+ NS_IMETHOD GetName(nsAString& aName) override
+ {
+ aName = mName;
+ return NS_OK;
+ }
+
+ NS_IMETHOD GetState(nsIPropertyBag**) override
+ {
+ return NS_OK;
+ }
+
+ NS_DECL_ISUPPORTS
+protected:
+ virtual ~ShutdownBlocker() {}
+private:
+ const nsString mName;
+};
+
} // namespace media
} // namespace mozilla
diff --git a/gfx/layers/ipc/CompositorParent.cpp b/gfx/layers/ipc/CompositorParent.cpp
index 76baad7f4e0a..615b309d29eb 100644
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -1884,27 +1884,6 @@ CompositorParent::Create(Transport* aTransport, ProcessId aOtherPid)
return cpcp.get();
}
-IToplevelProtocol*
-CompositorParent::CloneToplevel(const InfallibleTArray& aFds,
- base::ProcessHandle aPeerProcess,
- mozilla::ipc::ProtocolCloneContext* aCtx)
-{
- for (unsigned int i = 0; i < aFds.Length(); i++) {
- if (aFds[i].protocolId() == (unsigned)GetProtocolId()) {
- Transport* transport = OpenDescriptor(aFds[i].fd(),
- Transport::MODE_SERVER);
- PCompositorParent* compositor = Create(transport, base::GetProcId(aPeerProcess));
- compositor->CloneManagees(this, aCtx);
- compositor->IToplevelProtocol::SetTransport(transport);
- // The reference to the compositor thread is held in OnChannelConnected().
- // We need to do this for cloned actors, too.
- compositor->OnChannelConnected(base::GetProcId(aPeerProcess));
- return compositor;
- }
- }
- return nullptr;
-}
-
static void
UpdateIndirectTree(uint64_t aId, Layer* aRoot, const TargetConfig& aTargetConfig)
{
@@ -2335,6 +2314,9 @@ CrossProcessCompositorParent::CloneToplevel(const InfallibleTArrayCloneManagees(this, aCtx);
compositor->IToplevelProtocol::SetTransport(transport);
+ // The reference to the compositor thread is held in OnChannelConnected().
+ // We need to do this for cloned actors, too.
+ compositor->OnChannelConnected(base::GetProcId(aPeerProcess));
return compositor;
}
}
diff --git a/gfx/layers/ipc/CompositorParent.h b/gfx/layers/ipc/CompositorParent.h
index b2596feba482..00f3579453ec 100644
--- a/gfx/layers/ipc/CompositorParent.h
+++ b/gfx/layers/ipc/CompositorParent.h
@@ -193,12 +193,6 @@ public:
bool aUseExternalSurfaceSize = false,
int aSurfaceWidth = -1, int aSurfaceHeight = -1);
- // IToplevelProtocol::CloneToplevel()
- virtual IToplevelProtocol*
- CloneToplevel(const InfallibleTArray& aFds,
- base::ProcessHandle aPeerProcess,
- mozilla::ipc::ProtocolCloneContext* aCtx) override;
-
virtual bool RecvGetFrameUniformity(FrameUniformityData* aOutData) override;
virtual bool RecvRequestOverfill() override;
virtual bool RecvWillStop() override;
diff --git a/ipc/glue/MessageChannel.h b/ipc/glue/MessageChannel.h
index 64e2a5734359..41143c0594d8 100644
--- a/ipc/glue/MessageChannel.h
+++ b/ipc/glue/MessageChannel.h
@@ -177,10 +177,12 @@ class MessageChannel : HasResultCodes
#ifdef MOZ_NUWA_PROCESS
void Block() {
+ MOZ_ASSERT(mLink);
mLink->Block();
}
void Unblock() {
+ MOZ_ASSERT(mLink);
mLink->Unblock();
}
#endif
diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java
index 53a1baf33f22..85e695bd9f81 100644
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1289,15 +1289,6 @@ public class BrowserApp extends GeckoApp
return true;
}
- if (itemId == R.id.site_settings) {
- // This can be selected from either the browser menu or the contextmenu, depending on the size and version (v11+) of the phone.
- GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Permissions:Get", null));
- if (Versions.preHC) {
- Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.CONTEXT_MENU, "site_settings");
- }
- return true;
- }
-
if (itemId == R.id.paste) {
String text = Clipboard.getText();
if (!TextUtils.isEmpty(text)) {
@@ -3174,7 +3165,6 @@ public class BrowserApp extends GeckoApp
}
MenuUtils.safeSetEnabled(aMenu, R.id.subscribe, false);
MenuUtils.safeSetEnabled(aMenu, R.id.add_search_engine, false);
- MenuUtils.safeSetEnabled(aMenu, R.id.site_settings, false);
MenuUtils.safeSetEnabled(aMenu, R.id.add_to_launcher, false);
return true;
@@ -3260,7 +3250,6 @@ public class BrowserApp extends GeckoApp
}
MenuUtils.safeSetEnabled(aMenu, R.id.subscribe, tab.hasFeeds());
MenuUtils.safeSetEnabled(aMenu, R.id.add_search_engine, tab.hasOpenSearch());
- MenuUtils.safeSetEnabled(aMenu, R.id.site_settings, !isAboutHome(tab));
MenuUtils.safeSetEnabled(aMenu, R.id.add_to_launcher, !isAboutHome(tab));
// Action providers are available only ICS+.
diff --git a/mobile/android/base/resources/layout-large-v11/tab_strip_item_view.xml b/mobile/android/base/resources/layout-large-v11/tab_strip_item_view.xml
index 2f56b7702f5e..9d330c0713f0 100644
--- a/mobile/android/base/resources/layout-large-v11/tab_strip_item_view.xml
+++ b/mobile/android/base/resources/layout-large-v11/tab_strip_item_view.xml
@@ -6,7 +6,7 @@
-
-
-
diff --git a/mobile/android/base/resources/menu-v11/browser_app_menu.xml b/mobile/android/base/resources/menu-v11/browser_app_menu.xml
index 7ff125e449c9..bd928f5daa06 100644
--- a/mobile/android/base/resources/menu-v11/browser_app_menu.xml
+++ b/mobile/android/base/resources/menu-v11/browser_app_menu.xml
@@ -74,9 +74,6 @@
-
-
diff --git a/mobile/android/base/resources/menu-xlarge-v11/browser_app_menu.xml b/mobile/android/base/resources/menu-xlarge-v11/browser_app_menu.xml
index b26e116f10dd..93ef8a0b9982 100644
--- a/mobile/android/base/resources/menu-xlarge-v11/browser_app_menu.xml
+++ b/mobile/android/base/resources/menu-xlarge-v11/browser_app_menu.xml
@@ -75,9 +75,6 @@
-
-
diff --git a/mobile/android/base/resources/menu/titlebar_contextmenu.xml b/mobile/android/base/resources/menu/titlebar_contextmenu.xml
index db6a5012ffb1..72c41cdc5bcb 100644
--- a/mobile/android/base/resources/menu/titlebar_contextmenu.xml
+++ b/mobile/android/base/resources/menu/titlebar_contextmenu.xml
@@ -20,9 +20,6 @@
-
-
diff --git a/mobile/android/tests/browser/robocop/StringHelper.java b/mobile/android/tests/browser/robocop/StringHelper.java
index a320aaa43c34..96f1a4a0a717 100644
--- a/mobile/android/tests/browser/robocop/StringHelper.java
+++ b/mobile/android/tests/browser/robocop/StringHelper.java
@@ -16,6 +16,8 @@ public class StringHelper {
public static String STATIC_ABOUT_HOME_URL = "about:home";
public final String OK;
+ public final String CANCEL;
+ public final String CLEAR;
// Note: DEFAULT_BOOKMARKS_TITLES.length == DEFAULT_BOOKMARKS_URLS.length
public final String[] DEFAULT_BOOKMARKS_TITLES;
@@ -295,6 +297,8 @@ public class StringHelper {
private StringHelper(final Resources res) {
OK = res.getString(R.string.button_ok);
+ CANCEL = res.getString(R.string.button_cancel);
+ CLEAR = res.getString(R.string.button_clear);
// Note: DEFAULT_BOOKMARKS_TITLES.length == DEFAULT_BOOKMARKS_URLS.length
DEFAULT_BOOKMARKS_TITLES = new String[] {
diff --git a/mobile/android/tests/browser/robocop/components/ToolbarComponent.java b/mobile/android/tests/browser/robocop/components/ToolbarComponent.java
index dffe490e49d1..031538f901ef 100644
--- a/mobile/android/tests/browser/robocop/components/ToolbarComponent.java
+++ b/mobile/android/tests/browser/robocop/components/ToolbarComponent.java
@@ -10,7 +10,6 @@ import static org.mozilla.gecko.tests.helpers.AssertionHelper.fAssertNotNull;
import static org.mozilla.gecko.tests.helpers.AssertionHelper.fAssertTrue;
import org.mozilla.gecko.R;
-import org.mozilla.gecko.tests.StringHelper;
import org.mozilla.gecko.tests.UITestContext;
import org.mozilla.gecko.tests.helpers.DeviceHelper;
import org.mozilla.gecko.tests.helpers.NavigationHelper;
diff --git a/mobile/android/tests/browser/robocop/testClearPrivateData.java b/mobile/android/tests/browser/robocop/testClearPrivateData.java
index 39c9bcae57b0..e98544fd9db0 100644
--- a/mobile/android/tests/browser/robocop/testClearPrivateData.java
+++ b/mobile/android/tests/browser/robocop/testClearPrivateData.java
@@ -8,6 +8,7 @@ import org.mozilla.gecko.R;
import com.jayway.android.robotium.solo.Condition;
import android.view.View;
+import android.widget.ImageButton;
/**
* This patch tests the clear private data options:
@@ -63,14 +64,12 @@ public class testClearPrivateData extends PixelTest {
}
public void clearSiteSettings() {
- String shareStrings[] = {"Share your location with", "Share", "Don't share", "There are no settings to clear"};
String titleGeolocation = mStringHelper.ROBOCOP_GEOLOCATION_TITLE;
String url = getAbsoluteUrl(mStringHelper.ROBOCOP_GEOLOCATION_URL);
- loadCheckDismiss(shareStrings[1], url, shareStrings[0]);
- checkOption(shareStrings[1], "Clear");
- checkOption(shareStrings[3], "Cancel");
- loadCheckDismiss(shareStrings[2], url, shareStrings[0]);
- checkOption(shareStrings[2], "Cancel");
+ loadCheckDismiss(mStringHelper.GEO_ALLOW, url, mStringHelper.GEO_MESSAGE);
+ checkOption(mStringHelper.GEO_ALLOW, mStringHelper.CLEAR);
+ loadCheckDismiss(mStringHelper.GEO_DENY, url, mStringHelper.GEO_MESSAGE);
+ checkOption(mStringHelper.GEO_DENY, mStringHelper.CANCEL);
checkDevice(titleGeolocation, url);
}
@@ -80,7 +79,7 @@ public class testClearPrivateData extends PixelTest {
String loginUrl = getAbsoluteUrl(mStringHelper.ROBOCOP_LOGIN_01_URL);
loadCheckDismiss(passwordStrings[1], loginUrl, passwordStrings[0]);
- checkOption(mStringHelper.CONTEXT_MENU_SITE_SETTINGS_SAVE_PASSWORD, "Clear");
+ checkOption(mStringHelper.CONTEXT_MENU_SITE_SETTINGS_SAVE_PASSWORD, mStringHelper.CLEAR);
loadCheckDismiss(passwordStrings[2], loginUrl, passwordStrings[0]);
checkDevice(title, getAbsoluteUrl(mStringHelper.ROBOCOP_BLANK_PAGE_01_URL));
}
@@ -114,12 +113,23 @@ public class testClearPrivateData extends PixelTest {
mAsserter.ok(waitForText(mStringHelper.CONTEXT_MENU_ITEMS_IN_URL_BAR[2]), "Waiting for the pop-up to open", "Pop up was opened");
} else {
// Use the Page menu in 11+
- selectMenuItem(mStringHelper.PAGE_LABEL);
- mAsserter.ok(waitForText(mStringHelper.CONTEXT_MENU_ITEMS_IN_URL_BAR[2]), "Waiting for the submenu to open", "Submenu was opened");
+ openSiteSecurityDoorHanger();
+ mAsserter.ok(waitForText(mStringHelper.CONTEXT_MENU_ITEMS_IN_URL_BAR[2]), "Waiting for the submenu to open for " + option + " on " + button, "Submenu was opened");
}
- mSolo.clickOnText(mStringHelper.CONTEXT_MENU_ITEMS_IN_URL_BAR[2]);
+ mSolo.clickOnText(mStringHelper.CONTEXT_MENU_ITEMS_IN_URL_BAR[2]);
mAsserter.ok(waitForText(option), "Verify that the option: " + option + " is in the list", "The option is in the list. There are settings to clear");
mSolo.clickOnButton(button);
}
+
+ private void openSiteSecurityDoorHanger() {
+ mSolo.waitForCondition(new Condition() {
+ @Override
+ public boolean isSatisfied() {
+ ImageButton btn = (ImageButton) mSolo.getView(R.id.favicon);
+ mSolo.clickOnView(btn);
+ return true;
+ }
+ }, TEST_WAIT_MS);
+ }
}
diff --git a/toolkit/components/alerts/nsAlertsService.cpp b/toolkit/components/alerts/nsAlertsService.cpp
index 0e35e407a4aa..2e1344268c94 100644
--- a/toolkit/components/alerts/nsAlertsService.cpp
+++ b/toolkit/components/alerts/nsAlertsService.cpp
@@ -25,7 +25,7 @@ using namespace mozilla;
using mozilla::dom::ContentChild;
-NS_IMPL_ISUPPORTS(nsAlertsService, nsIAlertsService, nsIAlertsProgressListener)
+NS_IMPL_ISUPPORTS(nsAlertsService, nsIAlertsService, nsIAlertsDoNotDisturb, nsIAlertsProgressListener)
nsAlertsService::nsAlertsService()
{
@@ -150,6 +150,45 @@ NS_IMETHODIMP nsAlertsService::CloseAlert(const nsAString& aAlertName,
}
+// nsIAlertsDoNotDisturb
+NS_IMETHODIMP nsAlertsService::GetManualDoNotDisturb(bool* aRetVal)
+{
+#ifdef MOZ_WIDGET_ANDROID
+ return NS_ERROR_NOT_IMPLEMENTED;
+#else
+ // Try the system notification service.
+ nsCOMPtr sysAlerts(do_GetService(NS_SYSTEMALERTSERVICE_CONTRACTID));
+ if (sysAlerts) {
+ nsCOMPtr alertsDND(do_GetService(NS_SYSTEMALERTSERVICE_CONTRACTID));
+ if (!alertsDND) {
+ return NS_ERROR_NOT_IMPLEMENTED;
+ }
+ return alertsDND->GetManualDoNotDisturb(aRetVal);
+ }
+
+ return mXULAlerts.GetManualDoNotDisturb(aRetVal);
+#endif
+}
+
+NS_IMETHODIMP nsAlertsService::SetManualDoNotDisturb(bool aDoNotDisturb)
+{
+#ifdef MOZ_WIDGET_ANDROID
+ return NS_ERROR_NOT_IMPLEMENTED;
+#else
+ // Try the system notification service.
+ nsCOMPtr sysAlerts(do_GetService(NS_SYSTEMALERTSERVICE_CONTRACTID));
+ if (sysAlerts) {
+ nsCOMPtr alertsDND(do_GetService(NS_SYSTEMALERTSERVICE_CONTRACTID));
+ if (!alertsDND) {
+ return NS_ERROR_NOT_IMPLEMENTED;
+ }
+ return alertsDND->SetManualDoNotDisturb(aDoNotDisturb);
+ }
+
+ return mXULAlerts.SetManualDoNotDisturb(aDoNotDisturb);
+#endif
+}
+
NS_IMETHODIMP nsAlertsService::OnProgress(const nsAString & aAlertName,
int64_t aProgress,
int64_t aProgressMax,
diff --git a/toolkit/components/alerts/nsAlertsService.h b/toolkit/components/alerts/nsAlertsService.h
index bc8449fc90df..71921da39703 100644
--- a/toolkit/components/alerts/nsAlertsService.h
+++ b/toolkit/components/alerts/nsAlertsService.h
@@ -28,10 +28,12 @@ typedef HRESULT (__stdcall *SHQueryUserNotificationStatePtr)(MOZ_QUERY_USER_NOTI
#endif // defined(XP_WIN)
class nsAlertsService : public nsIAlertsService,
+ public nsIAlertsDoNotDisturb,
public nsIAlertsProgressListener
{
public:
NS_DECL_NSIALERTSPROGRESSLISTENER
+ NS_DECL_NSIALERTSDONOTDISTURB
NS_DECL_NSIALERTSSERVICE
NS_DECL_ISUPPORTS
diff --git a/toolkit/components/alerts/nsIAlertsService.idl b/toolkit/components/alerts/nsIAlertsService.idl
index 71df72fbbef7..5ebc8586df91 100644
--- a/toolkit/components/alerts/nsIAlertsService.idl
+++ b/toolkit/components/alerts/nsIAlertsService.idl
@@ -3,7 +3,6 @@
* 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/. */
-
#include "nsISupports.idl"
#include "nsIObserver.idl"
@@ -12,99 +11,117 @@ interface nsIPrincipal;
[scriptable, uuid(9d0284bf-db40-42da-8f0d-c2769dbde7aa)]
interface nsIAlertsService : nsISupports
{
- /**
- * Displays a sliding notification window.
- *
- * @param imageUrl A URL identifying the image to put in the alert.
- * The OS X implemenation limits the amount of time it
- * will wait for an icon to load to six seconds. After
- * that time the alert will show with no icon.
- * @param title The title for the alert.
- * @param text The contents of the alert.
- * @param textClickable If true, causes the alert text to look like a link
- * and notifies the listener when user attempts to
- * click the alert text.
- * @param cookie A blind cookie the alert will pass back to the
- * consumer during the alert listener callbacks.
- * @param alertListener Used for callbacks. May be null if the caller
- * doesn't care about callbacks.
- * @param name The name of the notification. This is currently only
- * used on Android and OS X. On Android the name is
- * hashed and used as a notification ID. Notifications
- * will replace previous notifications with the same name.
- * @param dir Bidi override for the title. Valid values are
- * "auto", "ltr" or "rtl". Only available on supported
- * platforms.
- * @param lang Language of title and text of the alert. Only available
- * on supported platforms.
- * @param inPrivateBrowsing If set to true, imageUrl will be loaded in private
- * browsing mode.
- * @throws NS_ERROR_NOT_AVAILABLE If the notification cannot be displayed.
- *
- * The following arguments will be passed to the alertListener's observe()
- * method:
- * subject - null
- * topic - "alertfinished" when the alert goes away
- * "alertclickcallback" when the text is clicked
- * "alertshow" when the alert is shown
- * data - the value of the cookie parameter passed to showAlertNotification.
- *
- * @note Depending on current circumstances (if the user's in a fullscreen
- * application, for instance), the alert might not be displayed at all.
- * In that case, if an alert listener is passed in it will receive the
- * "alertfinished" notification immediately.
- */
- void showAlertNotification(in AString imageUrl,
- in AString title,
- in AString text,
- [optional] in boolean textClickable,
- [optional] in AString cookie,
- [optional] in nsIObserver alertListener,
- [optional] in AString name,
- [optional] in AString dir,
- [optional] in AString lang,
- [optional] in AString data,
- [optional] in nsIPrincipal principal,
- [optional] in boolean inPrivateBrowsing);
+ /**
+ * Displays a sliding notification window.
+ *
+ * @param imageUrl A URL identifying the image to put in the alert.
+ * The OS X implemenation limits the amount of time it
+ * will wait for an icon to load to six seconds. After
+ * that time the alert will show with no icon.
+ * @param title The title for the alert.
+ * @param text The contents of the alert.
+ * @param textClickable If true, causes the alert text to look like a link
+ * and notifies the listener when user attempts to
+ * click the alert text.
+ * @param cookie A blind cookie the alert will pass back to the
+ * consumer during the alert listener callbacks.
+ * @param alertListener Used for callbacks. May be null if the caller
+ * doesn't care about callbacks.
+ * @param name The name of the notification. This is currently only
+ * used on Android and OS X. On Android the name is
+ * hashed and used as a notification ID. Notifications
+ * will replace previous notifications with the same name.
+ * @param dir Bidi override for the title. Valid values are
+ * "auto", "ltr" or "rtl". Only available on supported
+ * platforms.
+ * @param lang Language of title and text of the alert. Only available
+ * on supported platforms.
+ * @param inPrivateBrowsing If set to true, imageUrl will be loaded in private
+ * browsing mode.
+ * @throws NS_ERROR_NOT_AVAILABLE If the notification cannot be displayed.
+ *
+ * The following arguments will be passed to the alertListener's observe()
+ * method:
+ * subject - null
+ * topic - "alertfinished" when the alert goes away
+ * "alertdisablecallback" when alerts should be disabled for the principal
+ * "alertsettingscallback" when alert settings should be opened
+ * "alertclickcallback" when the text is clicked
+ * "alertshow" when the alert is shown
+ * data - the value of the cookie parameter passed to showAlertNotification.
+ *
+ * @note Depending on current circumstances (if the user's in a fullscreen
+ * application, for instance), the alert might not be displayed at all.
+ * In that case, if an alert listener is passed in it will receive the
+ * "alertfinished" notification immediately.
+ */
+ void showAlertNotification(in AString imageUrl,
+ in AString title,
+ in AString text,
+ [optional] in boolean textClickable,
+ [optional] in AString cookie,
+ [optional] in nsIObserver alertListener,
+ [optional] in AString name,
+ [optional] in AString dir,
+ [optional] in AString lang,
+ [optional] in AString data,
+ [optional] in nsIPrincipal principal,
+ [optional] in boolean inPrivateBrowsing);
- /**
- * Close alerts created by the service.
- *
- * @param name The name of the notification to close. If no name
- * is provided then only a notification created with
- * no name (if any) will be closed.
- */
- void closeAlert([optional] in AString name,
- [optional] in nsIPrincipal principal);
+ /**
+ * Close alerts created by the service.
+ *
+ * @param name The name of the notification to close. If no name
+ * is provided then only a notification created with
+ * no name (if any) will be closed.
+ */
+ void closeAlert([optional] in AString name,
+ [optional] in nsIPrincipal principal);
+
+};
+
+[scriptable, uuid(c5d63e3a-259d-45a8-b964-8377967cb4d2)]
+interface nsIAlertsDoNotDisturb : nsISupports
+{
+ /**
+ * Toggles a manual Do Not Disturb mode for the service to reduce the amount
+ * of disruption that alerts cause the user.
+ * This may mean only displaying them in a notification tray/center or not
+ * displaying them at all. If a system backend already supports a similar
+ * feature controlled by the user, enabling this may not have any impact on
+ * code to show an alert. e.g. on OS X, the system will take care not
+ * disrupting a user if we simply create a notification like usual.
+ */
+ attribute bool manualDoNotDisturb;
};
[scriptable, uuid(df1bd4b0-3a8c-40e6-806a-203f38b0bd9f)]
interface nsIAlertsProgressListener : nsISupports
{
- /**
- * Called to notify the alert service that progress has occurred for the
- * given notification previously displayed with showAlertNotification().
- *
- * @param name The name of the notification displaying the
- * progress. On Android the name is hashed and used
- * as a notification ID.
- * @param progress Numeric value in the range 0 to progressMax
- * indicating the current progress.
- * @param progressMax Numeric value indicating the maximum progress.
- * @param text The contents of the alert. If not provided,
- * the percentage will be displayed.
- */
- void onProgress(in AString name,
- in long long progress,
- in long long progressMax,
- [optional] in AString text);
+ /**
+ * Called to notify the alert service that progress has occurred for the
+ * given notification previously displayed with showAlertNotification().
+ *
+ * @param name The name of the notification displaying the
+ * progress. On Android the name is hashed and used
+ * as a notification ID.
+ * @param progress Numeric value in the range 0 to progressMax
+ * indicating the current progress.
+ * @param progressMax Numeric value indicating the maximum progress.
+ * @param text The contents of the alert. If not provided,
+ * the percentage will be displayed.
+ */
+ void onProgress(in AString name,
+ in long long progress,
+ in long long progressMax,
+ [optional] in AString text);
- /**
- * Called to cancel and hide the given notification previously displayed
- * with showAlertNotification().
- *
- * @param name The name of the notification.
- */
- void onCancel(in AString name);
+ /**
+ * Called to cancel and hide the given notification previously displayed
+ * with showAlertNotification().
+ *
+ * @param name The name of the notification.
+ */
+ void onCancel(in AString name);
};
diff --git a/toolkit/components/alerts/nsXULAlerts.cpp b/toolkit/components/alerts/nsXULAlerts.cpp
index ba21904f2669..a76f67c68369 100644
--- a/toolkit/components/alerts/nsXULAlerts.cpp
+++ b/toolkit/components/alerts/nsXULAlerts.cpp
@@ -48,6 +48,10 @@ nsXULAlerts::ShowAlertNotification(const nsAString& aImageUrl, const nsAString&
const nsAString& aLang, nsIPrincipal* aPrincipal,
bool aInPrivateBrowsing)
{
+ if (mDoNotDisturb) {
+ return NS_OK;
+ }
+
nsCOMPtr wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
nsCOMPtr argsArray;
@@ -161,6 +165,20 @@ nsXULAlerts::ShowAlertNotification(const nsAString& aImageUrl, const nsAString&
return NS_OK;
}
+nsresult
+nsXULAlerts::SetManualDoNotDisturb(bool aDoNotDisturb)
+{
+ mDoNotDisturb = aDoNotDisturb;
+ return NS_OK;
+}
+
+nsresult
+nsXULAlerts::GetManualDoNotDisturb(bool* aRetVal)
+{
+ *aRetVal = mDoNotDisturb;
+ return NS_OK;
+}
+
nsresult
nsXULAlerts::CloseAlert(const nsAString& aAlertName)
{
diff --git a/toolkit/components/alerts/nsXULAlerts.h b/toolkit/components/alerts/nsXULAlerts.h
index 1e913c16393e..06e55bd62e7a 100644
--- a/toolkit/components/alerts/nsXULAlerts.h
+++ b/toolkit/components/alerts/nsXULAlerts.h
@@ -29,8 +29,13 @@ public:
bool aInPrivateBrowsing);
nsresult CloseAlert(const nsAString& aAlertName);
+
+ nsresult GetManualDoNotDisturb(bool* aRetVal);
+ nsresult SetManualDoNotDisturb(bool aDoNotDisturb);
+
protected:
nsInterfaceHashtable mNamedWindows;
+ bool mDoNotDisturb = false;
};
/**
diff --git a/toolkit/components/passwordmgr/content/passwordManager.js b/toolkit/components/passwordmgr/content/passwordManager.js
index 89bce4afe0bf..5fc9e915292a 100644
--- a/toolkit/components/passwordmgr/content/passwordManager.js
+++ b/toolkit/components/passwordmgr/content/passwordManager.js
@@ -159,6 +159,8 @@ function SignonSelected() {
var selections = GetTreeSelections(signonsTree);
if (selections.length) {
document.getElementById("removeSignon").removeAttribute("disabled");
+ } else {
+ document.getElementById("removeSignon").setAttribute("disabled", true);
}
}
diff --git a/toolkit/components/telemetry/Makefile.in b/toolkit/components/telemetry/Makefile.in
index 1763823a1baf..5cfcd252283c 100644
--- a/toolkit/components/telemetry/Makefile.in
+++ b/toolkit/components/telemetry/Makefile.in
@@ -6,13 +6,6 @@
USE_RCS_MK := 1
include $(topsrcdir)/config/makefiles/rcs.mk
-ifdef MOZILLA_OFFICIAL
-MOZ_HISTOGRAMS_VERSION ?= $(call getSourceRepo)/rev/$(firstword $(shell hg -R $(topsrcdir) parent --template='{node|short}\n' 2>/dev/null))
-ifdef MOZ_HISTOGRAMS_VERSION
-DEFINES += -DHISTOGRAMS_FILE_VERSION='$(MOZ_HISTOGRAMS_VERSION)'
-endif
-endif
-
INSTALL_TARGETS += histoenums
histoenums_FILES := TelemetryHistogramEnums.h
histoenums_DEST = $(DIST)/include/mozilla
diff --git a/toolkit/components/telemetry/TelemetrySession.jsm b/toolkit/components/telemetry/TelemetrySession.jsm
index cf0b3007fd86..899f21e13d9b 100644
--- a/toolkit/components/telemetry/TelemetrySession.jsm
+++ b/toolkit/components/telemetry/TelemetrySession.jsm
@@ -47,10 +47,6 @@ const ENVIRONMENT_CHANGE_LISTENER = "TelemetrySession::onEnvironmentChange";
const MS_IN_ONE_HOUR = 60 * 60 * 1000;
const MIN_SUBSESSION_LENGTH_MS = Preferences.get("toolkit.telemetry.minSubsessionLength", 10 * 60) * 1000;
-// This is the HG changeset of the Histogram.json file, used to associate
-// submitted ping data with its histogram definition (bug 832007)
-#expand const HISTOGRAMS_FILE_VERSION = "__HISTOGRAMS_FILE_VERSION__";
-
const LOGGER_NAME = "Toolkit.Telemetry";
const LOGGER_PREFIX = "TelemetrySession" + (Utils.isContentProcess ? "#content::" : "::");
@@ -1044,7 +1040,7 @@ var Impl = {
let ret = {
reason: reason,
- revision: HISTOGRAMS_FILE_VERSION,
+ revision: AppConstants.SOURCE_REVISION_URL,
asyncPluginInit: Preferences.get(PREF_ASYNC_PLUGIN_INIT, false),
// Date.getTimezoneOffset() unintuitively returns negative values if we are ahead of
diff --git a/toolkit/components/telemetry/moz.build b/toolkit/components/telemetry/moz.build
index f400e3144b29..bd7113aceb76 100644
--- a/toolkit/components/telemetry/moz.build
+++ b/toolkit/components/telemetry/moz.build
@@ -36,6 +36,7 @@ EXTRA_JS_MODULES += [
'TelemetryLog.jsm',
'TelemetryReportingPolicy.jsm',
'TelemetrySend.jsm',
+ 'TelemetrySession.jsm',
'TelemetryStopwatch.jsm',
'TelemetryStorage.jsm',
'TelemetryUtils.jsm',
@@ -43,10 +44,6 @@ EXTRA_JS_MODULES += [
'UITelemetry.jsm',
]
-EXTRA_PP_JS_MODULES += [
- 'TelemetrySession.jsm',
-]
-
TESTING_JS_MODULES += [
'tests/unit/TelemetryArchiveTesting.jsm',
]
diff --git a/toolkit/locales/en-US/chrome/global/devtools/gclicommands.properties b/toolkit/locales/en-US/chrome/global/devtools/gclicommands.properties
index bde0ef286e01..9b079c5b009e 100644
--- a/toolkit/locales/en-US/chrome/global/devtools/gclicommands.properties
+++ b/toolkit/locales/en-US/chrome/global/devtools/gclicommands.properties
@@ -1604,6 +1604,10 @@ securityReferrerNextURI=When Visiting
securityReferrerCalculatedReferrer=Referrer Will Be
# LOCALIZATION NOTE: %1$S is the current page URI
securityReferrerPolicyReportHeader=Referrer Policy for %1$S
+securityReferrerPolicyOtherDomain=Other Origin
+securityReferrerPolicyOtherDomainDowngrade=Other Origin HTTP
+securityReferrerPolicySameDomain=Same Origin
+securityReferrerPolicySameDomainDowngrade=Same Host HTTP
# LOCALIZATION NOTE (rulersDesc) A very short description of the
# 'rulers' command. See rulersManual for a fuller description of what
diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm
index a3fbc009d572..fd5b8b2a7530 100644
--- a/toolkit/modules/AppConstants.jsm
+++ b/toolkit/modules/AppConstants.jsm
@@ -223,5 +223,10 @@ this.AppConstants = Object.freeze({
#else
false,
#endif
- DEBUG_JS_MODULES: "@DEBUG_JS_MODULES@"
+ DEBUG_JS_MODULES: "@DEBUG_JS_MODULES@",
+
+ // URL to the hg revision this was built from (e.g.
+ // "https://hg.mozilla.org/mozilla-central/rev/6256ec9113c1")
+ // On unofficial builds, this is an empty string.
+ SOURCE_REVISION_URL: "@SOURCE_REV_URL@"
});
diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build
index 94c6e2a7b6e1..5e6b75228b06 100644
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -107,7 +107,8 @@ for var in ('ANDROID_PACKAGE_NAME',
'MOZ_WIDGET_TOOLKIT',
'DLL_PREFIX',
'DLL_SUFFIX',
- 'DEBUG_JS_MODULES'):
+ 'DEBUG_JS_MODULES',
+ 'SOURCE_REV_URL'):
DEFINES[var] = CONFIG[var]
for var in ('MOZ_TOOLKIT_SEARCH',
diff --git a/widget/NativeKeyToDOMKeyName.h b/widget/NativeKeyToDOMKeyName.h
index 465ccd37fcc5..e596ce758eea 100644
--- a/widget/NativeKeyToDOMKeyName.h
+++ b/widget/NativeKeyToDOMKeyName.h
@@ -1305,6 +1305,15 @@ KEY_MAP_ANDROID (HomeScreen, AKEYCODE_HOME)
KEY_MAP_QT (CameraFocusAdjust, Qt::Key_CameraFocus)
KEY_MAP_ANDROID (CameraFocusAdjust, AKEYCODE_FOCUS)
+// PhoneCall
+KEY_MAP_ANDROID (PhoneCall, AKEYCODE_CALL)
+
+// SoftLeft
+KEY_MAP_ANDROID (SoftLeft, AKEYCODE_SOFT_LEFT)
+
+// SoftRight
+KEY_MAP_ANDROID (SoftRight, AKEYCODE_SOFT_RIGHT)
+
#undef KEY_MAP_WIN
#undef KEY_MAP_WIN_JPN
#undef KEY_MAP_WIN_KOR
diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp
index ac8d0dc02a23..7990c1f69636 100644
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1495,9 +1495,6 @@ ConvertAndroidKeyCodeToKeyNameIndex(AndroidGeckoEvent& aAndroidGeckoEvent)
case AKEYCODE_RO: // Japanese Ro key
return KEY_NAME_INDEX_USE_STRING;
- case AKEYCODE_SOFT_LEFT:
- case AKEYCODE_SOFT_RIGHT:
- case AKEYCODE_CALL:
case AKEYCODE_ENDCALL:
case AKEYCODE_NUM: // XXX Not sure
case AKEYCODE_HEADSETHOOK:
diff --git a/xpcom/threads/TimerThread.cpp b/xpcom/threads/TimerThread.cpp
index 2bf92bc999f3..9eeda7a93c7d 100644
--- a/xpcom/threads/TimerThread.cpp
+++ b/xpcom/threads/TimerThread.cpp
@@ -430,7 +430,11 @@ TimerThread::Run()
bool forceRunThisTimer = forceRunNextTimer;
forceRunNextTimer = false;
- if (mSleeping) {
+ if (mSleeping
+#ifdef MOZ_NUWA_PROCESS
+ || IsNuwaProcess() // Don't fire timers or deadlock will result.
+#endif
+ ) {
// Sleep for 0.1 seconds while not firing timers.
uint32_t milliseconds = 100;
if (ChaosMode::isActive(ChaosFeature::TimerScheduling)) {