Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6c635bbd1833196a956ee825b51445c775899749
https://github.com/WebKit/WebKit/commit/6c635bbd1833196a956ee825b51445c775899749
Author: Jessica Cheung <[email protected]>
Date: 2025-03-14 (Fri, 14 Mar 2025)
Changed paths:
M Source/WebKit/SourcesCocoa.txt
M Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
A Source/WebKit/UIProcess/WebsiteData/Cocoa/ScreenTimeWebsiteDataSupport.h
A Source/WebKit/UIProcess/WebsiteData/Cocoa/ScreenTimeWebsiteDataSupport.mm
M Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreClient.h
M Source/WebKit/UIProcess/mac/WebColorPickerMac.mm
M Source/WebKit/WebKit.xcodeproj/project.pbxproj
M Tools/TestWebKitAPI/Tests/WebKitCocoa/ScreenTime.mm
Log Message:
-----------
[Screen Time Refactoring] History fetching API does not work unless
WKWebsiteDataStore has a delegate
https://bugs.webkit.org/show_bug.cgi?id=289553
rdar://145017247
Reviewed by Abrar Rahman Protyasha and Aditya Keerthi.
Currently, the implemented getScreenTimeURLs does not get called when
WKWebsiteDataStore does
not have a delegate. Instead, the virtual function for getScreenTimeURLs is
called. Thus, the
current support for Screen Time in fetchDataRecordsOfTypes does not actually
work.
As a consequence, since we never receive any records saying that they have
Screen Time data,
removeDataOfTypes(forDataRecords specifically) also does not work.
Now, we add a ScreenTimeWebsiteDataSupport namespace that contains all the
functions needed
for supporting Screen Time in conjunction with the WKWebsiteDataStore's
fetchDataRecordsOfTypes
and removeDataOfTypes APIs. Due to these new files, WebColorPickerMac.mm has a
build error where
it does not recognize its use of WeakPtr so include WeakPtr.
In addition, add an API test to ensure that the Screen Time's
fetchAllHistoryWithCompletionHandler
API is being called. This tests fails with the old implementation.
Also, remove the old implementation from WebsiteDataStoreClient and replace all
instances of
the old implementation with the working one.
Finally, in WebsiteDataStore.cpp, fix an assertion by making the completion
handler
destructable on any thread. This is due to the problem where
STWebHistory.fetchAllHistoryWithCompletionHandler might not be called and just
deallocates its
block. This can be removed once the fix to
STWebHistory.fetchAllHistoryWithCompletionHandler
goes in.
* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
* Source/WebKit/UIProcess/WebsiteData/Cocoa/ScreenTimeWebsiteDataSupport.h:
Added.
* Source/WebKit/UIProcess/WebsiteData/Cocoa/ScreenTimeWebsiteDataSupport.mm:
Added.
(WebKit::ScreenTimeWebsiteDataSupport::getScreenTimeURLs):
(WebKit::ScreenTimeWebsiteDataSupport::removeScreenTimeData):
(WebKit::ScreenTimeWebsiteDataSupport::removeScreenTimeDataWithInterval):
* Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::removeScreenTimeData): Deleted.
(WebKit::WebsiteDataStore::removeScreenTimeDataWithInterval): Deleted.
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreClient.h:
(WebKit::WebsiteDataStoreClient::getScreenTimeURLs const): Deleted.
* Source/WebKit/UIProcess/mac/WebColorPickerMac.mm:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ScreenTime.mm:
(TEST(ScreenTime, FetchData)):
Canonical link: https://commits.webkit.org/292143@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes