summaryrefslogtreecommitdiffstats
path: root/webkit/glue/glue_serialize.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-28 23:49:15 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-28 23:49:15 +0000
commit0e1b4f0b69c9545d7a8375e3be51f6cfc28f9162 (patch)
tree8ef3213da35bc0e00908965d638d429828959876 /webkit/glue/glue_serialize.cc
parent5082ae373757768af11a2f758c19c878ac611a7f (diff)
downloadchromium_src-0e1b4f0b69c9545d7a8375e3be51f6cfc28f9162.zip
chromium_src-0e1b4f0b69c9545d7a8375e3be51f6cfc28f9162.tar.gz
chromium_src-0e1b4f0b69c9545d7a8375e3be51f6cfc28f9162.tar.bz2
Make WebHistoryItem serialization include the documentSequenceNumber.
This is a slight variation of http://codereview.chromium.org/556057. In this CL, I change WriteHistoryItem to switch on kVersion to decide whether or not to write out the documentSequenceNumber. This seemed better than my previous solution of appending documentSequenceNumber. TBR=sky BUG=none TEST=none Review URL: http://codereview.chromium.org/549196 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37460 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/glue_serialize.cc')
-rw-r--r--webkit/glue/glue_serialize.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/webkit/glue/glue_serialize.cc b/webkit/glue/glue_serialize.cc
index b285e12..f27b549 100644
--- a/webkit/glue/glue_serialize.cc
+++ b/webkit/glue/glue_serialize.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -49,12 +49,13 @@ struct SerializeObject {
// This version checks and reads v1 and v2 correctly.
// 4: Adds support for storing FormData::identifier().
// 5: Adds support for empty FormData
+// 6: Adds support for documentSequenceNumbers
// Should be const, but unit tests may modify it.
//
// NOTE: If the version is -1, then the pickle contains only a URL string.
// See CreateHistoryStateForURL.
//
-int kVersion = 5;
+int kVersion = 6;
// A bunch of convenience functions to read/write to SerializeObjects.
// The serializers assume the input data is in the correct format and so does
@@ -287,6 +288,9 @@ static void WriteHistoryItem(
WriteStringVector(item.documentState(), obj);
+ if (kVersion >= 6)
+ WriteInteger64(item.documentSequenceNumber(), obj);
+
// Yes, the referrer is written twice. This is for backwards
// compatibility with the format.
WriteFormData(item.httpBody(), obj);
@@ -337,6 +341,9 @@ static WebHistoryItem ReadHistoryItem(
item.setDocumentState(ReadStringVector(obj));
+ if (obj->version >= 6)
+ item.setDocumentSequenceNumber(ReadInteger64(obj));
+
// The extra referrer string is read for backwards compat.
const WebHTTPBody& http_body = ReadFormData(obj);
const WebString& http_content_type = ReadString(obj);