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

Unified Diff: content/common/page_state_serialization.cc

Issue 134813003: Add the referrer policy to the page state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« no previous file with comments | « content/common/page_state_serialization.h ('k') | content/common/page_state_serialization_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/page_state_serialization.cc
diff --git a/content/common/page_state_serialization.cc b/content/common/page_state_serialization.cc
index 1a7db619442e43bf3b91fd1c78817a18621004e8..9e5715015748e4677bfbbeac96f0a41c47b39949 100644
--- a/content/common/page_state_serialization.cc
+++ b/content/common/page_state_serialization.cc
@@ -188,12 +188,13 @@ struct SerializeObject {
// 15: Removes a bunch of values we defined but never used.
// 16: Switched from blob urls to blob uuids.
// 17: Add a target frame id number.
+// 18: Add referrer policy.
//
// NOTE: If the version is -1, then the pickle contains only a URL string.
// See ReadPageState.
//
const int kMinVersion = 11;
-const int kCurrentVersion = 17;
+const int kCurrentVersion = 18;
// A bunch of convenience functions to read/write to SerializeObjects. The
// de-serializers assume the input data will be in the correct format and fall
@@ -504,6 +505,7 @@ void WriteFrameState(
WriteInteger64(state.item_sequence_number, obj);
WriteInteger64(state.document_sequence_number, obj);
WriteInteger64(state.target_frame_id, obj);
+ WriteInteger(state.referrer_policy, obj);
bool has_state_object = !state.state_object.is_null();
WriteBoolean(has_state_object, obj);
@@ -556,6 +558,10 @@ void ReadFrameState(SerializeObject* obj, bool is_top,
state->document_sequence_number = ReadInteger64(obj);
if (obj->version >= 17)
state->target_frame_id = ReadInteger64(obj);
+ if (obj->version >= 18) {
+ state->referrer_policy =
+ static_cast<blink::WebReferrerPolicy>(ReadInteger(obj));
+ }
bool has_state_object = ReadBoolean(obj);
if (has_state_object)
@@ -666,7 +672,8 @@ ExplodedFrameState::ExplodedFrameState()
: item_sequence_number(0),
document_sequence_number(0),
target_frame_id(0),
- page_scale_factor(0.0) {
+ page_scale_factor(0.0),
+ referrer_policy(blink::WebReferrerPolicyDefault) {
}
ExplodedFrameState::~ExplodedFrameState() {
« no previous file with comments | « content/common/page_state_serialization.h ('k') | content/common/page_state_serialization_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698