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

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

Issue 1907443006: PlzNavigate: store POST data in the FrameNavigationEntry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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.h
diff --git a/content/browser/frame_host/frame_navigation_entry.h b/content/browser/frame_host/frame_navigation_entry.h
index e93eb010a44a061fb2d6c0d774c7b1883569d7c7..dd87ae6fe108a0dc437c26aa46b871964734b358 100644
--- a/content/browser/frame_host/frame_navigation_entry.h
+++ b/content/browser/frame_host/frame_navigation_entry.h
@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "content/browser/site_instance_impl.h"
+#include "content/common/resource_request_body.h"
#include "content/public/common/page_state.h"
#include "content/public/common/referrer.h"
@@ -37,7 +38,8 @@ class CONTENT_EXPORT FrameNavigationEntry
const GURL& url,
const Referrer& referrer,
const std::string& method,
- int64_t post_id);
+ int64_t post_id,
+ scoped_refptr<ResourceRequestBody> post_data);
// Creates a copy of this FrameNavigationEntry that can be modified
// independently from the original.
@@ -52,7 +54,8 @@ class CONTENT_EXPORT FrameNavigationEntry
const Referrer& referrer,
const PageState& page_state,
const std::string& method,
- int64_t post_id);
+ int64_t post_id,
+ scoped_refptr<ResourceRequestBody> post_data);
// The ID of the FrameTreeNode this entry is for. -1 for the main frame,
// since we don't always know the FrameTreeNode ID when creating the overall
@@ -118,6 +121,14 @@ class CONTENT_EXPORT FrameNavigationEntry
int64_t post_id() const { return post_id_; }
void set_post_id(int64_t post_id) { post_id_ = post_id; }
+ // The data sent during a POST navigation. Returns nullptr if the navigation
+ // is not a POST.
+ ResourceRequestBody* post_data() const { return post_data_.get(); }
+ void set_post_data(scoped_refptr<ResourceRequestBody> post_data) {
+ DCHECK(!post_data || method_ == "POST");
+ post_data_ = post_data;
+ }
+
private:
friend class base::RefCounted<FrameNavigationEntry>;
virtual ~FrameNavigationEntry();
@@ -140,6 +151,7 @@ class CONTENT_EXPORT FrameNavigationEntry
PageState page_state_;
std::string method_;
int64_t post_id_;
+ scoped_refptr<ResourceRequestBody> post_data_;
Charlie Reis 2016/04/27 23:00:55 This wasn't stored on NavigationEntry before, was
clamy 2016/04/29 16:07:16 Done.
DISALLOW_COPY_AND_ASSIGN(FrameNavigationEntry);
};

Powered by Google App Engine
This is Rietveld 408576698