summaryrefslogtreecommitdiffstats
path: root/dom/base
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-07-29 14:30:24 +0000
committerMoonchild <moonchild@palemoon.org>2020-07-29 14:30:24 +0000
commita1ca8ca9bd1f4442dcbe613efa04f37a2c7b9f57 (patch)
tree9df45decf2d7d940ff19641adea50fe7122805f7 /dom/base
parent86b184b957ea2ce31e5ffc376e90cbc537963367 (diff)
parent2ee2ca7dfb0913eef79708dc4100f87b9557e128 (diff)
downloadUXP-a1ca8ca9bd1f4442dcbe613efa04f37a2c7b9f57.tar
UXP-a1ca8ca9bd1f4442dcbe613efa04f37a2c7b9f57.tar.gz
UXP-a1ca8ca9bd1f4442dcbe613efa04f37a2c7b9f57.tar.lz
UXP-a1ca8ca9bd1f4442dcbe613efa04f37a2c7b9f57.tar.xz
UXP-a1ca8ca9bd1f4442dcbe613efa04f37a2c7b9f57.zip
Merge branch 'redwood' into release
Diffstat (limited to 'dom/base')
-rw-r--r--dom/base/Navigator.cpp43
-rw-r--r--dom/base/Navigator.h7
-rwxr-xr-xdom/base/moz.build1
-rw-r--r--dom/base/nsContentUtils.cpp8
-rw-r--r--dom/base/nsJSUtils.cpp3
5 files changed, 10 insertions, 52 deletions
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp
index a544f23c1..53ce2b30f 100644
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -30,7 +30,6 @@
#include "nsUnicharUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
-#include "BatteryManager.h"
#ifdef MOZ_GAMEPAD
#include "mozilla/dom/GamepadServiceTest.h"
#endif
@@ -197,8 +196,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPermissions)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGeolocation)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNotification)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBatteryManager)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBatteryPromise)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPowerManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConnection)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStorageManager)
@@ -249,13 +246,6 @@ Navigator::Invalidate()
mNotification = nullptr;
}
- if (mBatteryManager) {
- mBatteryManager->Shutdown();
- mBatteryManager = nullptr;
- }
-
- mBatteryPromise = nullptr;
-
if (mPowerManager) {
mPowerManager->Shutdown();
mPowerManager = nullptr;
@@ -1321,39 +1311,6 @@ Navigator::GetMozNotification(ErrorResult& aRv)
return mNotification;
}
-//*****************************************************************************
-// Navigator::nsINavigatorBattery
-//*****************************************************************************
-
-Promise*
-Navigator::GetBattery(ErrorResult& aRv)
-{
- if (mBatteryPromise) {
- return mBatteryPromise;
- }
-
- if (!mWindow || !mWindow->GetDocShell()) {
- aRv.Throw(NS_ERROR_UNEXPECTED);
- return nullptr;
- }
-
- nsCOMPtr<nsIGlobalObject> go = do_QueryInterface(mWindow);
- RefPtr<Promise> batteryPromise = Promise::Create(go, aRv);
- if (NS_WARN_IF(aRv.Failed())) {
- return nullptr;
- }
- mBatteryPromise = batteryPromise;
-
- if (!mBatteryManager) {
- mBatteryManager = new battery::BatteryManager(mWindow);
- mBatteryManager->Init();
- }
-
- mBatteryPromise->MaybeResolve(mBatteryManager);
-
- return mBatteryPromise;
-}
-
PowerManager*
Navigator::GetMozPower(ErrorResult& aRv)
{
diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h
index 4ddaaabab..bcc67589e 100644
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -51,10 +51,6 @@ namespace dom {
class Permissions;
-namespace battery {
-class BatteryManager;
-} // namespace battery
-
class Promise;
class DesktopNotificationCenter;
@@ -136,7 +132,6 @@ public:
Permissions* GetPermissions(ErrorResult& aRv);
// The XPCOM GetDoNotTrack is ok
Geolocation* GetGeolocation(ErrorResult& aRv);
- Promise* GetBattery(ErrorResult& aRv);
static void AppName(nsAString& aAppName, bool aUsePrefOverriddenValue);
@@ -269,8 +264,6 @@ private:
RefPtr<Permissions> mPermissions;
RefPtr<Geolocation> mGeolocation;
RefPtr<DesktopNotificationCenter> mNotification;
- RefPtr<battery::BatteryManager> mBatteryManager;
- RefPtr<Promise> mBatteryPromise;
RefPtr<PowerManager> mPowerManager;
RefPtr<network::Connection> mConnection;
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
diff --git a/dom/base/moz.build b/dom/base/moz.build
index aadafe412..1de49424b 100755
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -416,7 +416,6 @@ EXTRA_JS_MODULES += [
]
LOCAL_INCLUDES += [
- '../battery',
'../events',
'../media',
'../network',
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp
index 6a9904bf9..1a3f5b5ca 100644
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -5105,6 +5105,14 @@ nsContentUtils::TriggerLink(nsIContent *aContent, nsPresContext *aPresContext,
fileName.SetIsVoid(true); // No actionable download attribute was found.
}
+ // Sanitize fileNames containing control characters by replacing them with
+ // underscores.
+ if (!fileName.IsVoid()) {
+ for (int i = 0; i < 32; i++) {
+ fileName.ReplaceChar(char16_t(i), '_');
+ }
+ }
+
handler->OnLinkClick(aContent, aLinkURI,
fileName.IsVoid() ? aTargetSpec.get() : EmptyString().get(),
fileName, nullptr, nullptr, aIsTrusted, aContent->NodePrincipal());
diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp
index 5c7e20424..2e6e345a3 100644
--- a/dom/base/nsJSUtils.cpp
+++ b/dom/base/nsJSUtils.cpp
@@ -313,7 +313,8 @@ nsJSUtils::ModuleInstantiate(JSContext* aCx, JS::Handle<JSObject*> aModule)
MOZ_ASSERT(aCx == nsContentUtils::GetCurrentJSContext());
MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(nsContentUtils::IsInMicroTask());
+ MOZ_ASSERT(CycleCollectedJSContext::Get() &&
+ CycleCollectedJSContext::Get()->MicroTaskLevel());
NS_ENSURE_TRUE(xpc::Scriptability::Get(aModule).Allowed(), NS_OK);