OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_ |
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 // Decodes the meta info from the supplied sub-node dictionary. The values | 151 // Decodes the meta info from the supplied sub-node dictionary. The values |
152 // found will be inserted in meta_info_map with the given prefix added to the | 152 // found will be inserted in meta_info_map with the given prefix added to the |
153 // start of their keys. | 153 // start of their keys. |
154 void DecodeMetaInfoHelper(const base::DictionaryValue& dict, | 154 void DecodeMetaInfoHelper(const base::DictionaryValue& dict, |
155 const std::string& prefix, | 155 const std::string& prefix, |
156 BookmarkNode::MetaInfoMap* meta_info_map); | 156 BookmarkNode::MetaInfoMap* meta_info_map); |
157 | 157 |
158 // Updates the check-sum with the given string. | 158 // Updates the check-sum with the given string. |
159 void UpdateChecksum(const std::string& str); | 159 void UpdateChecksum(const std::string& str); |
160 void UpdateChecksum(const string16& str); | 160 void UpdateChecksum(const base::string16& str); |
161 | 161 |
162 // Updates the check-sum with the given contents of URL/folder bookmark node. | 162 // Updates the check-sum with the given contents of URL/folder bookmark node. |
163 // NOTE: These functions take in individual properties of a bookmark node | 163 // NOTE: These functions take in individual properties of a bookmark node |
164 // instead of taking in a BookmarkNode for efficiency so that we don't convert | 164 // instead of taking in a BookmarkNode for efficiency so that we don't convert |
165 // various data-types to UTF16 strings multiple times - once for serializing | 165 // various data-types to UTF16 strings multiple times - once for serializing |
166 // and once for computing the check-sum. | 166 // and once for computing the check-sum. |
167 // The url parameter should be a valid UTF8 string. | 167 // The url parameter should be a valid UTF8 string. |
168 void UpdateChecksumWithUrlNode(const std::string& id, | 168 void UpdateChecksumWithUrlNode(const std::string& id, |
169 const string16& title, | 169 const base::string16& title, |
170 const std::string& url); | 170 const std::string& url); |
171 void UpdateChecksumWithFolderNode(const std::string& id, | 171 void UpdateChecksumWithFolderNode(const std::string& id, |
172 const string16& title); | 172 const base::string16& title); |
173 | 173 |
174 // Initializes/Finalizes the checksum. | 174 // Initializes/Finalizes the checksum. |
175 void InitializeChecksum(); | 175 void InitializeChecksum(); |
176 void FinalizeChecksum(); | 176 void FinalizeChecksum(); |
177 | 177 |
178 // Whether or not IDs were reassigned by the codec. | 178 // Whether or not IDs were reassigned by the codec. |
179 bool ids_reassigned_; | 179 bool ids_reassigned_; |
180 | 180 |
181 // Whether or not IDs are valid. This is initially true, but set to false | 181 // Whether or not IDs are valid. This is initially true, but set to false |
182 // if an id is missing or not unique. | 182 // if an id is missing or not unique. |
(...skipping 16 matching lines...) Expand all Loading... |
199 // Meta info set on bookmark model root. | 199 // Meta info set on bookmark model root. |
200 BookmarkNode::MetaInfoMap model_meta_info_map_; | 200 BookmarkNode::MetaInfoMap model_meta_info_map_; |
201 | 201 |
202 // Sync transaction version set on bookmark model root. | 202 // Sync transaction version set on bookmark model root. |
203 int64 model_sync_transaction_version_; | 203 int64 model_sync_transaction_version_; |
204 | 204 |
205 DISALLOW_COPY_AND_ASSIGN(BookmarkCodec); | 205 DISALLOW_COPY_AND_ASSIGN(BookmarkCodec); |
206 }; | 206 }; |
207 | 207 |
208 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_ | 208 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_ |
OLD | NEW |