[webkit-changes] [WebKit/WebKit] 79a3c4: Display can go to sleep when camera is on

youennf noreply at github.com
Mon Oct 17 11:02:25 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 79a3c4d8d291353d877baa33fd41bb4c104e2abc
      https://github.com/WebKit/WebKit/commit/79a3c4d8d291353d877baa33fd41bb4c104e2abc
  Author: Youenn Fablet <youennf at gmail.com>
  Date:   2022-10-17 (Mon, 17 Oct 2022)

  Changed paths:
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl
    M Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm
    M Tools/TestWebKitAPI/Tests/WebKit/getDisplayMedia.html
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/GetDisplayMediaWindowAndScreen.mm
    M Tools/TestWebKitAPI/Tests/WebKitLegacy/ios/video-with-audio.html

  Log Message:
  -----------
  Display can go to sleep when camera is on
https://bugs.webkit.org/show_bug.cgi?id=245726
rdar://100423979

Reviewed by Eric Carlson.

In case a document is capturing or screen, it is good to keep the display on so that the preview stays visible.
To do so, the document creates a SleepDisabler when capturing.

Covered by updated API tests.

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::mediaStreamCaptureStateChanged):
(WebCore::Document::canvasChanged):
(WebCore::Document::updateSleepDisablerIfNeeded):
* Source/WebCore/dom/Document.h:
(WebCore::Document::hasSleepDisabler const):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::hasSleepDisabler const):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
* Tools/TestWebKitAPI/Tests/WebKit/SleepDisabler.mm:
(TEST_F):
* Tools/TestWebKitAPI/Tests/WebKit/getDisplayMedia.html:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/GetDisplayMediaWindowAndScreen.mm:
(TestWebKitAPI::TEST):
* Tools/TestWebKitAPI/Tests/WebKitLegacy/ios/video-with-audio.html:

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




More information about the webkit-changes mailing list