[webkit-changes] [WebKit/WebKit] 29231c: Add memory warning simulation to the MemoryPressur...

Ryan Reno noreply at github.com
Thu Aug 3 17:54:43 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 29231ce7a037fa0af2c6d8fe47bafdb23ec7309e
      https://github.com/WebKit/WebKit/commit/29231ce7a037fa0af2c6d8fe47bafdb23ec7309e
  Author: Ryan Reno <rreno at apple.com>
  Date:   2023-08-03 (Thu, 03 Aug 2023)

  Changed paths:
    A LayoutTests/memory/memory-warning-simulation-expected.txt
    A LayoutTests/memory/memory-warning-simulation.html
    M Source/WTF/wtf/MemoryPressureHandler.cpp
    M Source/WTF/wtf/MemoryPressureHandler.h
    M Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl

  Log Message:
  -----------
  Add memory warning simulation to the MemoryPressureHandler
https://bugs.webkit.org/show_bug.cgi?id=259802
rdar://113361130

Reviewed by Simon Fraser.

This adds the ability to simulate a memory warning, complementing the
existing memory pressure simulation facility. Adds both a notification
handler (e.g. notifyutil on macOS) and a JS internals API for layout
tests.

* LayoutTests/memory/memory-warning-simulation-expected.txt: Added.
* LayoutTests/memory/memory-warning-simulation.html: Added.
* Source/WTF/wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::currentMemoryUsagePolicy):
(WTF::MemoryPressureHandler::beginSimulatedMemoryWarning):
(WTF::MemoryPressureHandler::endSimulatedMemoryWarning):
* Source/WTF/wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::isUnderMemoryWarning const):
(WTF::MemoryPressureHandler::isSimulatingMemoryWarning const):
* Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::install):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::isUnderMemoryWarning):
(WebCore::Internals::beginSimulatedMemoryWarning):
(WebCore::Internals::endSimulatedMemoryWarning):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:

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




More information about the webkit-changes mailing list