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

Unified Diff: content/browser/frame_host/frame_navigation_entry.cc

Issue 1907443006: PlzNavigate: store POST data in the FrameNavigationEntry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
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 a788c45b8b325a75727f8a352b10316bfac3128d..97e863e39d84edb1a5e6028885a6dd93eda4e92d 100644
--- a/content/browser/frame_host/frame_navigation_entry.cc
+++ b/content/browser/frame_host/frame_navigation_entry.cc
@@ -6,6 +6,10 @@
#include <utility>
+#include "base/strings/utf_string_conversions.h"
Charlie Reis 2016/05/16 21:16:42 Is this stale?
clamy 2016/05/19 13:11:57 Yes. Removed it.
+#include "content/common/page_state_serialization.h"
+#include "content/common/site_isolation_policy.h"
+
namespace content {
FrameNavigationEntry::FrameNavigationEntry()
@@ -80,4 +84,22 @@ void FrameNavigationEntry::set_document_sequence_number(
document_sequence_number_ = document_sequence_number;
}
+scoped_refptr<ResourceRequestBody> FrameNavigationEntry::GetPostData() const {
+ DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries());
+ scoped_refptr<ResourceRequestBody> body;
+ if (method_ != "POST")
+ return body;
+
+ // Generate the body from the PageState.
+ ExplodedPageState exploded_state;
+ if (!DecodePageState(page_state_.ToEncodedData(), &exploded_state))
+ return body;
+
+ body = new ResourceRequestBody();
+ if (!GeneratePostData(exploded_state.top.http_body, body.get()))
+ return nullptr;
+
+ return body;
+}
+
} // namespace content
« no previous file with comments | « content/browser/frame_host/frame_navigation_entry.h ('k') | content/browser/frame_host/navigation_entry_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698