diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 19:26:21 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 19:26:21 +0000 |
commit | eb69ca8e12e0d7a7d42ea328a4597475d5198bc7 (patch) | |
tree | a1ea9d405dabda01870c54d7b7c589c97455aea3 /webkit/glue/glue_serialize.cc | |
parent | 9a28816a0ba445495d0574c7c810ac71a06afdd8 (diff) | |
download | chromium_src-eb69ca8e12e0d7a7d42ea328a4597475d5198bc7.zip chromium_src-eb69ca8e12e0d7a7d42ea328a4597475d5198bc7.tar.gz chromium_src-eb69ca8e12e0d7a7d42ea328a4597475d5198bc7.tar.bz2 |
Add support for serializing WebHistoryItem::itemSequenceNumber.
This is protected with an #ifdef so that I can land the Chromium side in
advance of the WebKit patch. See webkit.org/b/40451 for details.
R=sky
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2811007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49818 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/glue_serialize.cc')
-rw-r--r-- | webkit/glue/glue_serialize.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/webkit/glue/glue_serialize.cc b/webkit/glue/glue_serialize.cc index 4b4efd3..6ff22a9 100644 --- a/webkit/glue/glue_serialize.cc +++ b/webkit/glue/glue_serialize.cc @@ -55,12 +55,17 @@ struct SerializeObject { // 6: Adds support for documentSequenceNumbers // 7: Adds support for stateObject // 8: Adds support for file range and modification time +// 9: Adds support for itemSequenceNumbers // 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. // +#if defined(WEBKIT_BUG_40451_IS_FIXED) +int kVersion = 9; +#else int kVersion = 8; +#endif // A bunch of convenience functions to read/write to SerializeObjects. // The serializers assume the input data is in the correct format and so does @@ -195,7 +200,8 @@ inline WebString ReadString(const SerializeObject* obj) { const void* data; if (!ReadBytes(obj, &data, bytes)) return WebString(); - return WebString(static_cast<const WebUChar*>(data), bytes / sizeof(WebUChar)); + return WebString(static_cast<const WebUChar*>(data), + bytes / sizeof(WebUChar)); } // Writes a Vector of Strings into a SerializeObject for serialization. @@ -305,6 +311,10 @@ static void WriteHistoryItem( WriteStringVector(item.documentState(), obj); +#if defined(WEBKIT_BUG_40451_IS_FIXED) + if (kVersion >= 9) + WriteInteger64(item.itemSequenceNumber(), obj); +#endif if (kVersion >= 6) WriteInteger64(item.documentSequenceNumber(), obj); if (kVersion >= 7) { @@ -364,6 +374,10 @@ static WebHistoryItem ReadHistoryItem( item.setDocumentState(ReadStringVector(obj)); +#if defined(WEBKIT_BUG_40451_IS_FIXED) + if (obj->version >= 9) + item.setItemSequenceNumber(ReadInteger64(obj)); +#endif if (obj->version >= 6) item.setDocumentSequenceNumber(ReadInteger64(obj)); if (obj->version >= 7) { |