Skip to content

Commit a90c33d

Browse files
committed
Gate CacheStorageRepresentation IPC behind AllowTestOnlyIPC
rdar://176915104 Reviewed by Per Arne Vollan. Add [EnabledBy=AllowTestOnlyIPC] so the generated dispatcher rejects this message outside of test configurations, matching other test-only endpoints such as GeneralStoragePathForTesting. * Source/WebKit/NetworkProcess/storage/NetworkStorageManager.messages.in: Originally-landed-as: 305413.938@safari-7624-branch (40dbe4d64205). rdar://180437831 Canonical link: https://commits.webkit.org/316201@main
1 parent 4758ac8 commit a90c33d

5 files changed

Lines changed: 7 additions & 2 deletions

File tree

LayoutTests/http/tests/cache-storage/cache-clearing-origin.https.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- webkit-test-runner [ allowTestOnlyIPC=true ] -->
12
<!DOCTYPE html>
23
<html>
34
<head>

LayoutTests/http/tests/cache-storage/cache-origins.https.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- webkit-test-runner [ allowTestOnlyIPC=true ] -->
12
<!DOCTYPE html>
23
<html>
34
<head>

LayoutTests/http/tests/cache-storage/cache-representation.https.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- webkit-test-runner [ useEphemeralSession=true ] -->
1+
<!-- webkit-test-runner [ useEphemeralSession=true allowTestOnlyIPC=true ] -->
22
<!DOCTYPE html>
33
<html>
44
<head>

Source/WebKit/NetworkProcess/storage/NetworkStorageManager.messages.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
CacheStorageRemoveRecords(WebCore::DOMCacheIdentifier cacheIdentifier, WebCore::ResourceRequest request, struct WebCore::CacheQueryOptions options) -> (WebCore::DOMCacheEngine::RecordIdentifiersOrError result)
102102
CacheStoragePutRecords(WebCore::DOMCacheIdentifier cacheIdentifier, Vector<WebCore::DOMCacheEngine::CrossThreadRecord> records) -> (WebCore::DOMCacheEngine::RecordIdentifiersOrError result)
103103
CacheStorageClearMemoryRepresentation(struct WebCore::ClientOrigin origin) -> ()
104-
CacheStorageRepresentation() -> (String representation)
104+
[EnabledBy=AllowTestOnlyIPC] CacheStorageRepresentation() -> (String representation)
105105

106106
ResetQuotaUpdatedBasedOnUsageForTesting(struct WebCore::ClientOrigin origin)
107107
}

Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ServiceWorkerBasic.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,6 +2010,7 @@ - (void)userContentController:(WKUserContentController *)userContentController d
20102010
[WKWebsiteDataStore _allowWebsiteDataRecordsForAllOrigins];
20112011

20122012
RetainPtr configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
2013+
[configuration _setAllowTestOnlyIPC:YES];
20132014
setConfigurationInjectedBundlePath(configuration.get());
20142015

20152016
RetainPtr<DirectoryPageMessageHandler> directoryPageMessageHandler = adoptNS([[DirectoryPageMessageHandler alloc] init]);
@@ -2055,6 +2056,7 @@ - (void)userContentController:(WKUserContentController *)userContentController d
20552056
[WKWebsiteDataStore _allowWebsiteDataRecordsForAllOrigins];
20562057

20572058
RetainPtr configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
2059+
[configuration _setAllowTestOnlyIPC:YES];
20582060
setConfigurationInjectedBundlePath(configuration.get());
20592061
RetainPtr dataStoreConfiguration = adoptNS([_WKWebsiteDataStoreConfiguration new]);
20602062
NSString* tempDirectory = @"/var/tmp";
@@ -5259,6 +5261,7 @@ async function check()
52595261
[[WKWebsiteDataStore defaultDataStore] _setResourceLoadStatisticsEnabled:NO];
52605262

52615263
RetainPtr configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
5264+
[configuration _setAllowTestOnlyIPC:YES];
52625265

52635266
auto context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));
52645267
[configuration setProcessPool:(WKProcessPool *)context.get()];

0 commit comments

Comments
 (0)