OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file contains (de)serialization (or if you like python, pickling) | 5 // This file contains (de)serialization (or if you like python, pickling) |
6 // methods for various objects that we want to persist. | 6 // methods for various objects that we want to persist. |
7 // In serialization, we write an object's state to a string in some opaque | 7 // In serialization, we write an object's state to a string in some opaque |
8 // format. Deserialization reconstructs the object's state from such a string. | 8 // format. Deserialization reconstructs the object's state from such a string. |
9 | 9 |
10 #ifndef WEBKIT_GLUE_GLUE_SERIALIZE_H_ | 10 #ifndef WEBKIT_GLUE_GLUE_SERIALIZE_H_ |
11 #define WEBKIT_GLUE_GLUE_SERIALIZE_H_ | 11 #define WEBKIT_GLUE_GLUE_SERIALIZE_H_ |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" |
17 #include "webkit/glue/webkit_glue_export.h" | 17 #include "webkit/glue/webkit_glue_export.h" |
18 | 18 |
19 namespace webkit_glue { | 19 namespace webkit_glue { |
20 | 20 |
21 // HistoryItem serialization. | 21 // HistoryItem serialization. |
22 WEBKIT_GLUE_EXPORT std::string HistoryItemToString( | 22 WEBKIT_GLUE_EXPORT std::string HistoryItemToString( |
23 const WebKit::WebHistoryItem& item); | 23 const WebKit::WebHistoryItem& item); |
24 WEBKIT_GLUE_EXPORT WebKit::WebHistoryItem HistoryItemFromString( | 24 WEBKIT_GLUE_EXPORT WebKit::WebHistoryItem HistoryItemFromString( |
25 const std::string& serialized_item); | 25 const std::string& serialized_item); |
26 | 26 |
27 // Reads file paths from the HTTP body of a serialized WebHistoryItem. | 27 // Reads file paths from the HTTP body and the file input elements of a |
| 28 // serialized WebHistoryItem. |
28 WEBKIT_GLUE_EXPORT std::vector<FilePath> FilePathsFromHistoryState( | 29 WEBKIT_GLUE_EXPORT std::vector<FilePath> FilePathsFromHistoryState( |
29 const std::string& content_state); | 30 const std::string& content_state); |
30 | 31 |
31 // For testing purposes only. | 32 // For testing purposes only. |
32 WEBKIT_GLUE_EXPORT void HistoryItemToVersionedString( | 33 WEBKIT_GLUE_EXPORT void HistoryItemToVersionedString( |
33 const WebKit::WebHistoryItem& item, | 34 const WebKit::WebHistoryItem& item, |
34 int version, | 35 int version, |
35 std::string* serialized_item); | 36 std::string* serialized_item); |
36 WEBKIT_GLUE_EXPORT int HistoryItemCurrentVersion(); | 37 WEBKIT_GLUE_EXPORT int HistoryItemCurrentVersion(); |
37 | 38 |
38 } // namespace webkit_glue | 39 } // namespace webkit_glue |
39 | 40 |
40 #endif // #ifndef WEBKIT_GLUE_GLUE_SERIALIZE_H_ | 41 #endif // #ifndef WEBKIT_GLUE_GLUE_SERIALIZE_H_ |
OLD | NEW |