diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /dom/console | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/console')
-rw-r--r-- | dom/console/Console.h | 1 | ||||
-rw-r--r-- | dom/console/ConsoleAPIStorage.sys.mjs | 2 | ||||
-rw-r--r-- | dom/console/ConsoleInstance.cpp | 10 | ||||
-rw-r--r-- | dom/console/ConsoleUtils.cpp | 1 |
4 files changed, 7 insertions, 7 deletions
diff --git a/dom/console/Console.h b/dom/console/Console.h index 410cc8ba46..5898c6b0f5 100644 --- a/dom/console/Console.h +++ b/dom/console/Console.h @@ -9,6 +9,7 @@ #include "domstubs.h" #include "mozilla/dom/ConsoleBinding.h" +#include "mozilla/dom/ConsoleInstanceBinding.h" #include "mozilla/TimeStamp.h" #include "nsCycleCollectionParticipant.h" #include "nsTHashMap.h" diff --git a/dom/console/ConsoleAPIStorage.sys.mjs b/dom/console/ConsoleAPIStorage.sys.mjs index f920d0d5e0..2f537f21e9 100644 --- a/dom/console/ConsoleAPIStorage.sys.mjs +++ b/dom/console/ConsoleAPIStorage.sys.mjs @@ -49,7 +49,7 @@ ConsoleAPIStorageService.prototype = { "nsIObserver", ]), - observe: function CS_observe(aSubject, aTopic, aData) { + observe: function CS_observe(aSubject, aTopic) { if (aTopic == "xpcom-shutdown") { Services.obs.removeObserver(this, "xpcom-shutdown"); Services.obs.removeObserver(this, "inner-window-destroyed"); diff --git a/dom/console/ConsoleInstance.cpp b/dom/console/ConsoleInstance.cpp index 24477da56c..ade82be50f 100644 --- a/dom/console/ConsoleInstance.cpp +++ b/dom/console/ConsoleInstance.cpp @@ -71,7 +71,7 @@ ConsoleInstance::ConsoleInstance(JSContext* aCx, return; } - CopyUTF16toUTF8(aOptions.mMaxLogLevelPref, mMaxLogLevelPref); + mMaxLogLevelPref = aOptions.mMaxLogLevelPref; Preferences::RegisterCallback(MaxLogLevelPrefChangedCallback, mMaxLogLevelPref, this); @@ -106,9 +106,8 @@ ConsoleLogLevel PrefToValue(const nsACString& aPref, return aLevel; } - int index = FindEnumStringIndexImpl(value.get(), value.Length(), - ConsoleLogLevelValues::strings); - if (NS_WARN_IF(index < 0)) { + Maybe<ConsoleLogLevel> level = StringToEnum<ConsoleLogLevel>(value); + if (NS_WARN_IF(level.isNothing())) { nsString message; message.AssignLiteral("Invalid Console.maxLogLevelPref value: "); message.Append(NS_ConvertUTF8toUTF16(value)); @@ -118,8 +117,7 @@ ConsoleLogLevel PrefToValue(const nsACString& aPref, return aLevel; } - MOZ_ASSERT(index < (int)ConsoleLogLevelValues::Count); - return static_cast<ConsoleLogLevel>(index); + return level.value(); } void ConsoleInstance::SetLogLevel() { diff --git a/dom/console/ConsoleUtils.cpp b/dom/console/ConsoleUtils.cpp index 9767dd30dd..585ff2ec3d 100644 --- a/dom/console/ConsoleUtils.cpp +++ b/dom/console/ConsoleUtils.cpp @@ -14,6 +14,7 @@ #include "mozilla/ClearOnShutdown.h" #include "mozilla/NullPrincipal.h" #include "mozilla/dom/ConsoleBinding.h" +#include "mozilla/dom/ConsoleInstanceBinding.h" #include "mozilla/dom/RootedDictionary.h" #include "mozilla/dom/ScriptSettings.h" #include "js/PropertyAndElement.h" // JS_DefineProperty |