Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Side by Side Diff: content/browser/frame_host/frame_navigation_entry.cc

Issue 2012913002: Deduping conversions between ResourceRequestBody/WebHTTPBody/ExplodedHttpBody. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@get-rid-of-exploded-http-body
Patch Set: Calling ResourceRequestBody::AppendFileRange with optional_body_file_path. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/child/web_url_request_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 scoped_refptr<ResourceRequestBody> FrameNavigationEntry::GetPostData() const { 86 scoped_refptr<ResourceRequestBody> FrameNavigationEntry::GetPostData() const {
87 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); 87 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries());
88 if (method_ != "POST") 88 if (method_ != "POST")
89 return nullptr; 89 return nullptr;
90 90
91 // Generate the body from the PageState. 91 // Generate the body from the PageState.
92 ExplodedPageState exploded_state; 92 ExplodedPageState exploded_state;
93 if (!DecodePageState(page_state_.ToEncodedData(), &exploded_state)) 93 if (!DecodePageState(page_state_.ToEncodedData(), &exploded_state))
94 return nullptr; 94 return nullptr;
95 95
96 scoped_refptr<ResourceRequestBody> body = new ResourceRequestBody(); 96 return exploded_state.top.http_body.request_body;
97 if (!GeneratePostData(exploded_state.top.http_body, body.get()))
98 return nullptr;
99
100 return body;
101 } 97 }
102 98
103 } // namespace content 99 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/web_url_request_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698