Loading dom/base/nsContentUtils.cpp +0 −7 Original line number Diff line number Diff line Loading @@ -81,7 +81,6 @@ #include "mozilla/EventQueue.h" #include "mozilla/EventStateManager.h" #include "mozilla/FlushType.h" #include "mozilla/FOGIPC.h" #include "mozilla/HTMLEditor.h" #include "mozilla/HangAnnotations.h" #include "mozilla/IMEStateManager.h" Loading Loading @@ -10118,14 +10117,8 @@ nsContentUtils::UserInteractionObserver::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData) { if (!strcmp(aTopic, kUserInteractionInactive)) { if (sUserActive && XRE_IsParentProcess()) { glean::RecordPowerMetrics(); } sUserActive = false; } else if (!strcmp(aTopic, kUserInteractionActive)) { if (!sUserActive && XRE_IsParentProcess()) { glean::RecordPowerMetrics(); } sUserActive = true; } else { NS_WARNING("Unexpected observer notification"); Loading dom/ipc/ContentChild.cpp +0 −6 Original line number Diff line number Diff line Loading @@ -2839,12 +2839,6 @@ mozilla::ipc::IPCResult ContentChild::RecvNotifyProcessPriorityChanged( ProcessPriorityToString(mProcessPriority)), ProfilerString8View::WrapNullTerminatedString( ProcessPriorityToString(aPriority))); // Record FOG data before the priority change. // Ignore the change if it's the first time we set the process priority. if (mProcessPriority != hal::PROCESS_PRIORITY_UNKNOWN) { glean::RecordPowerMetrics(); } mProcessPriority = aPriority; os->NotifyObservers(static_cast<nsIPropertyBag2*>(props), Loading dom/ipc/ContentChild.h +0 −2 Original line number Diff line number Diff line Loading @@ -834,8 +834,6 @@ class ContentChild final : public PContentChild, BrowsingContext* aStartingAt, const DispatchBeforeUnloadToSubtreeResolver& aResolver); hal::ProcessPriority GetProcessPriority() const { return mProcessPriority; } private: mozilla::ipc::IPCResult RecvFlushFOGData(FlushFOGDataResolver&& aResolver); Loading dom/ipc/ProcessPriorityManager.cpp +18 −22 Original line number Diff line number Diff line Loading @@ -172,7 +172,6 @@ class ProcessPriorityManagerImpl final : public nsIObserver, static void StaticInit(); static bool PrefsEnabled(); static void SetProcessPriorityIfEnabled(int aPid, ProcessPriority aPriority); static bool TestMode(); NS_DECL_ISUPPORTS Loading Loading @@ -366,17 +365,6 @@ bool ProcessPriorityManagerImpl::PrefsEnabled() { !StaticPrefs::dom_ipc_tabs_disabled(); } /* static */ void ProcessPriorityManagerImpl::SetProcessPriorityIfEnabled( int aPid, ProcessPriority aPriority) { // The preference doesn't disable the process priority manager, but only its // effect. This way the IPCs still happen and can be used to collect telemetry // about CPU use. if (PrefsEnabled()) { hal::SetProcessPriority(aPid, aPriority); } } /* static */ bool ProcessPriorityManagerImpl::TestMode() { return StaticPrefs::dom_ipc_processPriorityManager_testMode(); Loading @@ -394,13 +382,20 @@ void ProcessPriorityManagerImpl::StaticInit() { return; } // If IPC tabs aren't enabled at startup, don't bother with any of this. if (!PrefsEnabled()) { LOG("InitProcessPriorityManager bailing due to prefs."); // Run StaticInit() again if the prefs change. We don't expect this to // happen in normal operation, but it happens during testing. if (!sPrefListenersRegistered) { sPrefListenersRegistered = true; Preferences::RegisterCallback(PrefChangedCallback, "dom.ipc.processPriorityManager.enabled"); Preferences::RegisterCallback(PrefChangedCallback, "dom.ipc.tabs.disabled"); Preferences::RegisterCallback(PrefChangedCallback, "dom.ipc.tabs.disabled"); } return; } sInitialized = true; Loading Loading @@ -431,7 +426,7 @@ void ProcessPriorityManagerImpl::Init() { // The parent process's priority never changes; set it here and then forget // about it. We'll manage only subprocesses' priorities using the process // priority manager. SetProcessPriorityIfEnabled(getpid(), PROCESS_PRIORITY_PARENT_PROCESS); hal::SetProcessPriority(getpid(), PROCESS_PRIORITY_PARENT_PROCESS); nsCOMPtr<nsIObserverService> os = services::GetObserverService(); if (os) { Loading Loading @@ -767,7 +762,8 @@ void ParticularProcessPriorityManager::SetPriorityNow( return; } if (!mContentParent || mPriority == aPriority) { if (!ProcessPriorityManagerImpl::PrefsEnabled() || !mContentParent || mPriority == aPriority) { return; } Loading Loading @@ -798,7 +794,7 @@ void ParticularProcessPriorityManager::SetPriorityNow( Telemetry::ScalarID::DOM_CONTENTPROCESS_OS_PRIORITY_LOWERED, 1); } ProcessPriorityManagerImpl::SetProcessPriorityIfEnabled(Pid(), mPriority); hal::SetProcessPriority(Pid(), mPriority); if (oldPriority != mPriority) { ProcessPriorityManagerImpl::GetSingleton()->NotifyProcessPriorityChanged( Loading hal/HalWakeLock.cpp +0 −16 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ #include "Hal.h" #include "base/process_util.h" #include "mozilla/FOGIPC.h" #include "mozilla/HalWakeLock.h" #include "mozilla/Services.h" #include "mozilla/StaticPtr.h" Loading Loading @@ -200,14 +199,6 @@ void ModifyWakeLock(const nsAString& aTopic, hal::WakeLockControl aLockAdjust, WakeLockState oldState = ComputeWakeLockState(totalCount.numLocks, totalCount.numHidden); if (ComputeWakeLockState(totalCount.numLocks + aLockAdjust, totalCount.numHidden + aHiddenAdjust) != oldState && (aTopic.Equals(u"video-playing"_ns) || aTopic.Equals(u"audio-playing"_ns))) { glean::RecordPowerMetrics(); } bool processWasLocked = processCount.numLocks > 0; processCount.numLocks += aLockAdjust; Loading Loading @@ -244,13 +235,6 @@ void GetWakeLockInfo(const nsAString& aTopic, return; } if (!sLockTable) { // This can happen during some gtests. NS_WARNING("Attempting to get wake lock information before initialization"); *aWakeLockInfo = WakeLockInformation(); return; } ProcessLockTable* table = sLockTable->Get(aTopic); if (!table) { *aWakeLockInfo = WakeLockInfoFromLockCount(aTopic, LockCount()); Loading Loading
dom/base/nsContentUtils.cpp +0 −7 Original line number Diff line number Diff line Loading @@ -81,7 +81,6 @@ #include "mozilla/EventQueue.h" #include "mozilla/EventStateManager.h" #include "mozilla/FlushType.h" #include "mozilla/FOGIPC.h" #include "mozilla/HTMLEditor.h" #include "mozilla/HangAnnotations.h" #include "mozilla/IMEStateManager.h" Loading Loading @@ -10118,14 +10117,8 @@ nsContentUtils::UserInteractionObserver::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData) { if (!strcmp(aTopic, kUserInteractionInactive)) { if (sUserActive && XRE_IsParentProcess()) { glean::RecordPowerMetrics(); } sUserActive = false; } else if (!strcmp(aTopic, kUserInteractionActive)) { if (!sUserActive && XRE_IsParentProcess()) { glean::RecordPowerMetrics(); } sUserActive = true; } else { NS_WARNING("Unexpected observer notification"); Loading
dom/ipc/ContentChild.cpp +0 −6 Original line number Diff line number Diff line Loading @@ -2839,12 +2839,6 @@ mozilla::ipc::IPCResult ContentChild::RecvNotifyProcessPriorityChanged( ProcessPriorityToString(mProcessPriority)), ProfilerString8View::WrapNullTerminatedString( ProcessPriorityToString(aPriority))); // Record FOG data before the priority change. // Ignore the change if it's the first time we set the process priority. if (mProcessPriority != hal::PROCESS_PRIORITY_UNKNOWN) { glean::RecordPowerMetrics(); } mProcessPriority = aPriority; os->NotifyObservers(static_cast<nsIPropertyBag2*>(props), Loading
dom/ipc/ContentChild.h +0 −2 Original line number Diff line number Diff line Loading @@ -834,8 +834,6 @@ class ContentChild final : public PContentChild, BrowsingContext* aStartingAt, const DispatchBeforeUnloadToSubtreeResolver& aResolver); hal::ProcessPriority GetProcessPriority() const { return mProcessPriority; } private: mozilla::ipc::IPCResult RecvFlushFOGData(FlushFOGDataResolver&& aResolver); Loading
dom/ipc/ProcessPriorityManager.cpp +18 −22 Original line number Diff line number Diff line Loading @@ -172,7 +172,6 @@ class ProcessPriorityManagerImpl final : public nsIObserver, static void StaticInit(); static bool PrefsEnabled(); static void SetProcessPriorityIfEnabled(int aPid, ProcessPriority aPriority); static bool TestMode(); NS_DECL_ISUPPORTS Loading Loading @@ -366,17 +365,6 @@ bool ProcessPriorityManagerImpl::PrefsEnabled() { !StaticPrefs::dom_ipc_tabs_disabled(); } /* static */ void ProcessPriorityManagerImpl::SetProcessPriorityIfEnabled( int aPid, ProcessPriority aPriority) { // The preference doesn't disable the process priority manager, but only its // effect. This way the IPCs still happen and can be used to collect telemetry // about CPU use. if (PrefsEnabled()) { hal::SetProcessPriority(aPid, aPriority); } } /* static */ bool ProcessPriorityManagerImpl::TestMode() { return StaticPrefs::dom_ipc_processPriorityManager_testMode(); Loading @@ -394,13 +382,20 @@ void ProcessPriorityManagerImpl::StaticInit() { return; } // If IPC tabs aren't enabled at startup, don't bother with any of this. if (!PrefsEnabled()) { LOG("InitProcessPriorityManager bailing due to prefs."); // Run StaticInit() again if the prefs change. We don't expect this to // happen in normal operation, but it happens during testing. if (!sPrefListenersRegistered) { sPrefListenersRegistered = true; Preferences::RegisterCallback(PrefChangedCallback, "dom.ipc.processPriorityManager.enabled"); Preferences::RegisterCallback(PrefChangedCallback, "dom.ipc.tabs.disabled"); Preferences::RegisterCallback(PrefChangedCallback, "dom.ipc.tabs.disabled"); } return; } sInitialized = true; Loading Loading @@ -431,7 +426,7 @@ void ProcessPriorityManagerImpl::Init() { // The parent process's priority never changes; set it here and then forget // about it. We'll manage only subprocesses' priorities using the process // priority manager. SetProcessPriorityIfEnabled(getpid(), PROCESS_PRIORITY_PARENT_PROCESS); hal::SetProcessPriority(getpid(), PROCESS_PRIORITY_PARENT_PROCESS); nsCOMPtr<nsIObserverService> os = services::GetObserverService(); if (os) { Loading Loading @@ -767,7 +762,8 @@ void ParticularProcessPriorityManager::SetPriorityNow( return; } if (!mContentParent || mPriority == aPriority) { if (!ProcessPriorityManagerImpl::PrefsEnabled() || !mContentParent || mPriority == aPriority) { return; } Loading Loading @@ -798,7 +794,7 @@ void ParticularProcessPriorityManager::SetPriorityNow( Telemetry::ScalarID::DOM_CONTENTPROCESS_OS_PRIORITY_LOWERED, 1); } ProcessPriorityManagerImpl::SetProcessPriorityIfEnabled(Pid(), mPriority); hal::SetProcessPriority(Pid(), mPriority); if (oldPriority != mPriority) { ProcessPriorityManagerImpl::GetSingleton()->NotifyProcessPriorityChanged( Loading
hal/HalWakeLock.cpp +0 −16 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ #include "Hal.h" #include "base/process_util.h" #include "mozilla/FOGIPC.h" #include "mozilla/HalWakeLock.h" #include "mozilla/Services.h" #include "mozilla/StaticPtr.h" Loading Loading @@ -200,14 +199,6 @@ void ModifyWakeLock(const nsAString& aTopic, hal::WakeLockControl aLockAdjust, WakeLockState oldState = ComputeWakeLockState(totalCount.numLocks, totalCount.numHidden); if (ComputeWakeLockState(totalCount.numLocks + aLockAdjust, totalCount.numHidden + aHiddenAdjust) != oldState && (aTopic.Equals(u"video-playing"_ns) || aTopic.Equals(u"audio-playing"_ns))) { glean::RecordPowerMetrics(); } bool processWasLocked = processCount.numLocks > 0; processCount.numLocks += aLockAdjust; Loading Loading @@ -244,13 +235,6 @@ void GetWakeLockInfo(const nsAString& aTopic, return; } if (!sLockTable) { // This can happen during some gtests. NS_WARNING("Attempting to get wake lock information before initialization"); *aWakeLockInfo = WakeLockInformation(); return; } ProcessLockTable* table = sLockTable->Get(aTopic); if (!table) { *aWakeLockInfo = WakeLockInfoFromLockCount(aTopic, LockCount()); Loading