Index: content/browser/frame_host/frame_navigation_entry.cc |
diff --git a/content/browser/frame_host/frame_navigation_entry.cc b/content/browser/frame_host/frame_navigation_entry.cc |
index bf78bef31f702fbaab573adefe8f1bf4ea08f3ec..71974aab665ed67e22eb596aa6449c1d54d8f312 100644 |
--- a/content/browser/frame_host/frame_navigation_entry.cc |
+++ b/content/browser/frame_host/frame_navigation_entry.cc |
@@ -90,8 +90,18 @@ void FrameNavigationEntry::SetPageState(const PageState& page_state) { |
if (!DecodePageState(page_state_.ToEncodedData(), &exploded_state)) |
return; |
- item_sequence_number_ = exploded_state.top.item_sequence_number; |
- document_sequence_number_ = exploded_state.top.document_sequence_number; |
+ // If the item_sequence_number_ field is already populated, then set it only |
+ // if the item sequence number decoded from the page state is valid. This |
+ // typically happens in tests. |
+ if (exploded_state.top.item_sequence_number > 0 || |
nasko
2016/09/07 20:56:02
I don't think this is the correct approach. The wh
ananta
2016/09/07 22:50:06
Added the functionality to the test code. PTAL
|
+ item_sequence_number_ < 0) { |
+ item_sequence_number_ = exploded_state.top.item_sequence_number; |
+ } |
+ // Please refer to the comment above for explanation. |
+ if (exploded_state.top.document_sequence_number > 0 || |
+ document_sequence_number_ < 0) { |
+ document_sequence_number_ = exploded_state.top.document_sequence_number; |
+ } |
} |
scoped_refptr<ResourceRequestBodyImpl> FrameNavigationEntry::GetPostData() |