Commit 3c9c6e11 authored by jochen@chromium.org's avatar jochen@chromium.org

Don't try to remove the referrer from an empty page state

BUG=339790
R=marja@chromium.org

Review URL: https://codereview.chromium.org/166303003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251418 0039d316-1c4b-4281-b951-d872f2087c98
parent 671e0343
......@@ -325,6 +325,9 @@ TEST(SerializedNavigationEntryTest, Sanitize) {
EXPECT_EQ(kSearchTerms, navigation.search_terms());
EXPECT_EQ(kFaviconURL, navigation.favicon_url());
EXPECT_EQ(kHttpStatusCode, navigation.http_status_code());
content::PageState empty_state;
EXPECT_TRUE(empty_state.Equals(empty_state.RemoveReferrer()));
}
} // namespace
......
......@@ -151,6 +151,9 @@ PageState PageState::RemoveScrollOffset() const {
}
PageState PageState::RemoveReferrer() const {
if (data_.empty())
return *this;
ExplodedPageState state;
if (!DecodePageState(data_, &state))
return PageState(); // Oops!
......
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