forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WKWebView SPI to fetch and restore Session Storage data
https://bugs.webkit.org/show_bug.cgi?id=283503 rdar://140356755 Reviewed by Sihui Liu and Wenson Hsieh. Some users may want Session Storage to be restored after a software update. So we want to allow clients (Safari) to fetch this storage and then later restore it. The restoration process will have two parts: 1. Client fetches the session storage data from WebKit and holds onto it. 2. Client gives back the data to WebKit to restore it. This patch adds SPI for fetch and restore--and will eventually go through API review. The SPI works for both ephemeral and persistent data stores, so there is an API test for each. The SPI also works for both first party storage and for third party storage, so there are API tests for each. * Source/WebKit/NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::fetchSessionStorage): (WebKit::NetworkProcess::restoreSessionStorage): * Source/WebKit/NetworkProcess/NetworkProcess.h: * Source/WebKit/NetworkProcess/NetworkProcess.messages.in: * Source/WebKit/NetworkProcess/storage/LocalStorageManager.cpp: (WebKit::LocalStorageManager::setStorageMap): (WebKit::LocalStorageManager::populateStorageArea): Deleted. * Source/WebKit/NetworkProcess/storage/LocalStorageManager.h: * Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::fetchSessionStorageForWebPage): (WebKit::NetworkStorageManager::restoreSessionStorageForWebPage): (WebKit::NetworkStorageManager::restoreLocalStorage): * Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h: * Source/WebKit/NetworkProcess/storage/SessionStorageManager.cpp: (WebKit::SessionStorageManager::fetchStorageMap): (WebKit::SessionStorageManager::setStorageMap): * Source/WebKit/NetworkProcess/storage/SessionStorageManager.h: * Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _fetchDataOfTypes:completionHandler:]): (-[WKWebView _restoreData:completionHandler:]): * Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h: * Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _fetchDataOfTypes:completionHandler:]): (-[WKWebsiteDataStore _restoreData:completionHandler:]): * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::fetchSessionStorage): (WebKit::WebPageProxy::restoreSessionStorage): * Source/WebKit/UIProcess/WebPageProxy.h: * Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchLocalStorage): * Tools/TestWebKitAPI/SourcesCocoa.txt: * Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * Tools/TestWebKitAPI/Tests/WebKitCocoa/RestoreLocalStorage.mm: (TEST(WebKit, RestoreLocalStorageFromPersistentDataStore)): (TEST(WebKit, RestoreLocalStorageFromEphemeralDataStore)): (RestoreLocalStorageFromPersistentDataStoreThirdPartyIFrame)): (RestoreLocalStorageFromEphemeralDataStoreThirdPartyIFrame)): * Tools/TestWebKitAPI/Tests/WebKitCocoa/RestoreSessionStorage.mm: Copied froTools/TestWebKitAPI/Tests/WebKitCocoa/RestoreLocalStorage.mm. (testRestoreSessionStorage): (TEST(WebKit, RestoreSessionStorageFromPersistentDataStore)): (TEST(WebKit, RestoreSessionStorageFromEphemeralDataStore)): (-[RestoreSessionStorageMessageHandler userContentController:didReceiveScriptMessage:]): (postMessage): (item): (RestoreSessionStorageFromPersistentDataStoreThirdPartyIFrame)): (RestoreSessionStorageFromEphemeralDataStoreThirdPartyIFrame)): * Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm: * Tools/TestWebKitAPI/Tests/WebKitCocoa/TextWidth.mm: Canonical link: https://commits.webkit.org/287729@main
- Loading branch information
1 parent
b226a04
commit f52abbb
Showing
21 changed files
with
519 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.