OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/frame_host/frame_navigation_entry.h" | 5 #include "content/browser/frame_host/frame_navigation_entry.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "content/common/page_state_serialization.h" | 9 #include "content/common/page_state_serialization.h" |
10 #include "content/common/site_isolation_policy.h" | 10 #include "content/common/site_isolation_policy.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // location.replace is classified as NEW_PAGE rather than EXISTING_PAGE. | 76 // location.replace is classified as NEW_PAGE rather than EXISTING_PAGE. |
77 // Same for document sequence number. See https://crbug.com/596707. | 77 // Same for document sequence number. See https://crbug.com/596707. |
78 item_sequence_number_ = item_sequence_number; | 78 item_sequence_number_ = item_sequence_number; |
79 } | 79 } |
80 | 80 |
81 void FrameNavigationEntry::set_document_sequence_number( | 81 void FrameNavigationEntry::set_document_sequence_number( |
82 int64_t document_sequence_number) { | 82 int64_t document_sequence_number) { |
83 document_sequence_number_ = document_sequence_number; | 83 document_sequence_number_ = document_sequence_number; |
84 } | 84 } |
85 | 85 |
| 86 void FrameNavigationEntry::SetPageState(const PageState& page_state) { |
| 87 page_state_ = page_state; |
| 88 |
| 89 ExplodedPageState exploded_state; |
| 90 if (!DecodePageState(page_state_.ToEncodedData(), &exploded_state)) |
| 91 return; |
| 92 |
| 93 item_sequence_number_ = exploded_state.top.item_sequence_number; |
| 94 document_sequence_number_ = exploded_state.top.document_sequence_number; |
| 95 } |
| 96 |
86 scoped_refptr<ResourceRequestBodyImpl> FrameNavigationEntry::GetPostData() | 97 scoped_refptr<ResourceRequestBodyImpl> FrameNavigationEntry::GetPostData() |
87 const { | 98 const { |
88 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); | 99 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); |
89 if (method_ != "POST") | 100 if (method_ != "POST") |
90 return nullptr; | 101 return nullptr; |
91 | 102 |
92 // Generate the body from the PageState. | 103 // Generate the body from the PageState. |
93 ExplodedPageState exploded_state; | 104 ExplodedPageState exploded_state; |
94 if (!DecodePageState(page_state_.ToEncodedData(), &exploded_state)) | 105 if (!DecodePageState(page_state_.ToEncodedData(), &exploded_state)) |
95 return nullptr; | 106 return nullptr; |
96 | 107 |
97 return exploded_state.top.http_body.request_body; | 108 return exploded_state.top.http_body.request_body; |
98 } | 109 } |
99 | 110 |
100 } // namespace content | 111 } // namespace content |
OLD | NEW |