Process swapping on navigation needs to handle server redirects.
[WebKit-https.git] / Source / WebKit / UIProcess / API / APINavigation.h
index 07c48ee..947fb3c 100644 (file)
@@ -26,6 +26,7 @@
 #pragma once
 
 #include "APIObject.h"
+#include <WebCore/Process.h>
 #include <WebCore/ResourceRequest.h>
 #include <wtf/Ref.h>
 
@@ -62,7 +63,14 @@ public:
 
     uint64_t navigationID() const { return m_navigationID; }
 
-    const WebCore::ResourceRequest& request() const { return m_request; }
+    const WebCore::ResourceRequest& originalRequest() const { return m_originalRequest; }
+    void setCurrentRequest(WebCore::ResourceRequest&&, WebCore::ProcessIdentifier);
+    const WebCore::ResourceRequest& currentRequest() const { return m_currentRequest; }
+    std::optional<WebCore::ProcessIdentifier> currentRequestProcessIdentifier() const { return m_currentRequestProcessIdentifier; }
+
+    void setCurrentRequestIsRedirect(bool isRedirect) { m_isRedirect = isRedirect; }
+    bool currentRequestIsRedirect() const { return m_isRedirect; }
+
     WebKit::WebBackForwardListItem* backForwardListItem() { return m_backForwardListItem.get(); }
     std::optional<WebCore::FrameLoadType> backForwardFrameLoadType() const { return m_backForwardFrameLoadType; }
 
@@ -82,7 +90,7 @@ public:
     const std::optional<std::pair<uint64_t, uint64_t>>& opener() const { return m_opener; }
 
 #if !LOG_DISABLED
-    WTF::String loggingURL() const;
+    WTF::String loggingString() const;
 #endif
 
 private:
@@ -91,10 +99,13 @@ private:
     Navigation(WebKit::WebNavigationState&, WebKit::WebBackForwardListItem&, WebCore::FrameLoadType);
 
     uint64_t m_navigationID;
-    WebCore::ResourceRequest m_request;
+    WebCore::ResourceRequest m_originalRequest;
+    WebCore::ResourceRequest m_currentRequest;
+    std::optional<WebCore::ProcessIdentifier> m_currentRequestProcessIdentifier;
     Vector<WebCore::URL> m_redirectChain;
     bool m_wasUserInitiated { true };
     bool m_shouldForceDownload { false };
+    bool m_isRedirect { false };
 
     RefPtr<WebKit::WebBackForwardListItem> m_backForwardListItem;
     std::optional<WebCore::FrameLoadType> m_backForwardFrameLoadType;