Changeset 281832 in webkit
- Timestamp:
- Aug 31, 2021 4:53:15 PM (11 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 47 edited
- 1 copied
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/serialize-sharedarraybuffer-throws.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coep.https-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/IndexedDB (added)
-
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/IndexedDB/serialize-sharedarraybuffer-throws.https-expected.txt (copied) (copied from trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/serialize-sharedarraybuffer-throws.https-expected.txt)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Headers.cmake (modified) (1 diff)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Source/WebCore/dom/CrossOriginMode.h (added)
-
Source/WebCore/dom/ScriptExecutionContext.cpp (modified) (2 diffs)
-
Source/WebCore/dom/ScriptExecutionContext.h (modified) (2 diffs)
-
Source/WebCore/loader/DocumentLoader.cpp (modified) (2 diffs)
-
Source/WebCore/loader/EmptyClients.cpp (modified) (1 diff)
-
Source/WebCore/loader/EmptyFrameLoaderClient.h (modified) (1 diff)
-
Source/WebCore/loader/FrameLoader.cpp (modified) (2 diffs)
-
Source/WebCore/loader/FrameLoader.h (modified) (1 diff)
-
Source/WebCore/loader/FrameLoaderClient.h (modified) (1 diff)
-
Source/WebCore/loader/FrameLoaderTypes.h (modified) (2 diffs)
-
Source/WebCore/page/DOMWindow.cpp (modified) (1 diff)
-
Source/WebCore/page/DOMWindow.idl (modified) (1 diff)
-
Source/WebCore/workers/WorkerGlobalScope.cpp (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Scripts/webkit/messages.py (modified) (1 diff)
-
Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h (modified) (1 diff)
-
Source/WebKit/Shared/WebProcessCreationParameters.cpp (modified) (2 diffs)
-
Source/WebKit/Shared/WebProcessCreationParameters.h (modified) (2 diffs)
-
Source/WebKit/UIProcess/Launcher/ProcessLauncher.h (modified) (1 diff)
-
Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/ProvisionalPageProxy.cpp (modified) (1 diff)
-
Source/WebKit/UIProcess/ProvisionalPageProxy.h (modified) (1 diff)
-
Source/WebKit/UIProcess/SuspendedPageProxy.cpp (modified) (1 diff)
-
Source/WebKit/UIProcess/WebPageProxy.cpp (modified) (3 diffs)
-
Source/WebKit/UIProcess/WebPageProxy.h (modified) (2 diffs)
-
Source/WebKit/UIProcess/WebPageProxy.messages.in (modified) (1 diff)
-
Source/WebKit/UIProcess/WebProcessPool.cpp (modified) (4 diffs)
-
Source/WebKit/UIProcess/WebProcessPool.h (modified) (2 diffs)
-
Source/WebKit/UIProcess/WebProcessProxy.cpp (modified) (5 diffs)
-
Source/WebKit/UIProcess/WebProcessProxy.h (modified) (5 diffs)
-
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (modified) (3 diffs)
-
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h (modified) (1 diff)
-
Source/WebKit/WebProcess/WebProcess.cpp (modified) (2 diffs)
-
Source/WebKitLegacy/mac/ChangeLog (modified) (1 diff)
-
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h (modified) (1 diff)
-
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm (modified) (1 diff)
-
Source/WebKitLegacy/win/ChangeLog (modified) (1 diff)
-
Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp (modified) (1 diff)
-
Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r281830 r281832 1 2021-08-31 Chris Dumez <cdumez@apple.com> 2 3 Enable SharedArrayBuffer support when COOP/COEP headers are used 4 https://bugs.webkit.org/show_bug.cgi?id=229559 5 <rdar://problem/82391945> 6 7 Reviewed by Alex Christensen. 8 9 Rebaseline a few web-platform-tests now that window.crossOriginIsolated properly returns 10 true when COOP+COEP are used. 11 12 Note that SharedArrayBuffer are already forcefully enabled by run-webkit-tests.py when running 13 the layout tests, which is why there are not more layout test results changes. At some point, 14 we should stop forcefully enabling SharedArrayBuffer when running web-platform-tests at least, 15 since WPT tests already make sure to use COOP+COEP when testing SharedArrayBuffer. 16 17 * web-platform-tests/IndexedDB/serialize-sharedarraybuffer-throws.https-expected.txt: 18 * web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https-expected.txt: 19 Note that some subtests are failing because we don't support the Permissions-Policy HTTP header: 20 - https://w3c.github.io/webappsec-permissions-policy/ 21 22 * web-platform-tests/html/cross-origin-opener-policy/coep.https-expected.txt: 23 1 24 2021-08-31 Marcos Caceres <marcos@marcosc.com> 2 25 -
trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/serialize-sharedarraybuffer-throws.https-expected.txt
r280504 r281832 1 1 2 FAIL IndexedDB: Attempting to serialize a SharedArrayBuffer should throw assert_true: The page is served with COOP and COEP, it should be cross-origin-isolated. expected true got false 2 FAIL IndexedDB: Attempting to serialize a SharedArrayBuffer should throw assert_throws_dom: function "() => { 3 rq = objStore.put({sab: sab}, 'key'); 4 }" threw object "DataError: Failed to store record in an IDBObjectStore: The object store uses in-line keys and the key parameter was provided." that is not a DOMException DataCloneError: property "code" is equal to 0, expected 25 3 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https-expected.txt
r281055 r281832 1 1 2 FAIL frame: origin = https://localhost:9443, value = undefined assert_equals: expected true but got false 3 FAIL frame: origin = https://localhost:9443, value = * assert_equals: expected true but got false 4 FAIL frame: origin = https://localhost:9443, value = self assert_equals: expected true but got false 5 PASS frame: origin = https://localhost:9443, value = (\) 6 PASS frame: origin = https://127.0.0.1:9443, value = undefined 7 PASS frame: origin = https://127.0.0.1:9443, value = * 8 PASS frame: origin = https://127.0.0.1:9443, value = self 9 PASS frame: origin = https://127.0.0.1:9443, value = (\) 10 FAIL dedicated worker: scheme = https, value = undefined assert_equals: expected true but got false 11 FAIL dedicated worker: scheme = https, value = * assert_equals: expected true but got false 12 FAIL dedicated worker: scheme = https, value = self assert_equals: expected true but got false 13 PASS dedicated worker: scheme = https, value = (\) 14 PASS dedicated worker: scheme = data, value = undefined 15 PASS dedicated worker: scheme = data, value = * 16 PASS dedicated worker: scheme = data, value = self 17 PASS dedicated worker: scheme = data, value = (\) 18 FAIL dedicated worker: scheme = blob, value = undefined assert_equals: expected true but got false 19 FAIL dedicated worker: scheme = blob, value = * assert_equals: expected true but got false 20 FAIL dedicated worker: scheme = blob, value = self assert_equals: expected true but got false 21 PASS dedicated worker: scheme = blob, value = (\) 2 PASS frame: origin = https://localhost:9443, value = undefined 3 PASS frame: origin = https://localhost:9443, value = * 4 PASS frame: origin = https://localhost:9443, value = self 5 FAIL frame: origin = https://localhost:9443, value = (\) assert_equals: expected false but got true 6 FAIL frame: origin = https://127.0.0.1:9443, value = undefined assert_equals: expected false but got true 7 FAIL frame: origin = https://127.0.0.1:9443, value = * assert_equals: expected false but got true 8 FAIL frame: origin = https://127.0.0.1:9443, value = self assert_equals: expected false but got true 9 FAIL frame: origin = https://127.0.0.1:9443, value = (\) assert_equals: expected false but got true 10 PASS dedicated worker: scheme = https, value = undefined 11 PASS dedicated worker: scheme = https, value = * 12 PASS dedicated worker: scheme = https, value = self 13 FAIL dedicated worker: scheme = https, value = (\) assert_equals: expected false but got true 14 FAIL dedicated worker: scheme = data, value = undefined assert_equals: expected false but got true 15 FAIL dedicated worker: scheme = data, value = * assert_equals: expected false but got true 16 FAIL dedicated worker: scheme = data, value = self assert_equals: expected false but got true 17 FAIL dedicated worker: scheme = data, value = (\) assert_equals: expected false but got true 18 PASS dedicated worker: scheme = blob, value = undefined 19 PASS dedicated worker: scheme = blob, value = * 20 PASS dedicated worker: scheme = blob, value = self 21 FAIL dedicated worker: scheme = blob, value = (\) assert_equals: expected false but got true 22 22 FAIL shared worker: withCoopCoep = false Can't find variable: SharedWorker 23 23 FAIL shared worker: withCoopCoep = true Can't find variable: SharedWorker -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coep.https-expected.txt
r280504 r281832 8 8 PASS Same-origin popup without coep 9 9 PASS historical: "same-site" popup without coep 10 FAIL Bonus: window.crossOriginIsolated assert_true: expected true got false 10 PASS Bonus: window.crossOriginIsolated 11 11 -
trunk/Source/WebCore/ChangeLog
r281831 r281832 1 2021-08-31 Chris Dumez <cdumez@apple.com> 2 3 Enable SharedArrayBuffer support when COOP/COEP headers are used 4 https://bugs.webkit.org/show_bug.cgi?id=229559 5 <rdar://problem/82391945> 6 7 Reviewed by Alex Christensen. 8 9 Make sure window.crossOriginIsolated returns true when COOP=same-origin and 10 COEP=require-corp are used. Also make sure that cross-origin-isolates pages 11 are allowed to use SharedArrayBuffer. 12 13 Change is covered by rebaselined layout tests and new API tests. 14 15 * loader/DocumentLoader.cpp: 16 (WebCore::toNeedsBrowsingContextGroupSwitch): 17 (WebCore::DocumentLoader::responseReceived): 18 * loader/EmptyClients.cpp: 19 (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForResponse): 20 * loader/EmptyFrameLoaderClient.h: 21 * loader/FrameLoader.cpp: 22 (WebCore::FrameLoader::checkContentPolicy): 23 * loader/FrameLoader.h: 24 * loader/FrameLoaderClient.h: 25 * loader/FrameLoaderTypes.h: 26 * page/DOMWindow.cpp: 27 (WebCore::DOMWindow::crossOriginIsolated const): 28 * page/DOMWindow.idl: 29 1 30 2021-08-31 Kate Cheney <katherine_cheney@apple.com> 2 31 -
trunk/Source/WebCore/Headers.cmake
r281808 r281832 435 435 dom/ContainerNode.h 436 436 dom/ContextDestructionObserver.h 437 dom/CrossOriginMode.h 437 438 dom/CustomElementReactionQueue.h 438 439 dom/DOMException.h -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r281808 r281832 1295 1295 4682D2001F79783000C863DB /* StoredCredentialsPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4682D1FF1F79782300C863DB /* StoredCredentialsPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1296 1296 468344E01EDDFAAA00B7795B /* DOMRectList.h in Headers */ = {isa = PBXBuildFile; fileRef = 468344DE1EDDFA5F00B7795B /* DOMRectList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1297 4688EE3C26DD2610002AF5C4 /* CrossOriginMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4688EE3A26DD260C002AF5C4 /* CrossOriginMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1297 1298 469CCCFE269D021C006E0314 /* BroadcastChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 469CCCFC269D0202006E0314 /* BroadcastChannel.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1298 1299 46AAAA3D25D3632000BAF42F /* AudioFileReaderCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 46AAAA3A25D3631400BAF42F /* AudioFileReaderCocoa.h */; }; … … 8336 8337 468344DD1EDDFA5F00B7795B /* DOMRectList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DOMRectList.cpp; sourceTree = "<group>"; }; 8337 8338 468344DE1EDDFA5F00B7795B /* DOMRectList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOMRectList.h; sourceTree = "<group>"; }; 8339 4688EE3A26DD260C002AF5C4 /* CrossOriginMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CrossOriginMode.h; sourceTree = "<group>"; }; 8338 8340 468B8BDE25CC849300F67822 /* JSBaseAudioContextCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSBaseAudioContextCustom.cpp; sourceTree = "<group>"; }; 8339 8341 469CCCFA269D0202006E0314 /* BroadcastChannel.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BroadcastChannel.cpp; sourceTree = "<group>"; }; … … 29872 29874 97627B8B14FB3CEE002CDCA1 /* ContextDestructionObserver.cpp */, 29873 29875 97627B8C14FB3CEE002CDCA1 /* ContextDestructionObserver.h */, 29876 4688EE3A26DD260C002AF5C4 /* CrossOriginMode.h */, 29874 29877 7CF570C62492BD49008EB33C /* CurrentScriptIncrementer.h */, 29875 29878 9B56C9A91C89329A00C456DF /* CustomElementReactionQueue.cpp */, … … 31500 31503 E1C416120F6562FD0092D2FB /* CrossOriginAccessControl.h in Headers */, 31501 31504 4672AA9826B0943300E6EC38 /* CrossOriginEmbedderPolicy.h in Headers */, 31505 4688EE3C26DD2610002AF5C4 /* CrossOriginMode.h in Headers */, 31502 31506 4672AA9926B0943F00E6EC38 /* CrossOriginOpenerPolicy.h in Headers */, 31503 31507 41ABE67B1D0580DB006D862D /* CrossOriginPreflightChecker.h in Headers */, -
trunk/Source/WebCore/dom/ScriptExecutionContext.cpp
r281055 r281832 82 82 using namespace Inspector; 83 83 84 static std::atomic<CrossOriginMode> globalCrossOriginMode { CrossOriginMode::Shared }; 85 84 86 static Lock allScriptExecutionContextsMapLock; 85 87 static HashMap<ScriptExecutionContextIdentifier, ScriptExecutionContext*>& allScriptExecutionContextsMap() WTF_REQUIRES_LOCK(allScriptExecutionContextsMapLock) … … 624 626 #endif 625 627 628 void ScriptExecutionContext::setCrossOriginMode(CrossOriginMode crossOriginMode) 629 { 630 globalCrossOriginMode = crossOriginMode; 631 } 632 633 CrossOriginMode ScriptExecutionContext::crossOriginMode() 634 { 635 return globalCrossOriginMode; 636 } 637 626 638 bool ScriptExecutionContext::postTaskTo(ScriptExecutionContextIdentifier identifier, Task&& task) 627 639 { -
trunk/Source/WebCore/dom/ScriptExecutionContext.h
r281771 r281832 29 29 30 30 #include "ActiveDOMObject.h" 31 #include "CrossOriginMode.h" 31 32 #include "DOMTimer.h" 32 33 #include "PermissionController.h" … … 175 176 virtual void beginLoadingFontSoon(FontLoadRequest&) { } 176 177 178 WEBCORE_EXPORT static void setCrossOriginMode(CrossOriginMode); 179 static CrossOriginMode crossOriginMode(); 180 177 181 void ref() { refScriptExecutionContext(); } 178 182 void deref() { derefScriptExecutionContext(); } -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r281802 r281832 949 949 } 950 950 951 static BrowsingContextGroupSwitchDecision toBrowsingContextGroupSwitchDecision(const std::optional<CrossOriginOpenerPolicyEnforcementResult>& currentCoopEnforcementResult) 952 { 953 if (!currentCoopEnforcementResult || !currentCoopEnforcementResult->needsBrowsingContextGroupSwitch) 954 return BrowsingContextGroupSwitchDecision::StayInGroup; 955 if (currentCoopEnforcementResult->crossOriginOpenerPolicy.value == CrossOriginOpenerPolicyValue::SameOriginPlusCOEP) 956 return BrowsingContextGroupSwitchDecision::NewIsolatedGroup; 957 return BrowsingContextGroupSwitchDecision::NewSharedGroup; 958 } 959 951 960 void DocumentLoader::responseReceived(const ResourceResponse& response, CompletionHandler<void()>&& completionHandler) 952 961 { … … 1049 1058 mainResourceLoader->markInAsyncResponsePolicyCheck(); 1050 1059 auto requestIdentifier = PolicyCheckIdentifier::create(); 1051 bool needsBrowsingContextGroupSwitch = m_currentCoopEnforcementResult && m_currentCoopEnforcementResult->needsBrowsingContextGroupSwitch;1052 frameLoader()->checkContentPolicy(m_response, requestIdentifier, needsBrowsingContextGroupSwitch, [this, protectedThis = makeRef(*this), mainResourceLoader = WTFMove(mainResourceLoader),1060 auto browsingContextGroupSwitchDecision = toBrowsingContextGroupSwitchDecision(m_currentCoopEnforcementResult); 1061 frameLoader()->checkContentPolicy(m_response, requestIdentifier, browsingContextGroupSwitchDecision, [this, protectedThis = makeRef(*this), mainResourceLoader = WTFMove(mainResourceLoader), 1053 1062 completionHandler = completionHandlerCaller.release(), requestIdentifier] (PolicyAction policy, PolicyCheckIdentifier responseIdentifier) mutable { 1054 1063 RELEASE_ASSERT(responseIdentifier.isValidFor(requestIdentifier)); -
trunk/Source/WebCore/loader/EmptyClients.cpp
r281818 r281832 818 818 } 819 819 820 void EmptyFrameLoaderClient::dispatchDecidePolicyForResponse(const ResourceResponse&, const ResourceRequest&, PolicyCheckIdentifier, const String&, bool, FramePolicyFunction&&)820 void EmptyFrameLoaderClient::dispatchDecidePolicyForResponse(const ResourceResponse&, const ResourceRequest&, PolicyCheckIdentifier, const String&, BrowsingContextGroupSwitchDecision, FramePolicyFunction&&) 821 821 { 822 822 } -
trunk/Source/WebCore/loader/EmptyFrameLoaderClient.h
r281516 r281832 97 97 void dispatchShow() final; 98 98 99 void dispatchDecidePolicyForResponse(const ResourceResponse&, const ResourceRequest&, PolicyCheckIdentifier, const String&, bool needsBrowsingContextGroupSwitch, FramePolicyFunction&&) final;99 void dispatchDecidePolicyForResponse(const ResourceResponse&, const ResourceRequest&, PolicyCheckIdentifier, const String&, BrowsingContextGroupSwitchDecision, FramePolicyFunction&&) final; 100 100 void dispatchDecidePolicyForNewWindowAction(const NavigationAction&, const ResourceRequest&, FormState*, const String&, PolicyCheckIdentifier, FramePolicyFunction&&) final; 101 101 void dispatchDecidePolicyForNavigationAction(const NavigationAction&, const ResourceRequest&, const ResourceResponse& redirectResponse, FormState*, PolicyDecisionMode, PolicyCheckIdentifier, FramePolicyFunction&&) final; -
trunk/Source/WebCore/loader/FrameLoader.cpp
r281817 r281832 414 414 } 415 415 416 void FrameLoader::checkContentPolicy(const ResourceResponse& response, PolicyCheckIdentifier identifier, bool needsBrowsingContextGroupSwitch, ContentPolicyDecisionFunction&& function)416 void FrameLoader::checkContentPolicy(const ResourceResponse& response, PolicyCheckIdentifier identifier, BrowsingContextGroupSwitchDecision browsingContextGroupSwitchDecision, ContentPolicyDecisionFunction&& function) 417 417 { 418 418 if (!activeDocumentLoader()) { … … 423 423 424 424 // FIXME: Validate the policy check identifier. 425 client().dispatchDecidePolicyForResponse(response, activeDocumentLoader()->request(), identifier, activeDocumentLoader()->downloadAttribute(), needsBrowsingContextGroupSwitch, WTFMove(function));425 client().dispatchDecidePolicyForResponse(response, activeDocumentLoader()->request(), identifier, activeDocumentLoader()->downloadAttribute(), browsingContextGroupSwitchDecision, WTFMove(function)); 426 426 } 427 427 -
trunk/Source/WebCore/loader/FrameLoader.h
r281516 r281832 221 221 void setDefersLoading(bool); 222 222 223 void checkContentPolicy(const ResourceResponse&, PolicyCheckIdentifier, bool needsBrowsingContextGroupSwitch, ContentPolicyDecisionFunction&&);223 void checkContentPolicy(const ResourceResponse&, PolicyCheckIdentifier, BrowsingContextGroupSwitchDecision, ContentPolicyDecisionFunction&&); 224 224 225 225 void didExplicitOpen(); -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r281516 r281832 191 191 virtual void dispatchShow() = 0; 192 192 193 virtual void dispatchDecidePolicyForResponse(const ResourceResponse&, const ResourceRequest&, PolicyCheckIdentifier, const String& downloadAttribute, bool needsBrowsingContextGroupSwitch, FramePolicyFunction&&) = 0;193 virtual void dispatchDecidePolicyForResponse(const ResourceResponse&, const ResourceRequest&, PolicyCheckIdentifier, const String& downloadAttribute, BrowsingContextGroupSwitchDecision, FramePolicyFunction&&) = 0; 194 194 virtual void dispatchDecidePolicyForNewWindowAction(const NavigationAction&, const ResourceRequest&, FormState*, const String& frameName, PolicyCheckIdentifier, FramePolicyFunction&&) = 0; 195 195 virtual void dispatchDecidePolicyForNavigationAction(const NavigationAction&, const ResourceRequest&, const ResourceResponse& redirectResponse, FormState*, PolicyDecisionMode, PolicyCheckIdentifier, FramePolicyFunction&&) = 0; -
trunk/Source/WebCore/loader/FrameLoaderTypes.h
r280870 r281832 168 168 }; 169 169 170 enum class BrowsingContextGroupSwitchDecision : uint8_t { 171 StayInGroup, 172 NewSharedGroup, 173 NewIsolatedGroup, 174 }; 175 170 176 // Passed to FrameLoader::urlSelected() and ScriptController::executeIfJavaScriptURL() 171 177 // to control whether, in the case of a JavaScript URL, executeIfJavaScriptURL() should … … 277 283 }; 278 284 285 template<> struct EnumTraits<WebCore::BrowsingContextGroupSwitchDecision> { 286 using values = EnumValues< 287 WebCore::BrowsingContextGroupSwitchDecision, 288 WebCore::BrowsingContextGroupSwitchDecision::StayInGroup, 289 WebCore::BrowsingContextGroupSwitchDecision::NewSharedGroup, 290 WebCore::BrowsingContextGroupSwitchDecision::NewIsolatedGroup 291 >; 292 }; 293 279 294 template<> struct EnumTraits<WebCore::ShouldOpenExternalURLsPolicy> { 280 295 using values = EnumValues< -
trunk/Source/WebCore/page/DOMWindow.cpp
r281808 r281832 1925 1925 bool DOMWindow::crossOriginIsolated() const 1926 1926 { 1927 // FIXME: Implemented this. This should return true if COOP/COEP are used and the page is allowed to use APIs 1928 // that require cross-origin isolation (e.g. SharedArrayBuffer). 1929 return false; 1927 ASSERT(ScriptExecutionContext::crossOriginMode() == CrossOriginMode::Shared || !document() || document()->topDocument().crossOriginOpenerPolicy().value == CrossOriginOpenerPolicyValue::SameOriginPlusCOEP); 1928 return ScriptExecutionContext::crossOriginMode() == CrossOriginMode::Isolated; 1930 1929 } 1931 1930 -
trunk/Source/WebCore/page/DOMWindow.idl
r281808 r281832 80 80 // FIXME: This is specified to be [SecureContext] 81 81 readonly attribute DOMApplicationCache applicationCache; 82 // FIXME: Implement 'originIsolated'83 // readonly attribute boolean originIsolated;84 82 85 83 // user prompts -
trunk/Source/WebCore/workers/WorkerGlobalScope.cpp
r281808 r281832 587 587 bool WorkerGlobalScope::crossOriginIsolated() const 588 588 { 589 // FIXME: Implemented this. This should return true if COOP/COEP are used and the page is allowed to use APIs 590 // that require cross-origin isolation (e.g. SharedArrayBuffer). 591 return false; 589 return ScriptExecutionContext::crossOriginMode() == CrossOriginMode::Isolated; 592 590 } 593 591 -
trunk/Source/WebKit/ChangeLog
r281831 r281832 1 2021-08-31 Chris Dumez <cdumez@apple.com> 2 3 Enable SharedArrayBuffer support when COOP/COEP headers are used 4 https://bugs.webkit.org/show_bug.cgi?id=229559 5 <rdar://problem/82391945> 6 7 Reviewed by Alex Christensen. 8 9 Make sure window.crossOriginIsolated returns true when COOP=same-origin and 10 COEP=require-corp are used. Also make sure that cross-origin-isolates pages 11 are allowed to use SharedArrayBuffer. 12 13 When the WebProcess determines it needs to switch browsing context group it 14 now sends a NeedsBrowsingContextGroupSwitch::YesWithoutCrossOriginIsolation / 15 NeedsBrowsingContextGroupSwitch::YesWithCrossOriginIsolation enum value to 16 the UIProcess with the DecidePolicyForResponse IPC instead of a simple 17 boolean. We send YesWithoutCrossOriginIsolation when the navigation 18 destination will be cross-origin-isolated due to COOP=same-origin and 19 COEP=require-corp. In the UIProcess, when YesWithCrossOriginIsolation is 20 received, we take care of launching a fresh WebProcess (never recycling an 21 existing WebProcess) and we make this WebProcess as cross-origin-isolated. 22 When a process is cross-origin-isolated, we pass it a XPC flag on launch 23 to allow the process to use SharedArrayBuffer. We use an XPC flag because 24 JSC Options need to be set before JSC::initialize() is called, which occurs 25 during XPC service initialization. When a WebProcess is marked as 26 cross-origin-isolated, we make sure to never cache it so it cannot be 27 recycled for a new navigation (given that it has special permission to use 28 SharedArrayBuffer). 29 30 * Scripts/webkit/messages.py: 31 (headers_for_type): 32 * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h: 33 (WebKit::XPCServiceInitializer): 34 * UIProcess/Launcher/ProcessLauncher.h: 35 (WebKit::ProcessLauncher::Client::shouldEnableSharedArrayBuffer const): 36 * UIProcess/Launcher/mac/ProcessLauncherMac.mm: 37 (WebKit::ProcessLauncher::launchProcess): 38 * UIProcess/ProvisionalPageProxy.cpp: 39 (WebKit::ProvisionalPageProxy::decidePolicyForResponse): 40 * UIProcess/ProvisionalPageProxy.h: 41 * UIProcess/SuspendedPageProxy.cpp: 42 (WebKit::SuspendedPageProxy::findReusableSuspendedPageProcess): 43 * UIProcess/WebPageProxy.cpp: 44 (WebKit::WebPageProxy::decidePolicyForResponse): 45 (WebKit::WebPageProxy::decidePolicyForResponseShared): 46 * UIProcess/WebPageProxy.h: 47 * UIProcess/WebPageProxy.messages.in: 48 * UIProcess/WebProcessPool.cpp: 49 (WebKit::WebProcessPool::createNewWebProcess): 50 (WebKit::WebProcessPool::createWebPage): 51 * UIProcess/WebProcessPool.h: 52 * UIProcess/WebProcessProxy.cpp: 53 (WebKit::WebProcessProxy::create): 54 (WebKit::WebProcessProxy::createForServiceWorkers): 55 (WebKit::WebProcessProxy::WebProcessProxy): 56 (WebKit::WebProcessProxy::canBeAddedToWebProcessCache const): 57 * UIProcess/WebProcessProxy.h: 58 (WebKit::WebProcessProxy::isCrossOriginIsolated const): 59 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 60 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): 61 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 62 1 63 2021-08-31 Kate Cheney <katherine_cheney@apple.com> 2 64 -
trunk/Source/WebKit/Scripts/webkit/messages.py
r281732 r281832 688 688 'PAL::SessionID': ['<pal/SessionID.h>'], 689 689 'WebCore::AutoplayEventFlags': ['<WebCore/AutoplayEvent.h>'], 690 'WebCore::BrowsingContextGroupSwitchDecision': ['<WebCore/FrameLoaderTypes.h>'], 690 691 'WebCore::CreateNewGroupForHighlight': ['<WebCore/AppHighlight.h>'], 691 692 'WebCore::DOMPasteAccessResponse': ['<WebCore/DOMPasteAccess.h>'], -
trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h
r279890 r281832 93 93 if (xpc_dictionary_get_bool(initializerMessage, "disable-jit")) 94 94 JSC::ExecutableAllocator::setJITEnabled(false); 95 if (xpc_dictionary_get_bool(initializerMessage, "enable-shared-array-buffer")) { 96 JSC::Options::initialize(); 97 JSC::Options::AllowUnfinalizedAccessScope scope; 98 JSC::Options::useSharedArrayBuffer() = true; 99 } 95 100 } 96 101 -
trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp
r281277 r281832 123 123 encoder << attrStyleEnabled; 124 124 encoder << shouldThrowExceptionForGlobalConstantRedeclaration; 125 encoder << crossOriginMode; 125 126 126 127 #if ENABLE(SERVICE_CONTROLS) … … 390 391 if (!decoder.decode(parameters.shouldThrowExceptionForGlobalConstantRedeclaration)) 391 392 return false; 393 if (!decoder.decode(parameters.crossOriginMode)) 394 return false; 392 395 393 396 #if ENABLE(SERVICE_CONTROLS) -
trunk/Source/WebKit/Shared/WebProcessCreationParameters.h
r281277 r281832 32 32 #include "UserData.h" 33 33 #include "WebProcessDataStoreParameters.h" 34 #include <WebCore/CrossOriginMode.h> 34 35 #include <wtf/HashMap.h> 35 36 #include <wtf/ProcessID.h> … … 136 137 bool attrStyleEnabled { false }; 137 138 bool shouldThrowExceptionForGlobalConstantRedeclaration { true }; 139 WebCore::CrossOriginMode crossOriginMode { WebCore::CrossOriginMode::Shared }; // Cross-origin isolation via COOP+COEP headers. 138 140 139 141 #if ENABLE(SERVICE_CONTROLS) -
trunk/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h
r272882 r281832 62 62 virtual bool shouldConfigureJSCForTesting() const { return false; } 63 63 virtual bool isJITEnabled() const { return true; } 64 virtual bool shouldEnableSharedArrayBuffer() const { return false; } 64 65 #if PLATFORM(COCOA) 65 66 virtual RefPtr<XPCEventHandler> xpcEventHandler() const { return nullptr; } -
trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm
r280811 r281832 206 206 if (!m_client->isJITEnabled()) 207 207 xpc_dictionary_set_bool(bootstrapMessage.get(), "disable-jit", true); 208 if (m_client->shouldEnableSharedArrayBuffer()) 209 xpc_dictionary_set_bool(bootstrapMessage.get(), "enable-shared-array-buffer", true); 208 210 } 209 211 -
trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
r281817 r281832 331 331 } 332 332 333 void ProvisionalPageProxy::decidePolicyForResponse(FrameIdentifier frameID, FrameInfoData&& frameInfo, WebCore::PolicyCheckIdentifier identifier, uint64_t navigationID, const WebCore::ResourceResponse& response, const WebCore::ResourceRequest& request, bool canShowMIMEType, const String& downloadAttribute, bool wasAllowedByInjectedBundle, bool needsBrowsingContextGroupSwitch, uint64_t mainResourceLoadIdentifier, uint64_t listenerID, const UserData& userData)333 void ProvisionalPageProxy::decidePolicyForResponse(FrameIdentifier frameID, FrameInfoData&& frameInfo, WebCore::PolicyCheckIdentifier identifier, uint64_t navigationID, const WebCore::ResourceResponse& response, const WebCore::ResourceRequest& request, bool canShowMIMEType, const String& downloadAttribute, bool wasAllowedByInjectedBundle, BrowsingContextGroupSwitchDecision browsingContextGroupSwitchDecision, uint64_t mainResourceLoadIdentifier, uint64_t listenerID, const UserData& userData) 334 334 { 335 335 if (!validateInput(frameID, navigationID)) 336 336 return; 337 337 338 m_page.decidePolicyForResponseShared(m_process.copyRef(), m_webPageID, frameID, WTFMove(frameInfo), identifier, navigationID, response, request, canShowMIMEType, downloadAttribute, wasAllowedByInjectedBundle, needsBrowsingContextGroupSwitch, mainResourceLoadIdentifier, listenerID, userData);338 m_page.decidePolicyForResponseShared(m_process.copyRef(), m_webPageID, frameID, WTFMove(frameInfo), identifier, navigationID, response, request, canShowMIMEType, downloadAttribute, wasAllowedByInjectedBundle, browsingContextGroupSwitchDecision, mainResourceLoadIdentifier, listenerID, userData); 339 339 } 340 340 -
trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.h
r281706 r281832 126 126 127 127 void decidePolicyForNavigationActionAsync(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&, FrameInfoData&& originatingFrameInfo, std::optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody, WebCore::ResourceResponse&& redirectResponse, const UserData&, uint64_t listenerID); 128 void decidePolicyForResponse(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, bool wasAllowedByInjectedBundle, bool needsBrowsingContextGroupSwitch, uint64_t listenerID, uint64_t mainResourceLoadIdentifier, const UserData&);128 void decidePolicyForResponse(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, bool wasAllowedByInjectedBundle, WebCore::BrowsingContextGroupSwitchDecision, uint64_t listenerID, uint64_t mainResourceLoadIdentifier, const UserData&); 129 129 void didChangeProvisionalURLForFrame(WebCore::FrameIdentifier, uint64_t navigationID, URL&&); 130 130 void didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, WebCore::FrameIdentifier); -
trunk/Source/WebKit/UIProcess/SuspendedPageProxy.cpp
r278253 r281832 55 55 for (auto* suspendedPage : allSuspendedPages()) { 56 56 auto& process = suspendedPage->process(); 57 if (&process.processPool() == &processPool && process.registrableDomain() == registrableDomain && &process.websiteDataStore() == &dataStore )57 if (&process.processPool() == &processPool && process.registrableDomain() == registrableDomain && &process.websiteDataStore() == &dataStore && process.crossOriginMode() != CrossOriginMode::Isolated) 58 58 return &process; 59 59 } -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r281817 r281832 5621 5621 void WebPageProxy::decidePolicyForResponse(FrameIdentifier frameID, FrameInfoData&& frameInfo, PolicyCheckIdentifier identifier, 5622 5622 uint64_t navigationID, const ResourceResponse& response, const ResourceRequest& request, bool canShowMIMEType, const String& downloadAttribute, 5623 bool wasAllowedByInjectedBundle, bool needsBrowsingContextGroupSwitch, uint64_t mainResourceLoadIdentifier, uint64_t listenerID, const UserData& userData)5624 { 5625 decidePolicyForResponseShared(m_process.copyRef(), m_webPageID, frameID, WTFMove(frameInfo), identifier, navigationID, response, request, canShowMIMEType, downloadAttribute, wasAllowedByInjectedBundle, needsBrowsingContextGroupSwitch, mainResourceLoadIdentifier, listenerID, userData);5626 } 5627 5628 void WebPageProxy::decidePolicyForResponseShared(Ref<WebProcessProxy>&& process, PageIdentifier webPageID, FrameIdentifier frameID, FrameInfoData&& frameInfo, PolicyCheckIdentifier identifier, uint64_t navigationID, const ResourceResponse& response, const ResourceRequest& request, bool canShowMIMEType, const String& downloadAttribute, bool wasAllowedByInjectedBundle, bool needsBrowsingContextGroupSwitch, uint64_t mainResourceLoadIdentifier, uint64_t listenerID, const UserData& userData)5623 bool wasAllowedByInjectedBundle, BrowsingContextGroupSwitchDecision browsingContextGroupSwitchDecision, uint64_t mainResourceLoadIdentifier, uint64_t listenerID, const UserData& userData) 5624 { 5625 decidePolicyForResponseShared(m_process.copyRef(), m_webPageID, frameID, WTFMove(frameInfo), identifier, navigationID, response, request, canShowMIMEType, downloadAttribute, wasAllowedByInjectedBundle, browsingContextGroupSwitchDecision, mainResourceLoadIdentifier, listenerID, userData); 5626 } 5627 5628 void WebPageProxy::decidePolicyForResponseShared(Ref<WebProcessProxy>&& process, PageIdentifier webPageID, FrameIdentifier frameID, FrameInfoData&& frameInfo, PolicyCheckIdentifier identifier, uint64_t navigationID, const ResourceResponse& response, const ResourceRequest& request, bool canShowMIMEType, const String& downloadAttribute, bool wasAllowedByInjectedBundle, BrowsingContextGroupSwitchDecision browsingContextGroupSwitchDecision, uint64_t mainResourceLoadIdentifier, uint64_t listenerID, const UserData& userData) 5629 5629 { 5630 5630 PageClientProtector protector(pageClient()); … … 5639 5639 auto navigationResponse = API::NavigationResponse::create(API::FrameInfo::create(WTFMove(frameInfo), this).get(), request, response, canShowMIMEType, downloadAttribute); 5640 5640 5641 auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), webPageID, frameID, needsBrowsingContextGroupSwitch, mainResourceLoadIdentifier, identifier, listenerID, navigation = WTFMove(navigation),5641 auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), webPageID, frameID, browsingContextGroupSwitchDecision, mainResourceLoadIdentifier, identifier, listenerID, navigation = WTFMove(navigation), 5642 5642 process, navigationResponse] (PolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, std::optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain) mutable { 5643 5643 // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away. … … 5650 5650 5651 5651 auto willContinueLoadInNewProcess = WillContinueLoadInNewProcess::No; 5652 if (policyAction == PolicyAction::Use && needsBrowsingContextGroupSwitch && navigation) { 5653 RegistrableDomain responseDomain { navigationResponse->response().url() }; 5654 // Avoid process-swapping in cases where the process only contains a single page and is origin-clean. 5655 if (process->pageCount() > 1 || (process->optionalRegistrableDomain() && *process->optionalRegistrableDomain() != responseDomain)) { 5656 WEBPAGEPROXY_RELEASE_LOG(ProcessSwapping, "decidePolicyForResponseShared: Process-swapping due to Cross-Origin-Opener-Policy"); 5657 websiteDataStore().networkProcess().prepareLoadForWebProcessTransfer(process->coreProcessIdentifier(), mainResourceLoadIdentifier, [this, protectedThis = WTFMove(protectedThis), responseDomain = WTFMove(responseDomain), navigation, navigationResponse = WTFMove(navigationResponse), sender = WTFMove(sender)](auto existingNetworkResourceLoadIdentifierToResume) mutable { 5658 auto processForNavigation = m_process->processPool().processForRegistrableDomain(websiteDataStore(), this, responseDomain); 5659 continueNavigationInNewProcess(*navigation, nullptr, WTFMove(processForNavigation), ProcessSwapRequestedByClient::No, ShouldTreatAsContinuingLoad::YesAfterResponsePolicyDecision, nullptr, existingNetworkResourceLoadIdentifierToResume); 5660 5661 receivedPolicyDecision(PolicyAction::Ignore, navigation.get(), nullptr, WTFMove(navigationResponse), WTFMove(sender), { }, WillContinueLoadInNewProcess::Yes); 5662 }); 5663 return; 5664 } 5652 if (policyAction == PolicyAction::Use && browsingContextGroupSwitchDecision != BrowsingContextGroupSwitchDecision::StayInGroup && navigation) { 5653 WEBPAGEPROXY_RELEASE_LOG(ProcessSwapping, "decidePolicyForResponseShared: Process-swapping due to Cross-Origin-Opener-Policy, newProcessIsCrossOriginIsolated=%d", browsingContextGroupSwitchDecision == BrowsingContextGroupSwitchDecision::NewIsolatedGroup); 5654 websiteDataStore().networkProcess().prepareLoadForWebProcessTransfer(process->coreProcessIdentifier(), mainResourceLoadIdentifier, [this, protectedThis = WTFMove(protectedThis), navigation, navigationResponse = WTFMove(navigationResponse), sender = WTFMove(sender), browsingContextGroupSwitchDecision](auto existingNetworkResourceLoadIdentifierToResume) mutable { 5655 RefPtr<WebProcessProxy> processForNavigation; 5656 if (browsingContextGroupSwitchDecision == BrowsingContextGroupSwitchDecision::NewIsolatedGroup) 5657 processForNavigation = m_process->processPool().createNewWebProcess(&websiteDataStore(), WebProcessProxy::IsPrewarmed::No, CrossOriginMode::Isolated); 5658 else { 5659 ASSERT(browsingContextGroupSwitchDecision == BrowsingContextGroupSwitchDecision::NewSharedGroup); 5660 RegistrableDomain responseDomain { navigationResponse->response().url() }; 5661 processForNavigation = m_process->processPool().processForRegistrableDomain(websiteDataStore(), this, responseDomain); 5662 } 5663 continueNavigationInNewProcess(*navigation, nullptr, processForNavigation.releaseNonNull(), ProcessSwapRequestedByClient::No, ShouldTreatAsContinuingLoad::YesAfterResponsePolicyDecision, nullptr, existingNetworkResourceLoadIdentifierToResume); 5664 5665 receivedPolicyDecision(PolicyAction::Ignore, navigation.get(), nullptr, WTFMove(navigationResponse), WTFMove(sender), { }, WillContinueLoadInNewProcess::Yes); 5666 }); 5667 return; 5665 5668 } 5666 5669 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r281817 r281832 1744 1744 void didChangeProvisionalURLForFrameShared(Ref<WebProcessProxy>&&, WebCore::FrameIdentifier, uint64_t navigationID, URL&&); 1745 1745 void decidePolicyForNavigationActionAsyncShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, WebCore::FrameIdentifier, FrameInfoData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&, FrameInfoData&& originatingFrameInfo, std::optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody, WebCore::ResourceResponse&& redirectResponse, const UserData&, uint64_t listenerID); 1746 void decidePolicyForResponseShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, WebCore::FrameIdentifier, FrameInfoData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, bool wasAllowedByInjectedBundle, bool needsBrowsingContextGroupSwitch, uint64_t mainResourceLoadIdentifier, uint64_t listenerID, const UserData&);1746 void decidePolicyForResponseShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, WebCore::FrameIdentifier, FrameInfoData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, bool wasAllowedByInjectedBundle, WebCore::BrowsingContextGroupSwitchDecision, uint64_t mainResourceLoadIdentifier, uint64_t listenerID, const UserData&); 1747 1747 void startURLSchemeTaskShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, URLSchemeTaskParameters&&); 1748 1748 void loadDataWithNavigationShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, API::Navigation&, const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, std::optional<NavigatingToAppBoundDomain>, std::optional<WebsitePoliciesData>&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::SubstituteData::SessionHistoryVisibility); … … 2065 2065 WebCore::ResourceRequest&&, const String& frameName, uint64_t listenerID, const UserData&); 2066 2066 void decidePolicyForResponse(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, 2067 const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, bool wasAllowedByInjectedBundle, bool needsBrowsingContextGroupSwitch, uint64_t mainResourceLoadIdentifier, uint64_t listenerID, const UserData&);2067 const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, bool wasAllowedByInjectedBundle, WebCore::BrowsingContextGroupSwitchDecision, uint64_t mainResourceLoadIdentifier, uint64_t listenerID, const UserData&); 2068 2068 void unableToImplementPolicy(WebCore::FrameIdentifier, const WebCore::ResourceError&, const UserData&); 2069 2069 void beginSafeBrowsingCheck(const URL&, bool, WebFramePolicyListenerProxy&); -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r281771 r281832 108 108 109 109 # Policy messages 110 DecidePolicyForResponse(WebCore::FrameIdentifier frameID, struct WebKit::FrameInfoData frameInfo, WebCore::PolicyCheckIdentifier policyCheckIdentifier, uint64_t navigationID, WebCore::ResourceResponse response, WebCore::ResourceRequest request, bool canShowMIMEType, String downloadAttribute, bool wasAllowedByInjectedBundle, bool needsBrowsingContextGroupSwitch, uint64_t mainResourceLoadIdentifier, uint64_t listenerID, WebKit::UserData userData)110 DecidePolicyForResponse(WebCore::FrameIdentifier frameID, struct WebKit::FrameInfoData frameInfo, WebCore::PolicyCheckIdentifier policyCheckIdentifier, uint64_t navigationID, WebCore::ResourceResponse response, WebCore::ResourceRequest request, bool canShowMIMEType, String downloadAttribute, bool wasAllowedByInjectedBundle, enum:uint8_t WebCore::BrowsingContextGroupSwitchDecision browsingContextGroupSwitchDecision, uint64_t mainResourceLoadIdentifier, uint64_t listenerID, WebKit::UserData userData) 111 111 DecidePolicyForNavigationActionAsync(WebCore::FrameIdentifier frameID, struct WebKit::FrameInfoData frameInfo, WebCore::PolicyCheckIdentifier policyCheckIdentifier, uint64_t navigationID, struct WebKit::NavigationActionData navigationActionData, struct WebKit::FrameInfoData originatingFrameInfoData, std::optional<WebKit::WebPageProxyIdentifier> originatingPageID, WebCore::ResourceRequest originalRequest, WebCore::ResourceRequest request, IPC::FormDataReference requestBody, WebCore::ResourceResponse redirectResponse, WebKit::UserData userData, uint64_t listenerID) 112 112 DecidePolicyForNavigationActionSync(WebCore::FrameIdentifier frameID, bool isMainFrame, struct WebKit::FrameInfoData frameInfo, WebCore::PolicyCheckIdentifier policyCheckIdentifier, uint64_t navigationID, struct WebKit::NavigationActionData navigationActionData, struct WebKit::FrameInfoData originatingFrameInfoData, std::optional<WebKit::WebPageProxyIdentifier> originatingPageID, WebCore::ResourceRequest originalRequest, WebCore::ResourceRequest request, IPC::FormDataReference requestBody, WebCore::ResourceResponse redirectResponse, WebKit::UserData userData) -> (struct WebKit::PolicyDecision PolicyDecision) Synchronous -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r281277 r281832 597 597 } 598 598 599 Ref<WebProcessProxy> WebProcessPool::createNewWebProcess(WebsiteDataStore* websiteDataStore, WebProcessProxy::IsPrewarmed isPrewarmed )599 Ref<WebProcessProxy> WebProcessPool::createNewWebProcess(WebsiteDataStore* websiteDataStore, WebProcessProxy::IsPrewarmed isPrewarmed, CrossOriginMode crossOriginMode) 600 600 { 601 601 #if PLATFORM(COCOA) … … 605 605 #endif 606 606 607 auto processProxy = WebProcessProxy::create(*this, websiteDataStore, isPrewarmed );607 auto processProxy = WebProcessProxy::create(*this, websiteDataStore, isPrewarmed, crossOriginMode); 608 608 initializeNewWebProcess(processProxy, websiteDataStore, isPrewarmed); 609 609 m_processes.append(processProxy.copyRef()); … … 804 804 parameters.attrStyleEnabled = m_configuration->attrStyleEnabled(); 805 805 parameters.shouldThrowExceptionForGlobalConstantRedeclaration = m_configuration->shouldThrowExceptionForGlobalConstantRedeclaration(); 806 parameters.crossOriginMode = process.crossOriginMode(); 806 807 807 808 #if ENABLE(SERVICE_CONTROLS) … … 1052 1053 process = dummyProcessProxy(pageConfiguration->websiteDataStore()->sessionID()); 1053 1054 if (!process) { 1054 process = WebProcessProxy::create(*this, pageConfiguration->websiteDataStore(), WebProcessProxy::IsPrewarmed::No, WebProcessProxy::ShouldLaunchProcess::No);1055 process = WebProcessProxy::create(*this, pageConfiguration->websiteDataStore(), WebProcessProxy::IsPrewarmed::No, CrossOriginMode::Shared, WebProcessProxy::ShouldLaunchProcess::No); 1055 1056 m_dummyProcessProxies.add(pageConfiguration->websiteDataStore()->sessionID(), makeWeakPtr(*process)); 1056 1057 m_processes.append(*process); -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r281070 r281832 515 515 #endif 516 516 517 Ref<WebProcessProxy> createNewWebProcess(WebsiteDataStore*, WebProcessProxy::IsPrewarmed = WebProcessProxy::IsPrewarmed::No, WebCore::CrossOriginMode = WebCore::CrossOriginMode::Shared); 518 517 519 private: 518 520 void platformInitialize(); … … 525 527 RefPtr<WebProcessProxy> tryTakePrewarmedProcess(WebsiteDataStore&); 526 528 527 Ref<WebProcessProxy> createNewWebProcess(WebsiteDataStore*, WebProcessProxy::IsPrewarmed = WebProcessProxy::IsPrewarmed::No);528 529 void initializeNewWebProcess(WebProcessProxy&, WebsiteDataStore*, WebProcessProxy::IsPrewarmed = WebProcessProxy::IsPrewarmed::No); 529 530 -
trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp
r281007 r281832 148 148 } 149 149 150 Ref<WebProcessProxy> WebProcessProxy::create(WebProcessPool& processPool, WebsiteDataStore* websiteDataStore, IsPrewarmed isPrewarmed, ShouldLaunchProcess shouldLaunchProcess)151 { 152 auto proxy = adoptRef(*new WebProcessProxy(processPool, websiteDataStore, isPrewarmed ));150 Ref<WebProcessProxy> WebProcessProxy::create(WebProcessPool& processPool, WebsiteDataStore* websiteDataStore, IsPrewarmed isPrewarmed, CrossOriginMode crossOriginMode, ShouldLaunchProcess shouldLaunchProcess) 151 { 152 auto proxy = adoptRef(*new WebProcessProxy(processPool, websiteDataStore, isPrewarmed, crossOriginMode)); 153 153 if (shouldLaunchProcess == ShouldLaunchProcess::Yes) 154 154 proxy->connect(); … … 159 159 Ref<WebProcessProxy> WebProcessProxy::createForServiceWorkers(WebProcessPool& processPool, RegistrableDomain&& registrableDomain, WebsiteDataStore& websiteDataStore) 160 160 { 161 auto proxy = adoptRef(*new WebProcessProxy(processPool, &websiteDataStore, IsPrewarmed::No ));161 auto proxy = adoptRef(*new WebProcessProxy(processPool, &websiteDataStore, IsPrewarmed::No, CrossOriginMode::Shared)); 162 162 proxy->m_registrableDomain = WTFMove(registrableDomain); 163 163 proxy->enableServiceWorkers(processPool.userContentControllerIdentifierForServiceWorkers()); … … 195 195 #endif 196 196 197 WebProcessProxy::WebProcessProxy(WebProcessPool& processPool, WebsiteDataStore* websiteDataStore, IsPrewarmed isPrewarmed )197 WebProcessProxy::WebProcessProxy(WebProcessPool& processPool, WebsiteDataStore* websiteDataStore, IsPrewarmed isPrewarmed, CrossOriginMode crossOriginMode) 198 198 : AuxiliaryProcessProxy(processPool.alwaysRunsAtBackgroundPriority()) 199 199 , m_backgroundResponsivenessTimer(*this) … … 212 212 #endif 213 213 , m_isPrewarmed(isPrewarmed == IsPrewarmed::Yes) 214 , m_crossOriginMode(crossOriginMode) 214 215 , m_shutdownPreventingScopeCounter([this](RefCounterEvent event) { if (event == RefCounterEvent::Decrement) maybeShutDown(); }) 215 216 { … … 1144 1145 if (isRunningServiceWorkers()) { 1145 1146 WEBPROCESSPROXY_RELEASE_LOG(Process, "canBeAddedToWebProcessCache: Not adding to process cache because the process is running workers"); 1147 return false; 1148 } 1149 1150 if (m_crossOriginMode == CrossOriginMode::Isolated) { 1151 WEBPROCESSPROXY_RELEASE_LOG(Process, "canBeAddedToWebProcessCache: Not adding to process cache because the process is cross-origin isolated"); 1146 1152 return false; 1147 1153 } -
trunk/Source/WebKit/UIProcess/WebProcessProxy.h
r281516 r281832 45 45 #include "WebPageProxyIdentifier.h" 46 46 #include "WebProcessProxyMessagesReplies.h" 47 #include <WebCore/CrossOriginMode.h> 47 48 #include <WebCore/FrameIdentifier.h> 48 49 #include <WebCore/MediaProducer.h> … … 136 137 enum class ShouldLaunchProcess : bool { No, Yes }; 137 138 138 static Ref<WebProcessProxy> create(WebProcessPool&, WebsiteDataStore*, IsPrewarmed, ShouldLaunchProcess = ShouldLaunchProcess::Yes);139 static Ref<WebProcessProxy> create(WebProcessPool&, WebsiteDataStore*, IsPrewarmed, WebCore::CrossOriginMode = WebCore::CrossOriginMode::Shared, ShouldLaunchProcess = ShouldLaunchProcess::Yes); 139 140 static Ref<WebProcessProxy> createForServiceWorkers(WebProcessPool&, WebCore::RegistrableDomain&&, WebsiteDataStore&); 140 141 … … 420 421 #endif 421 422 423 WebCore::CrossOriginMode crossOriginMode() const { return m_crossOriginMode; } 424 422 425 protected: 423 WebProcessProxy(WebProcessPool&, WebsiteDataStore*, IsPrewarmed );426 WebProcessProxy(WebProcessPool&, WebsiteDataStore*, IsPrewarmed, WebCore::CrossOriginMode); 424 427 425 428 // AuxiliaryProcessProxy … … 441 444 bool shouldConfigureJSCForTesting() const final; 442 445 bool isJITEnabled() const final; 446 bool shouldEnableSharedArrayBuffer() const final { return m_crossOriginMode == WebCore::CrossOriginMode::Isolated; } 443 447 444 448 void validateFreezerStatus(); … … 621 625 bool m_hasCommittedAnyProvisionalLoads { false }; 622 626 bool m_isPrewarmed; 627 WebCore::CrossOriginMode m_crossOriginMode { WebCore::CrossOriginMode::Shared }; 623 628 #if ENABLE(ATTACHMENT_ELEMENT) 624 629 bool m_hasIssuedAttachmentElementRelatedSandboxExtensions { false }; -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r281706 r281832 818 818 } 819 819 820 void WebFrameLoaderClient::dispatchDecidePolicyForResponse(const ResourceResponse& response, const ResourceRequest& request, WebCore::PolicyCheckIdentifier identifier, const String& downloadAttribute, bool needsBrowsingContextGroupSwitch, FramePolicyFunction&& function)820 void WebFrameLoaderClient::dispatchDecidePolicyForResponse(const ResourceResponse& response, const ResourceRequest& request, WebCore::PolicyCheckIdentifier identifier, const String& downloadAttribute, BrowsingContextGroupSwitchDecision browsingContextGroupSwitchDecision, FramePolicyFunction&& function) 821 821 { 822 822 auto* webPage = m_frame->page(); … … 839 839 // If a browsing context switch is requested, we still need to send the IPC to the UIProcess in order to process-swap if necessary, even though the 840 840 // injected bundle has already handled the policy decision. 841 if (policy == WKBundlePagePolicyActionUse && !needsBrowsingContextGroupSwitch) {841 if (policy == WKBundlePagePolicyActionUse && browsingContextGroupSwitchDecision == BrowsingContextGroupSwitchDecision::StayInGroup) { 842 842 WEBFRAMELOADERCLIENT_RELEASE_LOG(Network, "dispatchDecidePolicyForResponse: continuing because injected bundle says so"); 843 843 function(PolicyAction::Use, identifier); … … 856 856 auto protector = m_frame.copyRef(); 857 857 uint64_t listenerID = m_frame->setUpPolicyListener(identifier, WTFMove(function), WebFrame::ForNavigationAction::No); 858 if (!webPage->send(Messages::WebPageProxy::DecidePolicyForResponse(m_frame->frameID(), m_frame->info(), identifier, navigationID, response, request, canShowResponse, downloadAttribute, wasAllowedByInjectedBundle, needsBrowsingContextGroupSwitch, mainResourceLoadIdentifier, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())))) {858 if (!webPage->send(Messages::WebPageProxy::DecidePolicyForResponse(m_frame->frameID(), m_frame->info(), identifier, navigationID, response, request, canShowResponse, downloadAttribute, wasAllowedByInjectedBundle, browsingContextGroupSwitchDecision, mainResourceLoadIdentifier, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())))) { 859 859 WEBFRAMELOADERCLIENT_RELEASE_LOG(Network, "dispatchDecidePolicyForResponse: ignoring because WebPageProxy::DecidePolicyForResponse failed"); 860 860 m_frame->didReceivePolicyDecision(listenerID, PolicyDecision { identifier, std::nullopt, PolicyAction::Ignore, 0, { }, { } }); -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r281516 r281832 130 130 void dispatchShow() final; 131 131 132 void dispatchDecidePolicyForResponse(const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, WebCore::PolicyCheckIdentifier, const String&, bool needsBrowsingContextGroupSwitch, WebCore::FramePolicyFunction&&) final;132 void dispatchDecidePolicyForResponse(const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, WebCore::PolicyCheckIdentifier, const String&, WebCore::BrowsingContextGroupSwitchDecision, WebCore::FramePolicyFunction&&) final; 133 133 void dispatchDecidePolicyForNewWindowAction(const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WebCore::FormState*, const String& frameName, WebCore::PolicyCheckIdentifier, WebCore::FramePolicyFunction&&) final; 134 134 void dispatchDecidePolicyForNavigationAction(const WebCore::NavigationAction&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse& redirectResponse, WebCore::FormState*, WebCore::PolicyDecisionMode, WebCore::PolicyCheckIdentifier, WebCore::FramePolicyFunction&&) final; -
trunk/Source/WebKit/WebProcess/WebProcess.cpp
r281398 r281832 130 130 #include <WebCore/RuntimeApplicationChecks.h> 131 131 #include <WebCore/RuntimeEnabledFeatures.h> 132 #include <WebCore/ScriptExecutionContext.h> 132 133 #include <WebCore/SecurityOrigin.h> 133 134 #include <WebCore/ServiceWorkerContextData.h> … … 524 525 commonVM().setGlobalConstRedeclarationShouldThrow(parameters.shouldThrowExceptionForGlobalConstantRedeclaration); 525 526 527 ScriptExecutionContext::setCrossOriginMode(parameters.crossOriginMode); 528 526 529 #if ENABLE(SERVICE_CONTROLS) 527 530 setEnabledServices(parameters.hasImageServices, parameters.hasSelectionServices, parameters.hasRichContentServices); -
trunk/Source/WebKitLegacy/mac/ChangeLog
r281818 r281832 1 2021-08-31 Chris Dumez <cdumez@apple.com> 2 3 Enable SharedArrayBuffer support when COOP/COEP headers are used 4 https://bugs.webkit.org/show_bug.cgi?id=229559 5 <rdar://problem/82391945> 6 7 Reviewed by Alex Christensen. 8 9 * WebCoreSupport/WebFrameLoaderClient.h: 10 * WebCoreSupport/WebFrameLoaderClient.mm: 11 (WebFrameLoaderClient::dispatchDecidePolicyForResponse): 12 1 13 2021-08-31 Sihui Liu <sihui_liu@apple.com> 2 14 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h
r281516 r281832 128 128 void dispatchShow() final; 129 129 130 void dispatchDecidePolicyForResponse(const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, WebCore::PolicyCheckIdentifier, const String&, bool needsBrowsingContextGroupSwitch, WebCore::FramePolicyFunction&&) final;130 void dispatchDecidePolicyForResponse(const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, WebCore::PolicyCheckIdentifier, const String&, WebCore::BrowsingContextGroupSwitchDecision, WebCore::FramePolicyFunction&&) final; 131 131 void dispatchDecidePolicyForNewWindowAction(const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WebCore::FormState*, const WTF::String& frameName, WebCore::PolicyCheckIdentifier, WebCore::FramePolicyFunction&&) final; 132 132 void dispatchDecidePolicyForNavigationAction(const WebCore::NavigationAction&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse& redirectResponse, WebCore::FormState*, WebCore::PolicyDecisionMode, WebCore::PolicyCheckIdentifier, WebCore::FramePolicyFunction&&) final; -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
r281516 r281832 856 856 } 857 857 858 void WebFrameLoaderClient::dispatchDecidePolicyForResponse(const WebCore::ResourceResponse& response, const WebCore::ResourceRequest& request, WebCore::PolicyCheckIdentifier identifier, const String&, bool needsBrowsingContextGroupSwitch, WebCore::FramePolicyFunction&& function)858 void WebFrameLoaderClient::dispatchDecidePolicyForResponse(const WebCore::ResourceResponse& response, const WebCore::ResourceRequest& request, WebCore::PolicyCheckIdentifier identifier, const String&, WebCore::BrowsingContextGroupSwitchDecision, WebCore::FramePolicyFunction&& function) 859 859 { 860 860 WebView *webView = getWebView(m_webFrame.get()); -
trunk/Source/WebKitLegacy/win/ChangeLog
r281818 r281832 1 2021-08-31 Chris Dumez <cdumez@apple.com> 2 3 Enable SharedArrayBuffer support when COOP/COEP headers are used 4 https://bugs.webkit.org/show_bug.cgi?id=229559 5 <rdar://problem/82391945> 6 7 Reviewed by Alex Christensen. 8 9 * WebCoreSupport/WebFrameLoaderClient.cpp: 10 (WebFrameLoaderClient::dispatchDecidePolicyForResponse): 11 * WebCoreSupport/WebFrameLoaderClient.h: 12 1 13 2021-08-31 Sihui Liu <sihui_liu@apple.com> 2 14 -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp
r281516 r281832 520 520 } 521 521 522 void WebFrameLoaderClient::dispatchDecidePolicyForResponse(const ResourceResponse& response, const ResourceRequest& request, WebCore::PolicyCheckIdentifier identifier, const String&, bool needsBrowsingContextGroupSwitch, FramePolicyFunction&& function)522 void WebFrameLoaderClient::dispatchDecidePolicyForResponse(const ResourceResponse& response, const ResourceRequest& request, WebCore::PolicyCheckIdentifier identifier, const String&, BrowsingContextGroupSwitchDecision, FramePolicyFunction&& function) 523 523 { 524 524 WebView* webView = m_webFrame->webView(); -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h
r281516 r281832 92 92 void dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>) override; 93 93 94 void dispatchDecidePolicyForResponse(const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, WebCore::PolicyCheckIdentifier, const String&, bool needsBrowsingContextGroupSwitch, WebCore::FramePolicyFunction&&) override;94 void dispatchDecidePolicyForResponse(const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, WebCore::PolicyCheckIdentifier, const String&, WebCore::BrowsingContextGroupSwitchDecision, WebCore::FramePolicyFunction&&) override; 95 95 void dispatchDecidePolicyForNewWindowAction(const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WebCore::FormState*, const WTF::String& frameName, WebCore::PolicyCheckIdentifier, WebCore::FramePolicyFunction&&) override; 96 96 void dispatchDecidePolicyForNavigationAction(const WebCore::NavigationAction&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse& redirectResponse, WebCore::FormState*, WebCore::PolicyDecisionMode, WebCore::PolicyCheckIdentifier, WebCore::FramePolicyFunction&&) override; -
trunk/Tools/ChangeLog
r281831 r281832 1 2021-08-31 Chris Dumez <cdumez@apple.com> 2 3 Enable SharedArrayBuffer support when COOP/COEP headers are used 4 https://bugs.webkit.org/show_bug.cgi?id=229559 5 <rdar://problem/82391945> 6 7 Reviewed by Alex Christensen. 8 9 Add API test coverage. SharedArrayBuffer support is currently forcefully enabled by 10 run-webkit-tests.py so it would not be practical to write layout tests for this at 11 the moment. 12 13 * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: 14 (-[PSONScheme addMappingFromURLString:toData:withCOOPValue:withCOEPValue:]): 15 (-[PSONScheme webView:startURLSchemeTask:]): 16 1 17 2021-08-31 Kate Cheney <katherine_cheney@apple.com> 2 18 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm
r281709 r281832 252 252 HashMap<String, RetainPtr<NSData>> _dataMappings; 253 253 HashMap<String, String> _coopValues; 254 HashMap<String, String> _coepValues; 254 255 HashSet<id <WKURLSchemeTask>> _runningTasks; 255 256 bool _shouldRespondAsynchronously; … … 258 259 - (void)addRedirectFromURLString:(NSString *)sourceURLString toURLString:(NSString *)destinationURLString; 259 260 - (void)addMappingFromURLString:(NSString *)urlString toData:(const char*)data; 260 - (void)addMappingFromURLString:(NSString *)urlString toData:(const char*)data withCOOPValue:(const char*)coopValue ;261 - (void)addMappingFromURLString:(NSString *)urlString toData:(const char*)data withCOOPValue:(const char*)coopValue withCOEPValue:(const char*)coepValue; 261 262 @end 262 263 … … 280 281 } 281 282 282 - (void)addMappingFromURLString:(NSString *)urlString toData:(const char*)data withCOOPValue:(const char*)coopValue 283 - (void)addMappingFromURLString:(NSString *)urlString toData:(const char*)data withCOOPValue:(const char*)coopValue withCOEPValue:(const char*)coepValue 283 284 { 284 285 [self addMappingFromURLString:urlString toData:data]; 285 286 if (coopValue) 286 287 _coopValues.add(urlString, coopValue); 288 if (coepValue) 289 _coepValues.add(urlString, coepValue); 287 290 } 288 291 … … 328 331 if (!coopValue.isEmpty()) 329 332 [headerDictionary setObject:(NSString *)coopValue forKey:@"Cross-Origin-Opener-Policy"]; 333 auto coepValue = _coepValues.get([finalURL absoluteString]); 334 if (!coepValue.isEmpty()) 335 [headerDictionary setObject:(NSString *)coepValue forKey:@"Cross-Origin-Embedder-Policy"]; 330 336 331 337 auto response = adoptNS([[NSHTTPURLResponse alloc] initWithURL:finalURL.get() statusCode:200 HTTPVersion:@"HTTP/1.1" headerFields:headerDictionary]); … … 7192 7198 enum class IsSameOrigin : bool { No, Yes }; 7193 7199 enum class DoServerSideRedirect : bool { No, Yes }; 7194 static void runCOOPProcessSwapTest(const char* sourceCOOP, const char* destinationCOOP, IsSameOrigin isSameOrigin, DoServerSideRedirect doServerSideRedirect, ExpectSwap expectSwap) 7195 { 7196 auto processPoolConfiguration = psonProcessPoolConfiguration(); 7197 auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); 7200 static void runCOOPProcessSwapTest(const char* sourceCOOP, const char* sourceCOEP, const char* destinationCOOP, const char* destinationCOEP, IsSameOrigin isSameOrigin, DoServerSideRedirect doServerSideRedirect, ExpectSwap expectSwap) 7201 { 7202 auto processPoolConfiguration = psonProcessPoolConfiguration(); 7203 auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); 7204 bool sourceShouldBeCrossOriginIsolated = sourceCOOP && !strcmp(sourceCOOP, "same-origin") && sourceCOEP && !strcmp(sourceCOEP, "require-corp"); 7205 bool destinationShouldBeCrossOriginIsolated = destinationCOOP && !strcmp(destinationCOOP, "same-origin") && destinationCOEP && !strcmp(destinationCOEP, "require-corp"); 7206 EXPECT_TRUE(sourceShouldBeCrossOriginIsolated == destinationShouldBeCrossOriginIsolated || expectSwap == ExpectSwap::Yes); 7198 7207 7199 7208 auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); … … 7201 7210 [webViewConfiguration preferences].javaScriptCanOpenWindowsAutomatically = YES; 7202 7211 for (_WKExperimentalFeature *feature in [WKPreferences _experimentalFeatures]) { 7203 if ([feature.key isEqualToString:@"CrossOriginOpenerPolicyEnabled"]) {7212 if ([feature.key isEqualToString:@"CrossOriginOpenerPolicyEnabled"]) 7204 7213 [[webViewConfiguration preferences] _setEnabled:YES forExperimentalFeature:feature]; 7205 break;7206 }7214 else if ([feature.key isEqualToString:@"CrossOriginEmbedderPolicyEnabled"]) 7215 [[webViewConfiguration preferences] _setEnabled:YES forExperimentalFeature:feature]; 7207 7216 } 7208 7217 7209 7218 auto handler = adoptNS([[PSONScheme alloc] init]); 7210 7219 if (isSameOrigin == IsSameOrigin::Yes) { 7211 [handler addMappingFromURLString:@"pson://www.webkit.org/main.html" toData:windowOpenSameOriginCOOPTestBytes withCOOPValue:sourceCOOP ];7220 [handler addMappingFromURLString:@"pson://www.webkit.org/main.html" toData:windowOpenSameOriginCOOPTestBytes withCOOPValue:sourceCOOP withCOEPValue:sourceCOEP]; 7212 7221 if (doServerSideRedirect == DoServerSideRedirect::Yes) { 7213 7222 [handler addRedirectFromURLString:@"pson://www.webkit.org/popup.html" toURLString:@"pson://www.webkit.org/popup-after-redirect.html"]; 7214 [handler addMappingFromURLString:@"pson://www.webkit.org/popup-after-redirect.html" toData:"popup" withCOOPValue:destinationCOOP ];7223 [handler addMappingFromURLString:@"pson://www.webkit.org/popup-after-redirect.html" toData:"popup" withCOOPValue:destinationCOOP withCOEPValue:destinationCOEP]; 7215 7224 } else 7216 [handler addMappingFromURLString:@"pson://www.webkit.org/popup.html" toData:"popup" withCOOPValue:destinationCOOP ];7225 [handler addMappingFromURLString:@"pson://www.webkit.org/popup.html" toData:"popup" withCOOPValue:destinationCOOP withCOEPValue:destinationCOEP]; 7217 7226 } else { 7218 [handler addMappingFromURLString:@"pson://www.webkit.org/main.html" toData:windowOpenCrossOriginCOOPTestBytes withCOOPValue:sourceCOOP ];7227 [handler addMappingFromURLString:@"pson://www.webkit.org/main.html" toData:windowOpenCrossOriginCOOPTestBytes withCOOPValue:sourceCOOP withCOEPValue:sourceCOEP]; 7219 7228 if (doServerSideRedirect == DoServerSideRedirect::Yes) { 7220 7229 [handler addRedirectFromURLString:@"pson://www.apple.com/popup.html" toURLString:@"pson://www.apple.com/popup-after-redirect.html"]; 7221 [handler addMappingFromURLString:@"pson://www.apple.com/popup-after-redirect.html" toData:"popup" withCOOPValue:destinationCOOP ];7230 [handler addMappingFromURLString:@"pson://www.apple.com/popup-after-redirect.html" toData:"popup" withCOOPValue:destinationCOOP withCOEPValue:destinationCOEP]; 7222 7231 } else 7223 [handler addMappingFromURLString:@"pson://www.apple.com/popup.html" toData:"popup" withCOOPValue:destinationCOOP ];7232 [handler addMappingFromURLString:@"pson://www.apple.com/popup.html" toData:"popup" withCOOPValue:destinationCOOP withCOEPValue:destinationCOEP]; 7224 7233 } 7225 7234 [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"]; … … 7288 7297 else 7289 7298 EXPECT_WK_STREQ(@"", windowName); 7299 finishedRunningScript = true; 7300 }]; 7301 TestWebKitAPI::Util::run(&finishedRunningScript); 7302 finishedRunningScript = false; 7303 [webView evaluateJavaScript:@"self.crossOriginIsolated ? 'isolated' : 'not-isolated'" completionHandler: [&] (id result, NSError *error) { 7304 NSString *crossOriginIsolated = (NSString *)result; 7305 if (sourceShouldBeCrossOriginIsolated) 7306 EXPECT_WK_STREQ(@"isolated", crossOriginIsolated); 7307 else 7308 EXPECT_WK_STREQ(@"not-isolated", crossOriginIsolated); 7309 finishedRunningScript = true; 7310 }]; 7311 TestWebKitAPI::Util::run(&finishedRunningScript); 7312 finishedRunningScript = false; 7313 [webView evaluateJavaScript:@"self.SharedArrayBuffer ? 'has-sab' : 'does-not-have-sab'" completionHandler: [&] (id result, NSError *error) { 7314 NSString *hasSAB = (NSString *)result; 7315 if (sourceShouldBeCrossOriginIsolated) 7316 EXPECT_WK_STREQ(@"has-sab", hasSAB); 7317 else 7318 EXPECT_WK_STREQ(@"does-not-have-sab", hasSAB); 7290 7319 finishedRunningScript = true; 7291 7320 }]; … … 7321 7350 }]; 7322 7351 TestWebKitAPI::Util::run(&finishedRunningScript); 7352 finishedRunningScript = false; 7353 [createdWebView evaluateJavaScript:@"self.crossOriginIsolated ? 'isolated' : 'not-isolated'" completionHandler: [&] (id result, NSError *error) { 7354 NSString *crossOriginIsolated = (NSString *)result; 7355 if (destinationShouldBeCrossOriginIsolated) 7356 EXPECT_WK_STREQ(@"isolated", crossOriginIsolated); 7357 else 7358 EXPECT_WK_STREQ(@"not-isolated", crossOriginIsolated); 7359 finishedRunningScript = true; 7360 }]; 7361 TestWebKitAPI::Util::run(&finishedRunningScript); 7362 finishedRunningScript = false; 7363 [createdWebView evaluateJavaScript:@"self.SharedArrayBuffer ? 'has-sab' : 'does-not-have-sab'" completionHandler: [&] (id result, NSError *error) { 7364 NSString *hasSAB = (NSString *)result; 7365 if (destinationShouldBeCrossOriginIsolated) 7366 EXPECT_WK_STREQ(@"has-sab", hasSAB); 7367 else 7368 EXPECT_WK_STREQ(@"does-not-have-sab", hasSAB); 7369 finishedRunningScript = true; 7370 }]; 7371 TestWebKitAPI::Util::run(&finishedRunningScript); 7323 7372 7324 7373 createdWebView = nullptr; … … 7327 7376 TEST(ProcessSwap, NavigatingSameOriginToCOOPSameOrigin) 7328 7377 { 7329 runCOOPProcessSwapTest(nullptr, "same-origin", IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes);7378 runCOOPProcessSwapTest(nullptr, nullptr, "same-origin", nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes); 7330 7379 } 7331 7380 7332 7381 TEST(ProcessSwap, NavigatingSameOriginToCOOPSameOrigin2) 7333 7382 { 7334 runCOOPProcessSwapTest("unsafe-none", "same-origin", IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes); 7383 runCOOPProcessSwapTest("unsafe-none", nullptr, "same-origin", nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes); 7384 } 7385 7386 TEST(ProcessSwap, NavigatingSameOriginToCOOPSameOrigin3) 7387 { 7388 runCOOPProcessSwapTest("unsafe-none", nullptr, "same-origin", "unsafe-none", IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes); 7389 } 7390 7391 TEST(ProcessSwap, NavigatingSameOriginToCOOPSameOrigin4) 7392 { 7393 runCOOPProcessSwapTest("unsafe-none", "unsafe-none", "same-origin", "unsafe-none", IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes); 7394 } 7395 7396 TEST(ProcessSwap, NavigatingSameOriginToCOOPAndCOEPSameOrigin) 7397 { 7398 runCOOPProcessSwapTest(nullptr, nullptr, "same-origin", "require-corp", IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes); 7335 7399 } 7336 7400 7337 7401 TEST(ProcessSwap, NavigatingSameOriginFromCOOPSameOrigin) 7338 7402 { 7339 runCOOPProcessSwapTest("same-origin", nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes);7403 runCOOPProcessSwapTest("same-origin", nullptr, nullptr, nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes); 7340 7404 } 7341 7405 7342 7406 TEST(ProcessSwap, NavigatingSameOriginFromCOOPSameOrigin2) 7343 7407 { 7344 runCOOPProcessSwapTest("same-origin", "unsafe-none", IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes); 7408 runCOOPProcessSwapTest("same-origin", nullptr, "unsafe-none", nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes); 7409 } 7410 7411 TEST(ProcessSwap, NavigatingSameOriginFromCOOPSameOrigin3) 7412 { 7413 runCOOPProcessSwapTest("same-origin", "unsafe-none", "unsafe-none", nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes); 7414 } 7415 7416 TEST(ProcessSwap, NavigatingSameOriginFromCOOPAndCOEPSameOrigin) 7417 { 7418 runCOOPProcessSwapTest("same-origin", "require-corp", nullptr, nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes); 7345 7419 } 7346 7420 7347 7421 TEST(ProcessSwap, NavigatingSameOriginFromCOOPSameOriginAllowPopup) 7348 7422 { 7349 runCOOPProcessSwapTest("same-origin-allow-popup", nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::No);7423 runCOOPProcessSwapTest("same-origin-allow-popup", nullptr, nullptr, nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::No); 7350 7424 } 7351 7425 7352 7426 TEST(ProcessSwap, NavigatingSameOriginFromCOOPSameOriginAllowPopup2) 7353 7427 { 7354 runCOOPProcessSwapTest("same-origin-allow-popup", "unsafe-none", IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::No); 7428 runCOOPProcessSwapTest("same-origin-allow-popup", nullptr, "unsafe-none", nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::No); 7429 } 7430 7431 TEST(ProcessSwap, NavigatingSameOriginFromCOOPSameOriginAllowPopup3) 7432 { 7433 runCOOPProcessSwapTest("same-origin-allow-popup", "unsafe-none", "unsafe-none", nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::No); 7434 } 7435 7436 TEST(ProcessSwap, NavigatingSameOriginFromCOOPSameOriginAllowPopup4) 7437 { 7438 runCOOPProcessSwapTest("same-origin-allow-popup", "unsafe-none", "unsafe-none", "unsafe-none", IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::No); 7439 } 7440 7441 TEST(ProcessSwap, NavigatingSameOriginFromCOOPAndCOEPSameOriginAllowPopup) 7442 { 7443 runCOOPProcessSwapTest("same-origin-allow-popup", "require-corp", nullptr, nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::No); 7355 7444 } 7356 7445 7357 7446 TEST(ProcessSwap, NavigatingSameOriginFromCOOPSameOriginToCOOPSameOrigin) 7358 7447 { 7359 runCOOPProcessSwapTest("same-origin", "same-origin", IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::No); 7448 runCOOPProcessSwapTest("same-origin", nullptr, "same-origin", nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::No); 7449 } 7450 7451 TEST(ProcessSwap, NavigatingSameOriginFromCOOPSameOriginToCOOPSameOrigin2) 7452 { 7453 runCOOPProcessSwapTest("same-origin", "unsafe-none", "same-origin", nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::No); 7454 } 7455 7456 TEST(ProcessSwap, NavigatingSameOriginFromCOOPSameOriginToCOOPSameOrigin3) 7457 { 7458 runCOOPProcessSwapTest("same-origin", "unsafe-none", "same-origin", "unsafe-none", IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::No); 7459 } 7460 7461 TEST(ProcessSwap, NavigatingSameOriginFromCOOPAndCOEPSameOriginToCOOPAndCOEPSameOrigin) 7462 { 7463 runCOOPProcessSwapTest("same-origin", "require-corp", "same-origin", "require-corp", IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::No); 7464 } 7465 7466 TEST(ProcessSwap, NavigatingSameOriginFromCOOPAndCOEPSameOriginToCOOPSameOrigin) 7467 { 7468 // Should swap because the destination is missing COEP. 7469 runCOOPProcessSwapTest("same-origin", "require-corp", "same-origin", nullptr, IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes); 7470 } 7471 7472 TEST(ProcessSwap, NavigatingSameOriginFromCOOPSameOriginToCOOPAndCOEPSameOrigin) 7473 { 7474 // Should swap because the source is missing COEP. 7475 runCOOPProcessSwapTest("same-origin", nullptr, "same-origin", "require-corp", IsSameOrigin::Yes, DoServerSideRedirect::No, ExpectSwap::Yes); 7360 7476 } 7361 7477 … … 7363 7479 { 7364 7480 // We expect a swap because the redirect doesn't have COOP=same-origin. 7365 runCOOPProcessSwapTest("same-origin", "same-origin", IsSameOrigin::Yes, DoServerSideRedirect::Yes, ExpectSwap::Yes); 7481 runCOOPProcessSwapTest("same-origin", nullptr, "same-origin", nullptr, IsSameOrigin::Yes, DoServerSideRedirect::Yes, ExpectSwap::Yes); 7482 } 7483 7484 TEST(ProcessSwap, NavigatingSameOriginFromCOOPAndCOEPSameOriginToCOOPAndCOEPSameOriginWithRedirect) 7485 { 7486 // We expect a swap because the redirect doesn't have COOP=same-origin and COEP=require-corp. 7487 runCOOPProcessSwapTest("same-origin", "require-corp", "same-origin", "require-corp", IsSameOrigin::Yes, DoServerSideRedirect::Yes, ExpectSwap::Yes); 7366 7488 } 7367 7489 7368 7490 TEST(ProcessSwap, NavigatingSameOriginWithoutCOOPWithRedirect) 7369 7491 { 7370 runCOOPProcessSwapTest(nullptr, nullptr, IsSameOrigin::Yes, DoServerSideRedirect::Yes, ExpectSwap::No);7492 runCOOPProcessSwapTest(nullptr, nullptr, nullptr, nullptr, IsSameOrigin::Yes, DoServerSideRedirect::Yes, ExpectSwap::No); 7371 7493 } 7372 7494 7373 7495 TEST(ProcessSwap, NavigatingCrossOriginToCOOPSameOrigin) 7374 7496 { 7375 runCOOPProcessSwapTest(nullptr, "same-origin", IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes);7497 runCOOPProcessSwapTest(nullptr, nullptr, "same-origin", nullptr, IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7376 7498 } 7377 7499 7378 7500 TEST(ProcessSwap, NavigatingCrossOriginToCOOPSameOrigin2) 7379 7501 { 7380 runCOOPProcessSwapTest("unsafe-none", "same-origin", IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7502 runCOOPProcessSwapTest("unsafe-none", nullptr, "same-origin", nullptr, IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7503 } 7504 7505 TEST(ProcessSwap, NavigatingCrossOriginToCOOPSameOrigin3) 7506 { 7507 runCOOPProcessSwapTest("unsafe-none", nullptr, "same-origin", "unsafe-none", IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7508 } 7509 7510 TEST(ProcessSwap, NavigatingCrossOriginToCOOPSameOrigin4) 7511 { 7512 runCOOPProcessSwapTest("unsafe-none", "unsafe-none", "same-origin", "unsafe-none", IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7513 } 7514 7515 TEST(ProcessSwap, NavigatingCrossOriginToCOOPAndCOEPSameOrigin) 7516 { 7517 runCOOPProcessSwapTest(nullptr, nullptr, "same-origin", "require-corp", IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7381 7518 } 7382 7519 7383 7520 TEST(ProcessSwap, NavigatingCrossOriginFromCOOPSameOrigin) 7384 7521 { 7385 runCOOPProcessSwapTest("same-origin", nullptr, IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes);7522 runCOOPProcessSwapTest("same-origin", nullptr, nullptr, nullptr, IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7386 7523 } 7387 7524 7388 7525 TEST(ProcessSwap, NavigatingCrossOriginFromCOOPSameOrigin2) 7389 7526 { 7390 runCOOPProcessSwapTest("same-origin", "unsafe-none", IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7527 runCOOPProcessSwapTest("same-origin", nullptr, "unsafe-none", nullptr, IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7528 } 7529 7530 TEST(ProcessSwap, NavigatingCrossOriginFromCOOPSameOrigin3) 7531 { 7532 runCOOPProcessSwapTest("same-origin", "unsafe-none", "unsafe-none", nullptr, IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7533 } 7534 7535 TEST(ProcessSwap, NavigatingCrossOriginFromCOOPSameOrigin4) 7536 { 7537 runCOOPProcessSwapTest("same-origin", "unsafe-none", "unsafe-none", "unsafe-none", IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7538 } 7539 7540 TEST(ProcessSwap, NavigatingCrossOriginFromCOOPAndCOEPSameOrigin) 7541 { 7542 runCOOPProcessSwapTest("same-origin", "require-corp", nullptr, nullptr, IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7391 7543 } 7392 7544 7393 7545 TEST(ProcessSwap, NavigatingCrossOriginFromCOOPSameOriginToCOOPSameOrigin) 7394 7546 { 7395 runCOOPProcessSwapTest("same-origin", "same-origin", IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7547 runCOOPProcessSwapTest("same-origin", nullptr, "same-origin", nullptr, IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7548 } 7549 7550 TEST(ProcessSwap, NavigatingCrossOriginFromCOOPAndCOEPSameOriginToCOOPAndCOEPSameOrigin) 7551 { 7552 runCOOPProcessSwapTest("same-origin", "require-corp", "same-origin", "require-corp", IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7553 } 7554 7555 TEST(ProcessSwap, NavigatingCrossOriginFromCOOPAndCOEPSameOriginToCOOPSameOrigin) 7556 { 7557 runCOOPProcessSwapTest("same-origin", "require-corp", "same-origin", nullptr, IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7558 } 7559 7560 TEST(ProcessSwap, NavigatingCrossOriginFromCOOPSameOriginToCOOPAndCOEPSameOrigin) 7561 { 7562 runCOOPProcessSwapTest("same-origin", nullptr, "same-origin", "require-corp", IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::Yes); 7396 7563 } 7397 7564 7398 7565 TEST(ProcessSwap, NavigatingCrossOriginFromCOOPSameOriginAllowPopup) 7399 7566 { 7400 runCOOPProcessSwapTest("same-origin-allow-popup", nullptr, IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::No);7567 runCOOPProcessSwapTest("same-origin-allow-popup", nullptr, nullptr, nullptr, IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::No); 7401 7568 } 7402 7569 7403 7570 TEST(ProcessSwap, NavigatingCrossOriginFromCOOPSameOriginAllowPopup2) 7404 7571 { 7405 runCOOPProcessSwapTest("same-origin-allow-popup", "unsafe-none", IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::No); 7406 } 7572 runCOOPProcessSwapTest("same-origin-allow-popup", nullptr, "unsafe-none", nullptr, IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::No); 7573 } 7574 7575 TEST(ProcessSwap, NavigatingCrossOriginFromCOOPSameOriginAllowPopup3) 7576 { 7577 runCOOPProcessSwapTest("same-origin-allow-popup", "unsafe-none", "unsafe-none", nullptr, IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::No); 7578 } 7579 7580 TEST(ProcessSwap, NavigatingCrossOriginFromCOOPSameOriginAllowPopup4) 7581 { 7582 runCOOPProcessSwapTest("same-origin-allow-popup", "unsafe-none", "unsafe-none", "unsafe-none", IsSameOrigin::No, DoServerSideRedirect::No, ExpectSwap::No); 7583 }
Note: See TracChangeset
for help on using the changeset viewer.