Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: components/sessions/content/content_serialized_navigation_driver.cc

Issue 948013002: When sanitizing serialized navigation entries also take iframes into account (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/public/common/page_state.cc » ('j') | content/public/common/page_state.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sessions/content/content_serialized_navigation_driver.cc
diff --git a/components/sessions/content/content_serialized_navigation_driver.cc b/components/sessions/content/content_serialized_navigation_driver.cc
index 0c682f499029a387291c2c2bd898b6d2c65d2845..236eb28652836afbf0225d26937a85866c6e2658 100644
--- a/components/sessions/content/content_serialized_navigation_driver.cc
+++ b/components/sessions/content/content_serialized_navigation_driver.cc
@@ -100,10 +100,14 @@ void ContentSerializedNavigationDriver::Sanitize(
content::Referrer::SanitizeForRequest(navigation->virtual_url_,
old_referrer);
+ bool page_state_is_valid = navigation->encoded_page_state_.empty() ||
+ content::PageState::CreateFromEncodedData(
+ navigation->encoded_page_state_).IsValid();
+
// No need to compare the policy, as it doesn't change during
// sanitization. If there has been a change, the referrer needs to be
// stripped from the page state as well.
- if (navigation->referrer_url_ != new_referrer.url) {
+ if (navigation->referrer_url_ != new_referrer.url || !page_state_is_valid) {
navigation->referrer_url_ = GURL();
navigation->referrer_policy_ = GetDefaultReferrerPolicy();
navigation->encoded_page_state_ =
« no previous file with comments | « no previous file | content/public/common/page_state.cc » ('j') | content/public/common/page_state.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698