diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /dom/console | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz firefox-adbda400be353e676059e335c3c0aaf99e719475.zip |
Adding upstream version 125.0.1.upstream/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 |