| Index: content/browser/frame_host/navigation_entry_impl.cc
|
| diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc
|
| index d2eca0f4ffb15cd2664d62ec91e5c4ecc34f4bcb..97833b7c75dc854395834e6b8d5889e1334848bd 100644
|
| --- a/content/browser/frame_host/navigation_entry_impl.cc
|
| +++ b/content/browser/frame_host/navigation_entry_impl.cc
|
| @@ -419,14 +419,14 @@ int64_t NavigationEntryImpl::GetPostID() const {
|
| return frame_tree_->frame_entry->post_id();
|
| }
|
|
|
| -void NavigationEntryImpl::SetBrowserInitiatedPostData(
|
| - const base::RefCountedMemory* data) {
|
| - browser_initiated_post_data_ = data;
|
| +void NavigationEntryImpl::SetPostData(
|
| + const scoped_refptr<ResourceRequestBody>& data) {
|
| + post_data_ =
|
| + static_cast<ResourceRequestBodyImpl*>(data.get());
|
| }
|
|
|
| -const base::RefCountedMemory*
|
| -NavigationEntryImpl::GetBrowserInitiatedPostData() const {
|
| - return browser_initiated_post_data_.get();
|
| +scoped_refptr<ResourceRequestBody> NavigationEntryImpl::GetPostData() const {
|
| + return post_data_.get();
|
| }
|
|
|
|
|
| @@ -550,7 +550,7 @@ std::unique_ptr<NavigationEntryImpl> NavigationEntryImpl::CloneAndReplace(
|
| copy->is_overriding_user_agent_ = is_overriding_user_agent_;
|
| copy->timestamp_ = timestamp_;
|
| copy->http_status_code_ = http_status_code_;
|
| - // ResetForCommit: browser_initiated_post_data_
|
| + // ResetForCommit: post_data_
|
| copy->screenshot_ = screenshot_;
|
| copy->extra_headers_ = extra_headers_;
|
| copy->base_url_for_data_url_ = base_url_for_data_url_;
|
| @@ -570,19 +570,6 @@ std::unique_ptr<NavigationEntryImpl> NavigationEntryImpl::CloneAndReplace(
|
| return copy;
|
| }
|
|
|
| -scoped_refptr<ResourceRequestBodyImpl>
|
| -NavigationEntryImpl::ConstructBodyFromBrowserInitiatedPostData() const {
|
| - scoped_refptr<ResourceRequestBodyImpl> browser_initiated_post_body;
|
| - if (GetHasPostData()) {
|
| - if (const base::RefCountedMemory* memory = GetBrowserInitiatedPostData()) {
|
| - browser_initiated_post_body = new ResourceRequestBodyImpl();
|
| - browser_initiated_post_body->AppendBytes(memory->front_as<char>(),
|
| - memory->size());
|
| - }
|
| - }
|
| - return browser_initiated_post_body;
|
| -}
|
| -
|
| CommonNavigationParams NavigationEntryImpl::ConstructCommonNavigationParams(
|
| const FrameNavigationEntry& frame_entry,
|
| const scoped_refptr<ResourceRequestBodyImpl>& post_body,
|
| @@ -614,7 +601,7 @@ CommonNavigationParams NavigationEntryImpl::ConstructCommonNavigationParams(
|
| !IsViewSourceMode(), should_replace_entry(), ui_timestamp, report_type,
|
| GetBaseURLForDataURL(), GetHistoryURLForDataURL(), lofi_state,
|
| navigation_start, method,
|
| - post_body ? post_body : ConstructBodyFromBrowserInitiatedPostData());
|
| + post_body ? post_body : post_data_);
|
| }
|
|
|
| StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams()
|
| @@ -683,7 +670,7 @@ void NavigationEntryImpl::ResetForCommit(FrameNavigationEntry* frame_entry) {
|
| // cleared here.
|
| // TODO(creis): This state should be moved to NavigationRequest once
|
| // PlzNavigate is enabled.
|
| - SetBrowserInitiatedPostData(nullptr);
|
| + SetPostData(nullptr);
|
| set_is_renderer_initiated(false);
|
| set_transferred_global_request_id(GlobalRequestID());
|
| set_should_replace_entry(false);
|
|
|