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

Reviewed by Andy Estes.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::shouldReuseCommittedSandboxExtension): Only retain the previous sandbox extension if the file URL
  we're currently loading is functionally equivalent to the previous one.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242376 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/WebPage.cpp

index 56e6de4..4309cc6 100644 (file)
@@ -1,3 +1,14 @@
+2019-03-04  Brady Eidson  <beidson@apple.com>
+
+        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 Andy Estes.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::shouldReuseCommittedSandboxExtension): Only retain the previous sandbox extension if the file URL
+          we're currently loading is functionally equivalent to the previous one.
+
 2019-03-04  Chris Dumez  <cdumez@apple.com>
 
         Drop legacy userAgentForURL injected bundle SPI
index 96fc2df..c388281 100644 (file)
@@ -4412,7 +4412,7 @@ static bool shouldReuseCommittedSandboxExtension(WebFrame* frame)
     if (!documentLoader || !provisionalDocumentLoader)
         return false;
 
-    if (documentLoader->url().isLocalFile() && provisionalDocumentLoader->url().isLocalFile())
+    if (documentLoader->url().isLocalFile() && provisionalDocumentLoader->url().isLocalFile() && equalIgnoringQueryAndFragment(documentLoader->url(), provisionalDocumentLoader->url()))
         return true;
 
     return false;