[webkit-changes] [WebKit/WebKit] de4ab2: Add support for the alarms Web Extension API.

Timothy Hatcher noreply at github.com
Wed Aug 9 15:37:22 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: de4ab2c5684f9ed12ea189d1d30aa1499c1207e6
      https://github.com/WebKit/WebKit/commit/de4ab2c5684f9ed12ea189d1d30aa1499c1207e6
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M Source/WebKit/DerivedSources-input.xcfilelist
    M Source/WebKit/DerivedSources-output.xcfilelist
    M Source/WebKit/DerivedSources.make
    A Source/WebKit/Shared/Extensions/WebExtensionAlarmParameters.h
    A Source/WebKit/Shared/Extensions/WebExtensionAlarmParameters.serialization.in
    M Source/WebKit/Sources.txt
    A Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPIAlarmsCocoa.mm
    A Source/WebKit/UIProcess/Extensions/WebExtensionAlarm.cpp
    A Source/WebKit/UIProcess/Extensions/WebExtensionAlarm.h
    M Source/WebKit/UIProcess/Extensions/WebExtensionContext.h
    M Source/WebKit/UIProcess/Extensions/WebExtensionContext.messages.in
    M Source/WebKit/UIProcess/Extensions/WebExtensionController.cpp
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    A Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIAlarmsCocoa.mm
    M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPINamespaceCocoa.mm
    A Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIAlarms.h
    M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPINamespace.h
    A Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPIAlarms.idl
    M Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPINamespace.idl
    M Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.h
    M Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.messages.in
    M Tools/TestWebKitAPI/SourcesCocoa.txt
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    A Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIAlarms.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewGetContents.mm
    M Tools/TestWebKitAPI/cocoa/WebExtensionUtilities.h
    M Tools/TestWebKitAPI/ios/UIKitSPI.h

  Log Message:
  -----------
  Add support for the alarms Web Extension API.
https://webkit.org/b/259950
rdar://problem/113592049

Reviewed by Brian Weinstein.

Implements the browser.alarms namespace and added API tests for all the supported methods.
Documentation: https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/alarms

* Source/WebKit/DerivedSources-input.xcfilelist: Added alarm files.
* Source/WebKit/DerivedSources-output.xcfilelist: Ditto.
* Source/WebKit/DerivedSources.make: Added WebExtensionAPIAlarms interface.
* Source/WebKit/Shared/Extensions/WebExtensionAlarmParameters.h: Added.
* Source/WebKit/Shared/Extensions/WebExtensionAlarmParameters.serialization.in: Added.
* Source/WebKit/Sources.txt: Added alarm files.
* Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPIAlarmsCocoa.mm: Added.
(WebKit::WebExtensionContext::alarmsCreate):
(WebKit::WebExtensionContext::alarmsGet):
(WebKit::WebExtensionContext::alarmsClear):
(WebKit::WebExtensionContext::alarmsGetAll):
(WebKit::WebExtensionContext::alarmsClearAll):
(WebKit::WebExtensionContext::fireAlarmsEventIfNeeded):
* Source/WebKit/UIProcess/Extensions/WebExtensionAlarm.cpp: Added.
(WebKit::WebExtensionAlarm::schedule):
(WebKit::WebExtensionAlarm::fire):
* Source/WebKit/UIProcess/Extensions/WebExtensionAlarm.h: Added.
(WebKit::WebExtensionAlarm::create):
(WebKit::WebExtensionAlarm::WebExtensionAlarm):
(WebKit::WebExtensionAlarm::parameters const):
(WebKit::WebExtensionAlarm::name const):
(WebKit::WebExtensionAlarm::initialInterval const):
(WebKit::WebExtensionAlarm::repeatInterval const):
(WebKit::WebExtensionAlarm::nextScheduledTime const):
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.h:
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.messages.in: Added alarm messages.
* Source/WebKit/UIProcess/Extensions/WebExtensionController.cpp:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj: Added new files.
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIAlarmsCocoa.mm: Added.
(WebKit::toAPI):
(WebKit::WebExtensionAPIAlarms::createAlarm):
(WebKit::WebExtensionAPIAlarms::get):
(WebKit::WebExtensionAPIAlarms::getAll):
(WebKit::WebExtensionAPIAlarms::clear):
(WebKit::WebExtensionAPIAlarms::clearAll):
(WebKit::WebExtensionAPIAlarms::onAlarm):
(WebKit::WebExtensionContextProxy::dispatchAlarmEvent):
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPINamespaceCocoa.mm:
(WebKit::WebExtensionAPINamespace::isPropertyAllowed): Added FIXME and check permissions for alarms too.
(WebKit::WebExtensionAPINamespace::alarms): Added.
* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIAlarms.h: Added.
* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPINamespace.h:
* Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPIAlarms.idl: Added.
* Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPINamespace.idl: Added alarms.
* Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.h:
* Source/WebKit/WebProcess/Extensions/WebExtensionContextProxy.messages.in: Added alarm messages.
* Tools/TestWebKitAPI/SourcesCocoa.txt:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIAlarms.mm: Added.
* Tools/TestWebKitAPI/cocoa/WebExtensionUtilities.h:
(TestWebKitAPI::Util::constructScript): Stop adding semicolons, it can cause mysterious errors.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewGetContents.mm: Use "UIKitSPI.h" since it was conflicting
with <pal/spi/ios/UIKitSPI.h> due to unified sources shifting around.
* Tools/TestWebKitAPI/ios/UIKitSPI.h: Add missing interfaces needed by WKWebViewGetContents.mm.

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




More information about the webkit-changes mailing list