Correctly handle sandbox extensions when the same WKWebView loads multiple file:...
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 17:20:36 +0000 (17:20 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 17:20:36 +0000 (17:20 +0000)
commit974549e28197b4eed59b7d13c35a262c82c15639
tree035f0da7c0e7af3011310eefbd30180f9e557cca
parent99dbf515cadfd4712a4c936e11151e611195936a
Correctly handle sandbox extensions when the same WKWebView loads multiple file:// URLs.
<rdar://problem/47820581> and https://bugs.webkit.org/show_bug.cgi?id=195291

Reviewed by Tim Horton.

Source/WebKit:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::SandboxExtensionTracker::shouldReuseCommittedSandboxExtension): If there is a pendingProvisionalSandboxExtension
  then its existence should override our willingness to reuse the existing committed extension.
(WebKit::shouldReuseCommittedSandboxExtension): Deleted.
* WebProcess/WebPage/WebPage.h:

Tools:

Loading a file: URL into a WKWebView and then loading another file: url from a completely
different directory into that same WKWebView should work.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/LoadFileURL.mm: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadFileURL.mm [new file with mode: 0644]