Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / content / public / common / page_state.cc
index b82ef89..761e4f6 100644 (file)
@@ -46,6 +46,7 @@ void RecursivelyRemoveScrollOffset(ExplodedFrameState* state) {
 
 void RecursivelyRemoveReferrer(ExplodedFrameState* state) {
   state->referrer = base::NullableString16();
+  state->referrer_policy = blink::WebReferrerPolicyDefault;
   for (std::vector<ExplodedFrameState>::iterator it = state->children.begin();
        it != state->children.end();
        ++it) {
@@ -150,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!