| Index: content/browser/frame_host/navigation_controller_impl.cc
|
| diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
|
| index 5bde4bb4340d76cb67cc37f410824c5a814269d9..b7b9ea8a59c30bfc0da87c7efdcd0aee047fac09 100644
|
| --- a/content/browser/frame_host/navigation_controller_impl.cc
|
| +++ b/content/browser/frame_host/navigation_controller_impl.cc
|
| @@ -559,6 +559,13 @@ int NavigationControllerImpl::GetIndexForOffset(int offset) const {
|
| return GetCurrentEntryIndex() + offset;
|
| }
|
|
|
| +void NavigationControllerImpl::DiscardUnusedSSLCerts() {
|
| + for (size_t i = 0; i < entries_.size(); ++i) {
|
| + if (static_cast<int>(i) != last_committed_entry_index_)
|
| + entries_[i]->GetSSL().certificate = nullptr;
|
| + }
|
| +}
|
| +
|
| void NavigationControllerImpl::TakeScreenshot() {
|
| screenshot_manager_->TakeScreenshot();
|
| }
|
| @@ -1272,6 +1279,7 @@ void NavigationControllerImpl::RendererDidNavigateToExistingPage(
|
| // If a transient entry was removed, the indices might have changed, so we
|
| // have to query the entry index again.
|
| last_committed_entry_index_ = GetIndexOfEntry(entry);
|
| + DiscardUnusedSSLCerts();
|
| }
|
|
|
| void NavigationControllerImpl::RendererDidNavigateToSamePage(
|
| @@ -1397,6 +1405,7 @@ bool NavigationControllerImpl::RendererDidNavigateAutoSubframe(
|
| // case. For newly created subframes, there was no pending entry.
|
| last_committed_entry_index_ = entry_index;
|
| DiscardNonCommittedEntriesInternal();
|
| + DiscardUnusedSSLCerts();
|
|
|
| // History navigations should send a commit notification.
|
| send_commit_notification = true;
|
| @@ -1552,6 +1561,7 @@ void NavigationControllerImpl::CopyStateFromAndPrune(
|
|
|
| // Adjust indices such that the last entry and pending are at the end now.
|
| last_committed_entry_index_ = GetEntryCount() - 1;
|
| + DiscardUnusedSSLCerts();
|
|
|
| delegate_->SetHistoryOffsetAndLength(last_committed_entry_index_,
|
| GetEntryCount());
|
| @@ -1762,6 +1772,7 @@ void NavigationControllerImpl::InsertOrReplaceEntry(
|
|
|
| entries_.push_back(std::move(entry));
|
| last_committed_entry_index_ = static_cast<int>(entries_.size()) - 1;
|
| + DiscardUnusedSSLCerts();
|
| }
|
|
|
| void NavigationControllerImpl::PruneOldestEntryIfFull() {
|
| @@ -2069,6 +2080,7 @@ void NavigationControllerImpl::FinishRestore(int selected_index,
|
| ConfigureEntriesForRestore(&entries_, type);
|
|
|
| last_committed_entry_index_ = selected_index;
|
| + DiscardUnusedSSLCerts();
|
| }
|
|
|
| void NavigationControllerImpl::DiscardNonCommittedEntriesInternal() {
|
|
|