diff options
Diffstat (limited to 'dom/ipc/ContentChild.cpp')
-rw-r--r-- | dom/ipc/ContentChild.cpp | 22 |
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); |