Title: [234310] trunk/Source/WebKit
Revision
234310
Author
[email protected]
Date
2018-07-27 09:28:36 -0700 (Fri, 27 Jul 2018)

Log Message

Loading a file URL and then issuing a reload right away causes the load to fail due to sandboxing
https://bugs.webkit.org/show_bug.cgi?id=188078
<rdar://problem/42562493>

Unreviewed, follow-up fix after r234290 to address assertion hits on the bots. Make the fix
specific to reloads as we know the existing provisional sandbox extension is for the same
URL then.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reload):
(WebKit::WebPage::SandboxExtensionTracker::beginLoad):
(WebKit::WebPage::SandboxExtensionTracker::beginReload):
* WebProcess/WebPage/WebPage.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (234309 => 234310)


--- trunk/Source/WebKit/ChangeLog	2018-07-27 10:46:12 UTC (rev 234309)
+++ trunk/Source/WebKit/ChangeLog	2018-07-27 16:28:36 UTC (rev 234310)
@@ -1,3 +1,19 @@
+2018-07-27  Chris Dumez  <[email protected]>
+
+        Loading a file URL and then issuing a reload right away causes the load to fail due to sandboxing
+        https://bugs.webkit.org/show_bug.cgi?id=188078
+        <rdar://problem/42562493>
+
+        Unreviewed, follow-up fix after r234290 to address assertion hits on the bots. Make the fix
+        specific to reloads as we know the existing provisional sandbox extension is for the same
+        URL then.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::reload):
+        (WebKit::WebPage::SandboxExtensionTracker::beginLoad):
+        (WebKit::WebPage::SandboxExtensionTracker::beginReload):
+        * WebProcess/WebPage/WebPage.h:
+
 2018-07-26  Andy VanWagoner  <[email protected]>
 
         [INTL] Remove INTL sub-feature compile flags

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (234309 => 234310)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2018-07-27 10:46:12 UTC (rev 234309)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2018-07-27 16:28:36 UTC (rev 234310)
@@ -1397,7 +1397,7 @@
     ASSERT(!m_mainFrame->coreFrame()->loader().frameHasLoaded() || !m_pendingNavigationID);
     m_pendingNavigationID = navigationID;
 
-    m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), WTFMove(sandboxExtensionHandle));
+    m_sandboxExtensionTracker.beginReload(m_mainFrame.get(), WTFMove(sandboxExtensionHandle));
     corePage()->userInputBridge().reloadFrame(m_mainFrame->coreFrame(), OptionSet<ReloadOption>::fromRaw(reloadOptions));
 
     if (m_pendingNavigationID) {
@@ -4086,6 +4086,15 @@
 {
     ASSERT_UNUSED(frame, frame->isMainFrame());
 
+    setPendingProvisionalSandboxExtension(SandboxExtension::create(WTFMove(handle)));
+}
+
+void WebPage::SandboxExtensionTracker::beginReload(WebFrame* frame, SandboxExtension::Handle&& handle)
+{
+    ASSERT_UNUSED(frame, frame->isMainFrame());
+
+    // Maintain existing provisional SandboxExtension in case of a reload, if the new handle is null. This is needed
+    // because the UIProcess sends us a null handle if it already sent us a handle for this path in the past.
     if (auto sandboxExtension = SandboxExtension::create(WTFMove(handle)))
         setPendingProvisionalSandboxExtension(WTFMove(sandboxExtension));
 }

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (234309 => 234310)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2018-07-27 10:46:12 UTC (rev 234309)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2018-07-27 16:28:36 UTC (rev 234310)
@@ -693,6 +693,7 @@
         void invalidate();
 
         void beginLoad(WebFrame*, SandboxExtension::Handle&&);
+        void beginReload(WebFrame*, SandboxExtension::Handle&&);
         void willPerformLoadDragDestinationAction(RefPtr<SandboxExtension>&& pendingDropSandboxExtension);
         void didStartProvisionalLoad(WebFrame*);
         void didCommitProvisionalLoad(WebFrame*);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to