Commit c7a51a72 authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios/web] Don't expose internal restore session URLs.

A followup to http://crrev.com/c/1673566.  Strip our restore and placeholder
information out of the URL returned by GetCurrentURL().

Change-Id: I86075a81099fca5bc74f6fabcb44c4faad216f9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1677804
Auto-Submit: Justin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672575}
parent 0b5d7be0
...@@ -781,6 +781,17 @@ WKBasedNavigationManagerImpl::GetLastCommittedItemInCurrentOrRestoredSession() ...@@ -781,6 +781,17 @@ WKBasedNavigationManagerImpl::GetLastCommittedItemInCurrentOrRestoredSession()
last_committed_web_view_item_->SetUntrusted(); last_committed_web_view_item_->SetUntrusted();
} }
last_committed_web_view_item_->SetURL(document_url); last_committed_web_view_item_->SetURL(document_url);
// Don't expose internal restore session URL's.
GURL virtual_url;
if (wk_navigation_util::IsRestoreSessionUrl(document_url) &&
wk_navigation_util::ExtractTargetURL(document_url, &virtual_url)) {
if (wk_navigation_util::IsPlaceholderUrl(virtual_url)) {
last_committed_web_view_item_->SetVirtualURL(
wk_navigation_util::ExtractUrlFromPlaceholderUrl(virtual_url));
} else {
last_committed_web_view_item_->SetVirtualURL(virtual_url);
}
}
last_committed_web_view_item_->SetTimestamp( last_committed_web_view_item_->SetTimestamp(
time_smoother_.GetSmoothedTime(base::Time::Now())); time_smoother_.GetSmoothedTime(base::Time::Now()));
return last_committed_web_view_item_.get(); return last_committed_web_view_item_.get();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment