summaryrefslogtreecommitdiffstats
path: root/dom/ipc/ContentChild.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /dom/ipc/ContentChild.cpp
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/ipc/ContentChild.cpp')
-rw-r--r--dom/ipc/ContentChild.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp
index 2ebdd303d8..403cb3c9b8 100644
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -2781,6 +2781,20 @@ mozilla::ipc::IPCResult ContentChild::RecvNotifyProcessPriorityChanged(
moz_set_max_dirty_page_modifier(4);
} else if (mProcessPriority == hal::PROCESS_PRIORITY_BACKGROUND) {
moz_set_max_dirty_page_modifier(-2);
+
+#if defined(MOZ_MEMORY)
+ if (StaticPrefs::dom_memory_memory_pressure_on_background() == 1) {
+ jemalloc_free_dirty_pages();
+ }
+#endif
+ if (StaticPrefs::dom_memory_memory_pressure_on_background() == 2) {
+ nsCOMPtr<nsIObserverService> obsServ = services::GetObserverService();
+ obsServ->NotifyObservers(nullptr, "memory-pressure", u"heap-minimize");
+ } else if (StaticPrefs::dom_memory_memory_pressure_on_background() == 3) {
+ nsCOMPtr<nsIObserverService> obsServ = services::GetObserverService();
+ obsServ->NotifyObservers(nullptr, "memory-pressure", u"low-memory");
+ }
+
} else {
moz_set_max_dirty_page_modifier(0);
}
@@ -4446,14 +4460,6 @@ mozilla::ipc::IPCResult ContentChild::RecvDispatchBeforeUnloadToSubtree(
return IPC_OK();
}
-mozilla::ipc::IPCResult ContentChild::RecvDecoderSupportedMimeTypes(
- nsTArray<nsCString>&& aSupportedTypes) {
-#ifdef MOZ_WIDGET_ANDROID
- AndroidDecoderModule::SetSupportedMimeTypes(std::move(aSupportedTypes));
-#endif
- return IPC_OK();
-}
-
mozilla::ipc::IPCResult ContentChild::RecvInitNextGenLocalStorageEnabled(
const bool& aEnabled) {
mozilla::dom::RecvInitNextGenLocalStorageEnabled(aEnabled);