Skip to content

Truly independent web browser

LibWebView: Remove unused navigation and session history leftovers

Shannon Boothf3e9dd3189e6
diff --git a/Libraries/LibWebView/CanonicalNavigable.h b/Libraries/LibWebView/CanonicalNavigable.h
index bf0a5ed6456..57f7810e766 100644
--- a/Libraries/LibWebView/CanonicalNavigable.h
+++ b/Libraries/LibWebView/CanonicalNavigable.h
@@ -226,7 +226,7 @@ public:
void set_ongoing_navigation(CanonicalNavigation);
void set_ongoing_navigation_to_traversal(Web::HTML::CrossProcessId operation_id);
void clear_ongoing_navigation_traversal(Web::HTML::CrossProcessId operation_id);
- virtual void clear_ongoing_navigation();
+ void clear_ongoing_navigation();
void clear_ongoing_navigation_state();
void set_navigation_host(WebContentPage&);
bool cancel_navigation_for_client(WebContentClient&);
diff --git a/Libraries/LibWebView/CanonicalTraversable.cpp b/Libraries/LibWebView/CanonicalTraversable.cpp
index 053837ec90e..032b3a86f40 100644
--- a/Libraries/LibWebView/CanonicalTraversable.cpp
+++ b/Libraries/LibWebView/CanonicalTraversable.cpp
@@ -1218,16 +1218,6 @@ Optional<CanonicalTraversable::BrowserHistoryTraversalDiagnostic> CanonicalTrave
};
}
-CanonicalSessionHistoryEntry const* CanonicalTraversable::ongoing_browser_history_traversal_target_entry() const
-{
- if (!m_browser_history_traversal)
- return nullptr;
- auto const& parameters = m_browser_history_traversal->parameters.get<Web::TraverseToStepHistoryOperationParameters>();
- if (auto target = m_session_history.traversal_target_for_step(parameters.target_step); target.has_value())
- return target->target_top_level_entry;
- return nullptr;
-}
-
// The navigation a cross-document navigation's finalization took from its navigable at its queue position.
CanonicalNavigation const* CanonicalTraversable::finalized_navigation(HistoryOperation const& operation) const
{
diff --git a/Libraries/LibWebView/CanonicalTraversable.h b/Libraries/LibWebView/CanonicalTraversable.h
index d7aaa3e2359..053ee27d81c 100644
--- a/Libraries/LibWebView/CanonicalTraversable.h
+++ b/Libraries/LibWebView/CanonicalTraversable.h
@@ -154,7 +154,6 @@ public:
Web::DevicePixelPoint local_root_offset(CanonicalNavigable const&) const;
Optional<BrowserHistoryTraversalDiagnostic> browser_history_traversal_for_testing() const;
- CanonicalSessionHistoryEntry const* ongoing_browser_history_traversal_target_entry() const;
// The entries of the synchronous navigations of a navigable whose finalization is queued.
Vector<NonnullRefPtr<CanonicalSessionHistoryEntry>> queued_same_document_session_history_entries(CanonicalNavigable const&) const;
ByteString queued_same_document_session_history_entries_for_debug() const;
diff --git a/Libraries/LibWebView/SessionHistory.cpp b/Libraries/LibWebView/SessionHistory.cpp
index 03b02697995..610a8489152 100644
--- a/Libraries/LibWebView/SessionHistory.cpp
+++ b/Libraries/LibWebView/SessionHistory.cpp
@@ -249,18 +249,6 @@ ErrorOr<void> TraversableSessionHistory::restore_from_ui_snapshot(Vector<Web::HT
return {};
}
-void TraversableSessionHistory::mark_current_entry_reload_pending()
-{
- auto current_top_level_entry_index = this->current_top_level_entry_index();
- if (!current_top_level_entry_index.has_value())
- return;
-
- // https://html.spec.whatwg.org/multipage/browsing-the-web.html#reload
- // Set navigable's active session history entry's document state's reload
- // pending to true.
- m_entries[*current_top_level_entry_index]->document_state->reload_pending = true;
-}
-
Optional<i32> TraversableSessionHistory::append_nested_history(CanonicalNavigable const& parent_navigable, CanonicalDocumentState& parent_document_state, Web::HTML::CrossProcessId child_navigable_id, NonnullRefPtr<CanonicalSessionHistoryEntry> history_entry)
{
if (!m_current_session_history_step.has_value())
diff --git a/Libraries/LibWebView/SessionHistory.h b/Libraries/LibWebView/SessionHistory.h
index bc880316348..86adf7e7974 100644
--- a/Libraries/LibWebView/SessionHistory.h
+++ b/Libraries/LibWebView/SessionHistory.h
@@ -54,7 +54,6 @@ public:
bool initialize_for_testing(Vector<Web::HTML::SessionHistoryEntryDescriptor>, Vector<i32> used_steps, size_t current_used_step_index);
void initialize_with_initial_history_entry(NonnullRefPtr<CanonicalSessionHistoryEntry> initial_history_entry);
[[nodiscard]] ErrorOr<void> restore_from_ui_snapshot(Vector<Web::HTML::SessionHistoryEntryDescriptor> entries, Vector<i32> used_steps, size_t current_used_step_index, Function<Web::HTML::CrossProcessId()> allocate_cross_process_id);
- void mark_current_entry_reload_pending();
Optional<i32> append_nested_history(CanonicalNavigable const& parent_navigable, CanonicalDocumentState& parent_document_state, Web::HTML::CrossProcessId child_navigable_id, NonnullRefPtr<CanonicalSessionHistoryEntry> history_entry);
bool remove_nested_history(CanonicalNavigable const& parent_navigable, Web::HTML::CrossProcessId parent_document_state_id, Web::HTML::CrossProcessId child_navigable_id);
void clear_the_forward_session_history();
diff --git a/Tests/LibWebView/TestApplyHistoryStep.cpp b/Tests/LibWebView/TestApplyHistoryStep.cpp
index 4be80f5093b..8785b398a0c 100644
--- a/Tests/LibWebView/TestApplyHistoryStep.cpp
+++ b/Tests/LibWebView/TestApplyHistoryStep.cpp
@@ -826,7 +826,7 @@ TEST_CASE(a_paused_reload_continues_with_the_entry_that_a_jumping_replace_put_in
Core::EventLoop event_loop;
TestTraversable test;
test.with_two_top_level_entries();
- test.history.mark_current_entry_reload_pending();
+ test.history.current_entry()->document_state->reload_pending = true;
// A same-document replace from the page being reloaded is queued behind the reload, and jumps the queue while the
// reload waits on its changing job. It replaces the entry that the reload has claimed, keeping its navigation API
diff --git a/Tests/LibWebView/TestSessionHistory.cpp b/Tests/LibWebView/TestSessionHistory.cpp
index fcf8105b79b..1c1e354be7f 100644
--- a/Tests/LibWebView/TestSessionHistory.cpp
+++ b/Tests/LibWebView/TestSessionHistory.cpp
@@ -851,28 +851,6 @@ TEST_CASE(history_log_entries_marks_nested_histories)
"used_steps=[0:0, 1:1, *2:2]"sv });
}
-TEST_CASE(mark_current_entry_reload_pending)
-{
- WebView::TraversableSessionHistory history;
-
- auto update_result = history.initialize_for_testing({
- entry(0, "https://a.example/"sv),
- entry(1, "https://b.example/"sv),
- },
- { 0, 1 }, 1);
- EXPECT_EQ(update_result, true);
-
- auto current_entry = history.current_entry();
- VERIFY(current_entry);
- EXPECT(!current_entry->document_state->reload_pending);
-
- history.mark_current_entry_reload_pending();
-
- current_entry = history.current_entry();
- VERIFY(current_entry);
- EXPECT(current_entry->document_state->reload_pending);
-}
-
TEST_CASE(cross_document_push_preserves_document_resource)
{
WebView::CanonicalTraversable traversable;