[webkit-changes] [WebKit/WebKit] 308845: Timers are not coalesced during thermal throttling...

Tim Horton noreply at github.com
Wed Aug 30 19:45:25 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 30884546903f1ba774adb0cbef1adc91c6c53c64
      https://github.com/WebKit/WebKit/commit/30884546903f1ba774adb0cbef1adc91c6c53c64
  Author: Tim Horton <thorton at apple.com>
  Date:   2023-08-30 (Wed, 30 Aug 2023)

  Changed paths:
    M Source/WTF/wtf/PlatformHave.h
    M Source/WebCore/Sources.txt
    M Source/WebCore/SourcesCocoa.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/page/DOMTimer.h
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/Page.h
    A Source/WebCore/platform/ThermalMitigationNotifier.cpp
    A Source/WebCore/platform/ThermalMitigationNotifier.h
    M Source/WebCore/platform/audio/cocoa/AudioUtilitiesCocoa.h
    M Source/WebCore/platform/cocoa/LowPowerModeNotifier.mm
    A Source/WebCore/platform/cocoa/ThermalMitigationNotifier.mm
    M Source/WebCore/platform/graphics/AnimationFrameRate.cpp
    M Source/WebCore/platform/graphics/AnimationFrameRate.h
    M Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm
    M Source/WebCore/platform/network/mac/UTIUtilities.mm

  Log Message:
  -----------
  Timers are not coalesced during thermal throttling; should match low power mode
https://bugs.webkit.org/show_bug.cgi?id=260931
rdar://112725366

Reviewed by Aditya Keerthi.

* Source/WebCore/platform/ThermalMitigationNotifier.cpp: Added.
(WebCore::ThermalMitigationNotifier::ThermalMitigationNotifier):
(WebCore::ThermalMitigationNotifier::thermalMitigationEnabled const):
* Source/WebCore/platform/ThermalMitigationNotifier.h: Added.
* Source/WebCore/platform/cocoa/ThermalMitigationNotifier.mm: Added.
(-[WebThermalMitigationObserver initWithNotifier:]):
(-[WebThermalMitigationObserver dealloc]):
(-[WebThermalMitigationObserver thermalStateDidChange]):
(-[WebThermalMitigationObserver thermalMitigationEnabled]):
(WebCore::ThermalMitigationNotifier::ThermalMitigationNotifier):
(WebCore::ThermalMitigationNotifier::~ThermalMitigationNotifier):
(WebCore::ThermalMitigationNotifier::thermalMitigationEnabled const):
(WebCore::ThermalMitigationNotifier::notifyThermalMitigationChanged):
(WebCore::notifyThermalMitigationChanged):
Add an observer for thermal state. Assume that we want to mitigate our contribution
to high thermals when the state is Serious or above.
This has the same shape as LowPowerModeNotifier.

* Source/WTF/wtf/PlatformHave.h:
* Source/WebCore/Sources.txt:
* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/page/DOMTimer.h:
* Source/WebCore/page/Page.cpp:
(WebCore::m_thermalMitigationNotifier):
(WebCore::m_badgeClient):
(WebCore::Page::didChangeThrottlingReasons):
(WebCore::Page::setIsVisuallyIdleInternal):
(WebCore::Page::handleLowModePowerChange):
(WebCore::Page::handleThermalMitigationChange):
(WebCore::Page::updateDOMTimerAlignmentInterval):
* Source/WebCore/page/Page.h:
(WebCore::Page::isThermalMitigationEnabled const):
* Source/WebCore/platform/graphics/AnimationFrameRate.cpp:
(WebCore::operator<<):
* Source/WebCore/platform/graphics/AnimationFrameRate.h:
When thermal mitigation is enabled, align DOM timers to 30ms like we do in low power mode.

* Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:
* Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
(WebCore::transformationMatrixForVideoFrame):
(WebCore::LocalSampleBufferDisplayLayer::enqueueVideoFrame):
(WebCore::videoTransformationMatrix): Deleted.
* Source/WebCore/platform/network/mac/UTIUtilities.mm:
* Source/WebCore/platform/audio/cocoa/AudioUtilitiesCocoa.h:
Unrelated unified sources fixes.

Canonical link: https://commits.webkit.org/267480@main




More information about the webkit-changes mailing list